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

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

[elpa] externals/transient 413f76a783 16/17: Collect most commands in on


From: Jonas Bernoulli
Subject: [elpa] externals/transient 413f76a783 16/17: Collect most commands in one section
Date: Tue, 21 Nov 2023 10:17:51 -0500 (EST)

branch: externals/transient
commit 413f76a783c3751d14f85afe1add2dc5e9f0c426
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    Collect most commands in one section
    
    Now all commands are found in the "Commands" section, with the
    exception of `transient--default-infix-command' and boring commands
    that wrap around certain built-in commands, found in the "Popup
    Navigation" and "Popup Isearch" sections.
    
    Also rearrange the "Commands" section and split it into sub-sections.
---
 lisp/transient.el | 87 +++++++++++++++++++++++++++++++------------------------
 1 file changed, 49 insertions(+), 38 deletions(-)

diff --git a/lisp/transient.el b/lisp/transient.el
index 8966b4887e..fc8c0e1d71 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -2656,6 +2656,7 @@ prefix argument and pivot to `transient-update'."
 (put 'transient--do-minus      'transient-color 'transient-red)
 
 ;;; Commands
+;;;; Noop
 
 (defun transient-noop ()
   "Do nothing at all."
@@ -2703,11 +2704,7 @@ Please open an issue and post the shown command log." 
:error)))
            this-original-command
            'transient-enable-popup-navigation))
 
-(defun transient-suspend ()
-  "Suspend the current transient.
-It can later be resumed using `transient-resume', while no other
-transient is active."
-  (interactive))
+;;;; Core
 
 (defun transient-quit-all ()
   "Exit all transients without saving the transient stack."
@@ -2731,7 +2728,41 @@ transient is active."
   (interactive)
   (setq transient--showp t))
 
-(defvar transient-resume-mode)
+(defun transient-push-button ()
+  "Invoke the suffix command represented by this button."
+  (interactive))
+
+;;;; Suspend
+
+(defun transient-suspend ()
+  "Suspend the current transient.
+It can later be resumed using `transient-resume', while no other
+transient is active."
+  (interactive))
+
+(define-minor-mode transient-resume-mode
+  "Auxiliary minor-mode used to resume a transient after viewing help.")
+
+(defun transient-resume ()
+  "Resume a previously suspended stack of transients."
+  (interactive)
+  (cond (transient--stack
+         (let ((winconf transient--restore-winconf))
+           (kill-local-variable 'transient--restore-winconf)
+           (when transient-resume-mode
+             (transient-resume-mode -1)
+             (quit-window))
+           (when winconf
+             (set-window-configuration winconf)))
+         (transient--stack-pop))
+        (transient-resume-mode
+         (kill-local-variable 'transient--restore-winconf)
+         (transient-resume-mode -1)
+         (quit-window))
+        (t
+         (message "No suspended transient command"))))
+
+;;;; Help
 
 (defun transient-help (&optional interactive)
   "Show help for the active transient or one of its suffixes.\n\n(fn)"
@@ -2755,6 +2786,8 @@ transient is active."
                   "Type \\`q' to resume transient command."))
         t))))
 
+;;;; Level
+
 (defun transient-set-level (&optional command level)
   "Set the level of the transient or one of its suffix commands."
   (interactive
@@ -2815,6 +2848,8 @@ transient is active."
   (setq transient--all-levels-p (not transient--all-levels-p))
   (setq transient--refreshp t))
 
+;;;; Value
+
 (defun transient-set ()
   "Set active transient's value for this Emacs session."
   (interactive)
@@ -2861,34 +2896,20 @@ transient is active."
       (oset obj value (nth pos hst))
       (mapc #'transient-init-value transient--suffixes))))
 
-(defun transient-push-button ()
-  "Invoke the suffix command represented by this button."
-  (interactive))
-
-(defun transient-resume ()
-  "Resume a previously suspended stack of transients."
-  (interactive)
-  (cond (transient--stack
-         (let ((winconf transient--restore-winconf))
-           (kill-local-variable 'transient--restore-winconf)
-           (when transient-resume-mode
-             (transient-resume-mode -1)
-             (quit-window))
-           (when winconf
-             (set-window-configuration winconf)))
-         (transient--stack-pop))
-        (transient-resume-mode
-         (kill-local-variable 'transient--restore-winconf)
-         (transient-resume-mode -1)
-         (quit-window))
-        (t
-         (message "No suspended transient command"))))
+;;;; Auxiliary
 
 (defun transient-toggle-common ()
   "Toggle whether common commands are permanently shown."
   (interactive)
   (setq transient-show-common-commands (not transient-show-common-commands)))
 
+(defun transient-toggle-debug ()
+  "Toggle debugging statements for transient commands."
+  (interactive)
+  (setq transient--debug (not transient--debug))
+  (message "Debugging transient %s"
+           (if transient--debug "enabled" "disabled")))
+
 (transient-define-suffix transient-echo-arguments (arguments)
   "Show the transient's active ARGUMENTS in the echo area.
 Intended for use in prefixes used for demonstration purposes,
@@ -4042,16 +4063,6 @@ Suffixes on levels %s and %s are unavailable.\n"
                (propertize (format ">=%s" (1+ level))
                            'face 'transient-disabled-suffix))))))
 
-(define-minor-mode transient-resume-mode
-  "Auxiliary minor-mode used to resume a transient after viewing help.")
-
-(defun transient-toggle-debug ()
-  "Toggle debugging statements for transient commands."
-  (interactive)
-  (setq transient--debug (not transient--debug))
-  (message "Debugging transient %s"
-           (if transient--debug "enabled" "disabled")))
-
 ;;; Popup Navigation
 
 (defun transient-scroll-up (&optional arg)



reply via email to

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