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

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

[elpa] externals/gited 1250818 30/73: Use proper name for the branch col


From: Stefan Monnier
Subject: [elpa] externals/gited 1250818 30/73: Use proper name for the branch column according with gited-ref-kind
Date: Sun, 29 Nov 2020 00:00:33 -0500 (EST)

branch: externals/gited
commit 1250818541d56f5b2395fd3c6aced9235b7eeee7
Author: Tino Calancha <tino.calancha@gmail.com>
Commit: Tino Calancha <tino.calancha@gmail.com>

    Use proper name for the branch column according with gited-ref-kind
    
    * gited.el (gited--col-branch-name): New defun.
    (gited--list-format-init, gited-hide-details-update-invisibility-spec):
    Use different name for the branch column according with the
    value of gited-ref-kind.
---
 gited.el | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/gited.el b/gited.el
index f4530c8..e98952f 100644
--- a/gited.el
+++ b/gited.el
@@ -10,9 +10,9 @@
 ;; Compatibility: GNU Emacs: 24.4
 ;; Version: 0.2.2
 ;; Package-Requires: ((emacs "24.4") (cl-lib "0.5"))
-;; Last-Updated: Sat Jun 10 11:38:55 JST 2017
+;; Last-Updated: Sun Jun 25 11:08:01 JST 2017
 ;;           By: calancha
-;;     Update #: 661
+;;     Update #: 662
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;
@@ -431,6 +431,12 @@ If you change this option, then you might want to change
           (const :tag "Full" "%FT%T%z"))
   :group 'gited)
 
+(defun gited--col-branch-name ()
+  (pcase gited-ref-kind
+    ("tags" "Tags")
+    ("remote" "Remote Branches")
+    (_ "Branches")))
+
 (defun gited--list-format-init (&optional col-names col-sizes)
   "Initialize `gited-list-format'.
 Optional arguments COL-NAMES and COL-SIZES are the column names
@@ -453,7 +459,7 @@ and sizes."
                       (if reverse-order
                           earlierp
                         (not earlierp)))))
-                `(,(if col-names (nth 3 col-names) "Branches")
+                `(,(if col-names (nth 3 col-names) (gited--col-branch-name))
                   ,(if col-sizes (nth 3 col-sizes) gited-branch-col-size) t)
                 `(,(if col-names (nth 4 col-names) "Last Commit")
                   ,(if col-sizes (nth 4 col-sizes) gited-commit-col-size) t))))
@@ -2676,8 +2682,8 @@ reach the beginning of the buffer."
 (defun gited-hide-details-update-invisibility-spec ()
   (let ((col-names
          (if gited-hide-details-mode
-             '("M" "Branches" "" "" "Last Commit")
-           '("M" "Authors" "Date" "Branches" "Last Commit")))
+             `("M" ,(gited--col-branch-name) "" "" "Last Commit")
+           `("M" "Authors" "Date" ,(gited--col-branch-name) "Last Commit")))
         (col-sizes
          (if gited-hide-details-mode
              (list gited-mark-col-size gited-branch-col-size



reply via email to

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