[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transient 76b77e01ac 328/366: magit--{pre, post}-comman
From: |
Jonas Bernoulli |
Subject: |
[elpa] externals/transient 76b77e01ac 328/366: magit--{pre, post}-command: Add emergency exits |
Date: |
Tue, 25 Jan 2022 18:54:52 -0500 (EST) |
branch: externals/transient
commit 76b77e01aca43f13bc94f9479687bfa84e7034eb
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
magit--{pre,post}-command: Add emergency exits
---
lisp/transient.el | 98 ++++++++++++++++++++++++++++---------------------------
1 file changed, 50 insertions(+), 48 deletions(-)
diff --git a/lisp/transient.el b/lisp/transient.el
index 4935e2b587..2d8f86d686 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -1920,41 +1920,42 @@ value. Otherwise return CHILDREN as is."
(defun transient--pre-command ()
(transient--debug 'pre-command)
- (cond
- ((memq this-command '(transient-update transient-quit-seq))
- (transient--pop-keymap 'transient--redisplay-map))
- ((and transient--helpp
- (not (memq this-command '(transient-quit-one
- transient-quit-all))))
+ (transient--with-emergency-exit
(cond
- ((transient-help)
- (transient--do-suspend)
- (setq this-command 'transient-suspend)
- (transient--pre-exit))
- ((not (transient--edebug-command-p))
- (setq this-command 'transient-undefined))))
- ((and transient--editp
- (transient-suffix-object)
- (not (memq this-command '(transient-quit-one
- transient-quit-all
- transient-help))))
- (setq this-command 'transient-set-level))
- (t
- (setq transient--exitp nil)
- (when (eq (if-let ((fn (transient--get-predicate-for
- this-original-command)))
- (let ((action (funcall fn)))
- (when (eq action transient--exit)
- (setq transient--exitp (or transient--exitp t)))
- action)
- (if (let ((keys (this-command-keys-vector)))
- (eq (aref keys (1- (length keys))) ?\C-g))
- (setq this-command 'transient-noop)
- (unless (transient--edebug-command-p)
- (setq this-command 'transient-undefined)))
- transient--stay)
- transient--exit)
- (transient--pre-exit)))))
+ ((memq this-command '(transient-update transient-quit-seq))
+ (transient--pop-keymap 'transient--redisplay-map))
+ ((and transient--helpp
+ (not (memq this-command '(transient-quit-one
+ transient-quit-all))))
+ (cond
+ ((transient-help)
+ (transient--do-suspend)
+ (setq this-command 'transient-suspend)
+ (transient--pre-exit))
+ ((not (transient--edebug-command-p))
+ (setq this-command 'transient-undefined))))
+ ((and transient--editp
+ (transient-suffix-object)
+ (not (memq this-command '(transient-quit-one
+ transient-quit-all
+ transient-help))))
+ (setq this-command 'transient-set-level))
+ (t
+ (setq transient--exitp nil)
+ (when (eq (if-let ((fn (transient--get-predicate-for
+ this-original-command)))
+ (let ((action (funcall fn)))
+ (when (eq action transient--exit)
+ (setq transient--exitp (or transient--exitp t)))
+ action)
+ (if (let ((keys (this-command-keys-vector)))
+ (eq (aref keys (1- (length keys))) ?\C-g))
+ (setq this-command 'transient-noop)
+ (unless (transient--edebug-command-p)
+ (setq this-command 'transient-undefined)))
+ transient--stay)
+ transient--exit)
+ (transient--pre-exit))))))
(defun transient--get-predicate-for (cmd)
(or (lookup-key transient--predicate-map
@@ -2083,20 +2084,21 @@ value. Otherwise return CHILDREN as is."
(defun transient--post-command ()
(transient--debug 'post-command)
- (cond
- ((and (eq (this-command-keys-vector) [])
- (= (minibuffer-depth)
- (1+ transient--minibuffer-depth)))
- (transient--suspend-override)
- (transient--delay-post-command))
- (transient--exitp
- (transient--post-exit))
- ((eq this-command (oref transient--prefix command)))
- (t
- (transient--pop-keymap 'transient--redisplay-map)
- (setq transient--redisplay-map (transient--make-redisplay-map))
- (transient--push-keymap 'transient--redisplay-map)
- (transient--redisplay))))
+ (transient--with-emergency-exit
+ (cond
+ ((and (eq (this-command-keys-vector) [])
+ (= (minibuffer-depth)
+ (1+ transient--minibuffer-depth)))
+ (transient--suspend-override)
+ (transient--delay-post-command))
+ (transient--exitp
+ (transient--post-exit))
+ ((eq this-command (oref transient--prefix command)))
+ (t
+ (transient--pop-keymap 'transient--redisplay-map)
+ (setq transient--redisplay-map (transient--make-redisplay-map))
+ (transient--push-keymap 'transient--redisplay-map)
+ (transient--redisplay)))))
(defun transient--post-exit ()
(transient--debug 'post-exit)
- [elpa] externals/transient 1e090b0cd4 240/366: Fixup changelog, (continued)
- [elpa] externals/transient 1e090b0cd4 240/366: Fixup changelog, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient d5476e1d9f 266/366: Update changelog, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 45975c24e1 282/366: manual: Update info about `incompatible' slot, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 2b1d184c6a 287/366: make: Remove dash dependency, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 62769279a6 298/366: transient--describe-function: Move definition, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 7f5520b330 307/366: Add support for non-proportional text, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 129c2b1685 315/366: make: Set more variables in default.mk, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient abbe17560c 318/366: manual: Move common settings to .orgconfig, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 51c50d8c82 319/366: manual: Use updated support for definition commands, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 2e33f96cf0 326/366: transient--post-command: Cosmetics, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 76b77e01ac 328/366: magit--{pre, post}-command: Add emergency exits,
Jonas Bernoulli <=
- [elpa] externals/transient 41521a5c93 331/366: transient--get-predicate-for: Always return a function, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 69f42f9e89 334/366: transient--make-predicate-map: Cosmetics, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 8d8ed1965f 345/366: Hide infix commands from execute-extended-command, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 22e032ae65 343/366: Move obsolete variable declaration, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 804feb3b41 361/366: transient--{push, pop}-keymap: Do nothing if keymap is void, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 6d721f7490 348/366: Don't use convert-standard-filename when defining path variables, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 2c9cef1f5a 352/366: Bump copyright years, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 427e36046a 131/366: transient-force-fixed-pitch: New option, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 95389b31ec 137/366: transient-init-value: Always prefer saved over default value, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 700719723d 047/366: magit--history-push: Add optional SLOT argument, Jonas Bernoulli, 2022/01/25