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

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

[nongnu] elpa/git-commit 9c6207bb84 4/7: magit-file-dispatch: No longer


From: ELPA Syncer
Subject: [nongnu] elpa/git-commit 9c6207bb84 4/7: magit-file-dispatch: No longer pivot if not visiting file
Date: Sat, 20 May 2023 18:01:02 -0400 (EDT)

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

    magit-file-dispatch: No longer pivot if not visiting file
    
    1. Make more commands available by default.  Previously they were
       placed on a higher level, which was overly defensive.
    
    2. Take the opportunity to change the bindings used for these
       commands.  "C-c CHAR" is unfortunate because using a modifier
       breaks the flow.  I also feel that it implied that the same
       bindings were available outside the prefix, which they are not
       and should not (because they are reserved for user bindings).
       Use the easily reachable "," prefix instead.
    
    3. No longer pivot to display `magit-dispatch', when invoked from
       a magit buffer.  Doing that made sense (to an extend), while
       we did not display the suffixes mentioned in (2).  Skip the ","
       prefix in this case, as there are no conflicts we have to work
       around.
---
 lisp/magit-files.el | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/lisp/magit-files.el b/lisp/magit-files.el
index 527fd3a903..b12bcc9cf1 100644
--- a/lisp/magit-files.el
+++ b/lisp/magit-files.el
@@ -289,7 +289,8 @@ directory, while reading the FILENAME."
 When invoked outside a file-visiting buffer, then fall back
 to `magit-dispatch'."
   :info-manual "(magit) Minor Mode for Buffers Visiting Files"
-  ["Actions"
+  ["File actions"
+   :if magit-file-relative-name
    [("s" "Stage"      magit-stage-file)
     ("u" "Unstage"    magit-unstage-file)
     ("c" "Commit"     magit-commit)
@@ -311,15 +312,18 @@ to `magit-dispatch'."
     ("n" "Next blob"  magit-blob-next)
     ("v" "Goto blob"  magit-find-file)
     ("V" "Goto file"  magit-blob-visit-file)]
-   [(5 "C-c r" "Rename file"   magit-file-rename)
-    (5 "C-c d" "Delete file"   magit-file-delete)
-    (5 "C-c u" "Untrack file"  magit-file-untrack)
-    (5 "C-c c" "Checkout file" magit-file-checkout)]]
-  (interactive)
-  (transient-setup
-   (if (magit-file-relative-name)
-       'magit-file-dispatch
-     'magit-dispatch)))
+   [(", r" "Rename file"   magit-file-rename)
+    (", k" "Delete file"   magit-file-delete)
+    (", x" "Untrack file"  magit-file-untrack)
+    (", c" "Checkout file" magit-file-checkout)]]
+  ["File actions"
+   :if-not magit-file-relative-name
+   [("s" "Stage"    magit-stage-file)
+    ("u" "Unstage"  magit-unstage-file)
+    ("x" "Untrack"  magit-file-untrack)]
+   [("r" "Rename"   magit-file-rename)
+    ("k" "Delete"   magit-file-delete)
+    ("c" "Checkout" magit-file-checkout)]])
 
 ;;; Blob Mode
 



reply via email to

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