[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transient ebcad9e6fe 127/366: Use seq instead of dash
From: |
Jonas Bernoulli |
Subject: |
[elpa] externals/transient ebcad9e6fe 127/366: Use seq instead of dash |
Date: |
Tue, 25 Jan 2022 18:54:33 -0500 (EST) |
branch: externals/transient
commit ebcad9e6fe4cd21210191fd4159fddce65fa1b3a
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
Use seq instead of dash
Closes #66.
---
lisp/transient.el | 37 ++++++++++++++++++++++++-------------
1 file changed, 24 insertions(+), 13 deletions(-)
diff --git a/lisp/transient.el b/lisp/transient.el
index bcc3bf608a..07e23fe173 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -4,7 +4,7 @@
;; Author: Jonas Bernoulli <jonas@bernoul.li>
;; Homepage: https://github.com/magit/transient
-;; Package-Requires: ((emacs "25.1") (dash "2.15.0"))
+;; Package-Requires: ((emacs "25.1"))
;; Keywords: bindings
;; This file is not part of GNU Emacs.
@@ -48,9 +48,9 @@
;;; Code:
(require 'cl-lib)
-(require 'dash)
(require 'eieio)
(require 'format-spec)
+(require 'seq)
(eval-when-compile
(require 'subr-x))
@@ -413,8 +413,8 @@ should not change it manually.")
(defun transient-save-history ()
(setq transient-history
(cl-sort (mapcar (pcase-lambda (`(,key . ,val))
- (cons key (-take transient-history-limit
- (delete-dups val))))
+ (cons key (seq-take (delete-dups val)
+ transient-history-limit)))
transient-history)
#'string< :key #'car))
(transient--pp-to-file transient-history transient-history-file))
@@ -987,9 +987,11 @@ See info node `(transient)Modifying Existing Transients'."
(defun transient--layout-member-1 (loc layout remove)
(cond ((listp layout)
- (--any (transient--layout-member-1 loc it remove) layout))
+ (seq-some (lambda (elt) (transient--layout-member-1 loc elt remove))
+ layout))
((vectorp (car (aref layout 3)))
- (--any (transient--layout-member-1 loc it remove) (aref layout 3)))
+ (seq-some (lambda (elt) (transient--layout-member-1 loc elt remove))
+ (aref layout 3)))
(remove
(aset layout 3
(delq (car (transient--group-member loc layout))
@@ -2571,8 +2573,9 @@ have a history of their own.")
(oref group suffixes)))
(rs (apply #'max (mapcar #'length columns)))
(cs (length columns))
- (cw (--map (apply #'max (mapcar #'length it)) columns))
- (cc (-reductions-from (apply-partially #'+ 3) 0 cw)))
+ (cw (mapcar (lambda (col) (apply #'max (mapcar #'length col)))
+ columns))
+ (cc (transient--seq-reductions-from (apply-partially #'+ 3) cw 0)))
(dotimes (r rs)
(dotimes (c cs)
(insert (make-string (- (nth c cc) (current-column)) ?\s))
@@ -2663,9 +2666,9 @@ Optional support for popup buttons is also implemented
here."
(let ((len (length transient--redisplay-key))
(seq (cl-coerce (edmacro-parse-keys key t) 'list)))
(cond
- ((equal (-take len seq) transient--redisplay-key)
- (let ((pre (key-description (vconcat (-take len seq))))
- (suf (key-description (vconcat (-drop len seq)))))
+ ((equal (seq-take seq len) transient--redisplay-key)
+ (let ((pre (key-description (vconcat (seq-take seq len))))
+ (suf (key-description (vconcat (seq-drop seq len)))))
(setq pre (replace-regexp-in-string "RET" "C-m" pre t))
(setq pre (replace-regexp-in-string "TAB" "C-i" pre t))
(setq suf (replace-regexp-in-string "RET" "C-m" suf t))
@@ -2783,8 +2786,8 @@ If the OBJ's `key' is currently unreachable, then apply
the face
(defun transient--key-unreachable-p (obj)
(and transient--redisplay-key
(let ((key (oref obj key)))
- (not (or (equal (-take (length transient--redisplay-key)
- (cl-coerce (edmacro-parse-keys key t) 'list))
+ (not (or (equal (seq-take (cl-coerce (edmacro-parse-keys key t) 'list)
+ (length transient--redisplay-key))
transient--redisplay-key)
(transient--lookup-key transient-sticky-map (kbd key)))))))
@@ -3122,6 +3125,14 @@ we stop there."
((string-equal key "Q") "M-q")
(t key))))
+;;;; Missing from Emacs
+
+(defun transient--seq-reductions-from (function sequence initial-value)
+ (let ((acc (list initial-value)))
+ (seq-doseq (elt sequence)
+ (push (funcall function (car acc) elt) acc))
+ (nreverse acc)))
+
;;; Font-Lock
(defconst transient-font-lock-keywords
- [elpa] externals/transient 3668aeb81d 053/366: transient--history-key: New generic function, (continued)
- [elpa] externals/transient 3668aeb81d 053/366: transient--history-key: New generic function, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient e627d45166 054/366: transient-prefix: Add new history-key slot, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 8a0428e037 056/366: transient-args: Remove unnecessary form, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 47b79754e3 055/366: transient--history-push: Define as generic function, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 61e631aa6d 068/366: transient-history: Fix doc-string quoting, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 2ad749e1fa 081/366: Fix doc-string typo, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 71687ba790 085/366: No longer allow characters as pseudo suffixes, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 62b18fef2b 115/366: transient-mode-line-format: Don't without a window-system, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 75de1f0418 120/366: transient-detect-key-conflicts: But without locking Emacs, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient c59c48530a 122/366: transient--{suspend, resume}-override: New functions, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient ebcad9e6fe 127/366: Use seq instead of dash,
Jonas Bernoulli <=
- [elpa] externals/transient d49f85a8c1 158/366: Support scroll-bar-toolkit-scroll, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 7502390bbd 190/366: transient-column{, s}: Optionally pad keys, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient f0f3e2b9fe 195/366: transient-infix-value: Fix typo in a doc-string, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 8423bc69e7 199/366: manual: Update outdated function signature, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 101c0aeaa1 023/366: transient--insert-suffix: Fix move of last child of a group, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 0d9a1b5536 107/366: manual: Document prefix slots, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 7e2b98c701 109/366: Fix doc string typo, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 3fe1b7ea86 086/366: transient--kbd: New function, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 0312b9302d 099/366: transient-args: Remove SEPARATE argument, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 7d0db2826b 100/366: transient-args: No longer support an object as PREFIX, Jonas Bernoulli, 2022/01/25