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

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

[elpa] externals/transient 70729dd620 043/366: transient-set-level: Disa


From: Jonas Bernoulli
Subject: [elpa] externals/transient 70729dd620 043/366: transient-set-level: Disallow 0 as prefix level
Date: Tue, 25 Jan 2022 18:54:25 -0500 (EST)

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

    transient-set-level: Disallow 0 as prefix level
    
    Closes #28.
---
 lisp/transient.el | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/lisp/transient.el b/lisp/transient.el
index 1bd23350c5..f935f12103 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -1796,16 +1796,19 @@ transient is active."
 (defun transient-set-level (&optional command level)
   "Set the level of the transient or one of its suffix commands."
   (interactive
-   (let ((command this-original-command))
+   (let ((command this-original-command)
+         (prefix (oref transient--prefix command)))
      (and (or (not (eq command 'transient-set-level))
               (and transient--editp
-                   (setq command (oref transient--prefix command))))
+                   (setq command prefix)))
           (list command
                 (let ((keys (this-single-command-raw-keys)))
                   (and (lookup-key transient--transient-map keys)
-                       (read-number
-                        (format "Set level for `%s': "
-                                (transient--suffix-command command)))))))))
+                       (string-to-number
+                        (transient--read-number-N
+                         (format "Set level for `%s': "
+                                 (transient--suffix-command command))
+                         nil nil (not (eq command prefix))))))))))
   (cond
    ((not command)
     (setq transient--editp t)



reply via email to

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