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

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

[nongnu] elpa/git-commit 5cc1e06aec 4/5: git-rebase-mode-show-keybinding


From: ELPA Syncer
Subject: [nongnu] elpa/git-commit 5cc1e06aec 4/5: git-rebase-mode-show-keybindings: Align Git's continued help text
Date: Fri, 13 May 2022 09:58:24 -0400 (EDT)

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

    git-rebase-mode-show-keybindings: Align Git's continued help text
---
 lisp/git-rebase.el | 45 ++++++++++++++++++++++++---------------------
 1 file changed, 24 insertions(+), 21 deletions(-)

diff --git a/lisp/git-rebase.el b/lisp/git-rebase.el
index 345fab239e..a6410d17f9 100644
--- a/lisp/git-rebase.el
+++ b/lisp/git-rebase.el
@@ -788,27 +788,30 @@ By default, this is the same except for the \"pick\" 
command."
                           (string-pad
                            (substitute-command-keys (format "\\[%s]" cmd)) 8)
                           desc)))
-        (while (re-search-forward (concat git-rebase-comment-re
-                                          "\\(  ?\\)\\([^\n,],\\) "
-                                          "\\([^\n ]+\\) ")
-                                  nil t)
-          (let ((cmd (intern (concat "git-rebase-" (match-string 3)))))
-            (if (not (fboundp cmd))
-                (delete-region (line-beginning-position)
-                               (1+ (line-end-position)))
-              (replace-match " " t t nil 1)
-              (replace-match
-               (string-pad
-                (mapconcat (lambda (key)
-                             (save-match-data
-                               (substitute-command-keys
-                                (format "\\`%s'" (key-description key)))))
-                           (cl-remove-if (lambda (key) (eq (elt key 0) 
'menu-bar))
-                                         (reverse (where-is-internal
-                                                   cmd git-rebase-mode-map)))
-                           ", ")
-                8)
-               t t nil 2))))))))
+        (while (re-search-forward
+                (concat git-rebase-comment-re "\\(?:"
+                        "\\( \\.?     *\\)\\|"
+                        "\\( +\\)\\([^\n,],\\) \\([^\n ]+\\) \\)")
+                nil t)
+          (if (match-string 1)
+              (replace-match (make-string 10 ?\s) t t nil 1)
+            (let ((cmd (intern (concat "git-rebase-" (match-string 4)))))
+              (if (not (fboundp cmd))
+                  (delete-region (line-beginning-position)
+                                 (1+ (line-end-position)))
+                (replace-match " " t t nil 2)
+                (replace-match
+                 (string-pad
+                  (mapconcat (lambda (key)
+                               (save-match-data
+                                 (substitute-command-keys
+                                  (format "\\`%s'" (key-description key)))))
+                             (cl-remove-if (lambda (key) (eq (elt key 0) 
'menu-bar))
+                                           (reverse (where-is-internal
+                                                     cmd git-rebase-mode-map)))
+                             ", ")
+                  8)
+                 t t nil 3)))))))))
 
 (add-hook 'git-rebase-mode-hook #'git-rebase-mode-show-keybindings t)
 



reply via email to

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