branch: elpa/git-commit commit 3d0d347054e35c9a88964bec52b46335ede607c2 Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
Use flatten-tree New in Emacs 27.1 and also provided by the Compat package. --- lisp/magit-diff.el | 2 +- lisp/magit-git.el | 24 ++++++++++++------------ lisp/magit-log.el | 2 +- lisp/magit-process.el | 2 +- lisp/magit-repos.el | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el index 72b28b5f8d..b51aa32477 100644 --- a/lisp/magit-diff.el +++ b/lisp/magit-diff.el @@ -2085,7 +2085,7 @@ keymap is the parent of their keymaps.") (defun magit--insert-diff (&rest args) (declare (indent 0)) (pcase-let ((`(,cmd . ,args) - (-flatten args)) + (flatten-tree args)) (magit-git-global-arguments (remove "--literal-pathspecs" magit-git-global-arguments))) ;; As of Git 2.19.0, we need to generate diffs with diff --git a/lisp/magit-git.el b/lisp/magit-git.el index 0604bbda5d..9266141778 100644 --- a/lisp/magit-git.el +++ b/lisp/magit-git.el @@ -354,7 +354,7 @@ to do the following. * Flatten ARGS, removing nil arguments. * Prepend `magit-git-global-arguments' to ARGS. * On w32 systems, encode to `w32-ansi-code-page'." - (setq args (append magit-git-global-arguments (-flatten args))) + (setq args (append magit-git-global-arguments (flatten-tree args))) (if (and (eq system-type 'windows-nt) (boundp 'w32-ansi-code-page)) ;; On w32, the process arguments *must* be encoded in the ;; current code-page (see #3250). @@ -429,7 +429,7 @@ still subject to major changes. Also see `magit-git-string-p'." If there is no output, return nil. If the output begins with a newline, return an empty string. Like `magit-git-string' but ignore `magit-git-debug'." - (setq args (-flatten args)) + (setq args (flatten-tree args)) (magit--with-refresh-cache (cons default-directory args) (magit--with-temp-process-buffer (magit-process-git (list t nil) args) @@ -439,7 +439,7 @@ ignore `magit-git-debug'." (defun magit-git-output (&rest args) "Execute Git with ARGS, returning its output." - (setq args (-flatten args)) + (setq args (flatten-tree args)) (magit--with-refresh-cache (cons default-directory args) (magit--with-temp-process-buffer (magit-process-git (list t nil) args) @@ -521,7 +521,7 @@ add a section in the respective process buffer." "Execute Git with ARGS, returning the first line of its output. If there is no output, return nil. If the output begins with a newline, return an empty string." - (setq args (-flatten args)) + (setq args (flatten-tree args)) (magit--with-refresh-cache (cons default-directory args) (magit--with-temp-process-buffer (apply #'magit-git-insert args) @@ -557,7 +557,7 @@ the buffer to the inserted text, move to its beginning, and then call function WASHER with ARGS as its sole argument." (declare (indent 1)) (let ((beg (point))) - (setq args (-flatten args)) + (setq args (flatten-tree args)) (magit-git-insert args) (if (= (point) beg) (magit-cancel-section) @@ -2240,13 +2240,13 @@ and this option only controls what face is used.") (setq upstream target) (setq combined (delete target combined)))))) (mapconcat #'identity - (-flatten `(,state - ,head - ,upstream - ,@(nreverse tags) - ,@(nreverse combined) - ,@(nreverse remotes) - ,@other)) + (flatten-tree `(,state + ,head + ,upstream + ,@(nreverse tags) + ,@(nreverse combined) + ,@(nreverse remotes) + ,@other)) " "))))) (defun magit-object-type (object) diff --git a/lisp/magit-log.el b/lisp/magit-log.el index f6ebb546ec..4328a56b8a 100644 --- a/lisp/magit-log.el +++ b/lisp/magit-log.el @@ -1228,7 +1228,7 @@ Do not add this to a hook variable." (defvar magit-log-format-message-function #'magit-log-propertize-keywords) (defun magit-log-wash-log (style args) - (setq args (-flatten args)) + (setq args (flatten-tree args)) (when (and (member "--graph" args) (member "--color" args)) (let ((ansi-color-apply-face-function diff --git a/lisp/magit-process.el b/lisp/magit-process.el index 795a1344cf..38eacd43d0 100644 --- a/lisp/magit-process.el +++ b/lisp/magit-process.el @@ -485,7 +485,7 @@ and still alive), as well as the respective Magit status buffer. See `magit-start-process' for more information." (message "Running %s %s" (magit-git-executable) - (let ((m (mapconcat #'identity (-flatten args) " "))) + (let ((m (mapconcat #'identity (flatten-tree args) " "))) (remove-list-of-text-properties 0 (length m) '(face) m) m)) (magit-start-git nil args)) diff --git a/lisp/magit-repos.el b/lisp/magit-repos.el index 6f9ba37837..9dd924fcc2 100644 --- a/lisp/magit-repos.el +++ b/lisp/magit-repos.el @@ -308,7 +308,7 @@ If it contains \"%s\" then the directory is substituted for that." (sort-fn sort-fn) (sort-set nil) (t t))) - (-flatten props)))) + (flatten-tree props)))) magit-repolist-columns)))) (defun magit-repolist-refresh ()