branch: elpa/magit
commit e51193b934a8bf25c10c5f704dc262a193d34167
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>

    magit-submodule--format-module: Spin out new function
---
 lisp/magit-submodule.el | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/lisp/magit-submodule.el b/lisp/magit-submodule.el
index 042ae93b5d..6f2e8b4d7b 100644
--- a/lisp/magit-submodule.el
+++ b/lisp/magit-submodule.el
@@ -655,28 +655,28 @@ These sections can be expanded to show the respective 
commits."
 
 (defun magit-submodule-list-refresh ()
   (setq tabulated-list-entries
-        (seq-keep
-         (lambda (module)
-           (let ((default-directory
-                  (expand-file-name (file-name-as-directory module))))
-             (and (file-exists-p ".git")
-                  (or (not magit-submodule-list-predicate)
-                      (funcall magit-submodule-list-predicate module))
-                  (list default-directory
-                        (vconcat
-                         (mapcar (pcase-lambda (`(,title ,width ,fn ,props))
-                                   (or (funcall fn `((:path  ,module)
-                                                     (:title ,title)
-                                                     (:width ,width)
-                                                     ,@props))
-                                       ""))
-                                 magit-repolist-columns))))))
-         (magit-list-module-paths)))
+        (seq-keep #'magit-submodule--format-module (magit-list-module-paths)))
   (message "Listing submodules...")
   (tabulated-list-init-header)
   (tabulated-list-print t)
   (message "Listing submodules...done"))
 
+(defun magit-submodule--format-module (module)
+  (let ((default-directory (expand-file-name (file-name-as-directory module))))
+    (and (file-exists-p ".git")
+         (or (not magit-submodule-list-predicate)
+             (funcall magit-submodule-list-predicate module))
+         (list default-directory
+               (vconcat
+                (mapcar
+                 (pcase-lambda (`(,title ,width ,fn ,props))
+                   (or (funcall fn `((:path  ,module)
+                                     (:title ,title)
+                                     (:width ,width)
+                                     ,@props))
+                       ""))
+                 magit-repolist-columns))))))
+
 (defun magit-modulelist-column-path (spec)
   "Insert the relative path of the submodule."
   (let ((path (cadr (assq :path spec))))

Reply via email to