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

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

[elpa] master ad68a43: Use proper name for the branch column according w


From: Tino Calancha
Subject: [elpa] master ad68a43: Use proper name for the branch column according with gited-ref-kind
Date: Sat, 24 Jun 2017 23:32:18 -0400 (EDT)

branch: master
commit ad68a43f8b917c3c45ff66bbe501a09df1da08e3
Author: Tino Calancha <address@hidden>
Commit: Tino Calancha <address@hidden>

    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.
---
 packages/gited/gited.el | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/packages/gited/gited.el b/packages/gited/gited.el
index f4530c8..e98952f 100644
--- a/packages/gited/gited.el
+++ b/packages/gited/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]