emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/magit 3deaad3d29 16/28: Use mapcan instead of cl-mapcan


From: Jonas Bernoulli
Subject: [nongnu] elpa/magit 3deaad3d29 16/28: Use mapcan instead of cl-mapcan
Date: Fri, 6 Dec 2024 17:17:04 -0500 (EST)

branch: elpa/magit
commit 3deaad3d29a552e6cf9370dcb0b6a0e676ffb5bc
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    Use mapcan instead of cl-mapcan
    
    We used to use `cl-mapcan' to support Emacs 25, but since we require
    at least version 26.1 now, we can switch to the optimized `mapcan'.
---
 lisp/magit-base.el    | 14 +++++++-------
 lisp/magit-mode.el    |  2 +-
 lisp/magit-remote.el  |  4 ++--
 lisp/magit-repos.el   |  6 +++---
 lisp/magit-section.el | 14 +++++++-------
 lisp/magit-tag.el     |  2 +-
 lisp/magit.el         |  2 +-
 7 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/lisp/magit-base.el b/lisp/magit-base.el
index b84f372cc0..69e1b2a3f9 100644
--- a/lisp/magit-base.el
+++ b/lisp/magit-base.el
@@ -871,10 +871,10 @@ See info node `(magit)Debugging Tools' for more 
information."
               #'shell-quote-argument
               `(,(concat invocation-directory invocation-name)
                 "-Q" "--eval" "(setq debug-on-error t)"
-                ,@(cl-mapcan
+                ,@(mapcan
                    (lambda (dir) (list "-L" dir))
                    (delete-dups
-                    (cl-mapcan
+                    (mapcan
                      (lambda (lib)
                        (if-let ((path (locate-library lib)))
                            (list (file-name-directory path))
@@ -911,11 +911,11 @@ as STRING."
         (i 0))
     `(let ((,s ,string))
        (let ,(save-match-data
-               (cl-mapcan (lambda (sym)
-                            (cl-incf i)
-                            (and (not (eq (aref (symbol-name sym) 0) ?_))
-                                 (list (list sym (list 'match-string i s)))))
-                          varlist))
+               (mapcan (lambda (sym)
+                         (cl-incf i)
+                         (and (not (eq (aref (symbol-name sym) 0) ?_))
+                              (list (list sym (list 'match-string i s)))))
+                       varlist))
          ,@body))))
 
 (defun magit-delete-line ()
diff --git a/lisp/magit-mode.el b/lisp/magit-mode.el
index 2d3370af2a..e1b47a00e9 100644
--- a/lisp/magit-mode.el
+++ b/lisp/magit-mode.el
@@ -1051,7 +1051,7 @@ Run hooks `magit-pre-refresh-hook' and 
`magit-post-refresh-hook'."
       (when magit-refresh-verbose
         (message "Refreshing buffer `%s'..." (buffer-name)))
       (let* ((buffer (current-buffer))
-             (windows (cl-mapcan
+             (windows (mapcan
                        (lambda (window)
                          (with-selected-window window
                            (with-current-buffer buffer
diff --git a/lisp/magit-remote.el b/lisp/magit-remote.el
index 3f9aa429ba..aa218ee8ff 100644
--- a/lisp/magit-remote.el
+++ b/lisp/magit-remote.el
@@ -209,8 +209,8 @@ the now stale refspecs.  Other stale branches are not 
removed."
                     nil refs))
               (magit-confirm 'prune-stale-refspecs nil
                 (format "Prune %%d stale refspecs and %d branches"
-                        (length (cl-mapcan (lambda (s) (copy-sequence (cdr s)))
-                                           stale)))
+                        (length (mapcan (lambda (s) (copy-sequence (cdr s)))
+                                        stale)))
                 nil
                 (mapcar (pcase-lambda (`(,refspec . ,refs))
                           (concat refspec "\n"
diff --git a/lisp/magit-repos.el b/lisp/magit-repos.el
index 95fbd65357..335713aa6b 100644
--- a/lisp/magit-repos.el
+++ b/lisp/magit-repos.el
@@ -502,9 +502,9 @@ instead."
                           (or (magit-toplevel) default-directory)))))
 
 (defun magit-list-repos ()
-  (cl-mapcan (pcase-lambda (`(,dir . ,depth))
-               (magit-list-repos-1 dir depth))
-             magit-repository-directories))
+  (mapcan (pcase-lambda (`(,dir . ,depth))
+            (magit-list-repos-1 dir depth))
+          magit-repository-directories))
 
 (defun magit-list-repos-1 (directory depth)
   (cond ((file-readable-p (expand-file-name ".git" directory))
diff --git a/lisp/magit-section.el b/lisp/magit-section.el
index 89c41b58b2..cd77f558df 100644
--- a/lisp/magit-section.el
+++ b/lisp/magit-section.el
@@ -2303,7 +2303,7 @@ Configuration'."
        (or magit--imenu-group-types
            magit--imenu-item-types)
        (let ((index
-              (cl-mapcan
+              (mapcan
                (lambda (section)
                  (cond
                   (magit--imenu-group-types
@@ -2436,12 +2436,12 @@ with the variables' values as arguments, which were 
recorded by
   (format "%s%s"
           (substring (symbol-name major-mode) 0 -5)
           (if-let ((vars (get major-mode 'magit-bookmark-variables)))
-              (cl-mapcan (lambda (var)
-                           (let ((val (symbol-value var)))
-                             (if (and val (atom val))
-                                 (list val)
-                               val)))
-                         vars)
+              (mapcan (lambda (var)
+                        (let ((val (symbol-value var)))
+                          (if (and val (atom val))
+                              (list val)
+                            val)))
+                      vars)
             "")))
 
 ;;; Bitmaps
diff --git a/lisp/magit-tag.el b/lisp/magit-tag.el
index aa2647d700..1b4f282daf 100644
--- a/lisp/magit-tag.el
+++ b/lisp/magit-tag.el
@@ -226,7 +226,7 @@ a tag qualifies as a release tag."
     (mapcar
      #'cdr
      (nreverse
-      (cl-sort (cl-mapcan
+      (cl-sort (mapcan
                 (lambda (line)
                   (and (string-match " +" line)
                        (let ((tag (substring line 0 (match-beginning 0)))
diff --git a/lisp/magit.el b/lisp/magit.el
index b450236537..ee6d04d6a0 100644
--- a/lisp/magit.el
+++ b/lisp/magit.el
@@ -514,7 +514,7 @@ is run in the top-level directory of the current working 
tree."
 (defun magit-read-gpg-secret-key
     (prompt &optional initial-input history predicate default)
   (require 'epa)
-  (let* ((keys (cl-mapcan
+  (let* ((keys (mapcan
                 (lambda (cert)
                   (and (or (not predicate)
                            (funcall predicate cert))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]