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

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

[nongnu] elpa/git-commit efffec2eeb 1/2: magit-repolist-setup-1: New fun


From: ELPA Syncer
Subject: [nongnu] elpa/git-commit efffec2eeb 1/2: magit-repolist-setup-1: New function
Date: Mon, 21 Feb 2022 17:58:02 -0500 (EST)

branch: elpa/git-commit
commit efffec2eeb21178eaeabc27df5ac04d750f99c7a
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    magit-repolist-setup-1: New function
---
 lisp/magit-repos.el     |  7 +++++--
 lisp/magit-submodule.el | 13 ++-----------
 2 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/lisp/magit-repos.el b/lisp/magit-repos.el
index 684c838d73..8fd9e1569f 100644
--- a/lisp/magit-repos.el
+++ b/lisp/magit-repos.el
@@ -275,10 +275,11 @@ If it contains \"%s\" then the directory is substituted 
for that."
   (with-current-buffer (get-buffer-create "*Magit Repositories*")
     (magit-repolist-mode)
     (setq-local magit-repolist-columns columns)
+    (magit-repolist-setup-1)
     (magit-repolist-refresh)
     (switch-to-buffer (current-buffer))))
 
-(defun magit-repolist-refresh ()
+(defun magit-repolist-setup-1 ()
   (unless tabulated-list-sort-key
     (setq tabulated-list-sort-key
           (pcase-let ((`(,column . ,flip) magit-repolist-sort-key))
@@ -289,7 +290,9 @@ If it contains \"%s\" then the directory is substituted for 
that."
         (vconcat (mapcar (pcase-lambda (`(,title ,width ,_fn ,props))
                            (nconc (list title width t)
                                   (-flatten props)))
-                         magit-repolist-columns)))
+                         magit-repolist-columns))))
+
+(defun magit-repolist-refresh ()
   (setq tabulated-list-entries
         (mapcar (pcase-lambda (`(,id . ,path))
                   (let ((default-directory path))
diff --git a/lisp/magit-submodule.el b/lisp/magit-submodule.el
index 6b1ff79628..c43c6beb7d 100644
--- a/lisp/magit-submodule.el
+++ b/lisp/magit-submodule.el
@@ -630,21 +630,12 @@ These sections can be expanded to show the respective 
commits."
          (magit-generate-new-buffer 'magit-submodule-list-mode))))
   (magit-submodule-list-mode)
   (setq-local magit-repolist-columns columns)
+  (setq-local magit-repolist-sort-key magit-submodule-list-sort-key)
   (setq-local magit-submodule-list-predicate predicate)
+  (magit-repolist-setup-1)
   (magit-submodule-list-refresh))
 
 (defun magit-submodule-list-refresh ()
-  (unless tabulated-list-sort-key
-    (setq tabulated-list-sort-key
-          (pcase-let ((`(,column . ,flip) magit-submodule-list-sort-key))
-            (cons (or (car (assoc column magit-repolist-columns))
-                      (caar magit-repolist-columns))
-                  flip))))
-  (setq tabulated-list-format
-        (vconcat (mapcar (pcase-lambda (`(,title ,width ,_fn ,props))
-                           (nconc (list title width t)
-                                  (-flatten props)))
-                         magit-repolist-columns)))
   (setq tabulated-list-entries
         (-keep (lambda (module)
                  (let ((default-directory



reply via email to

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