[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transient 7288a30126 123/366: Remove conflict with edeb
From: |
Jonas Bernoulli |
Subject: |
[elpa] externals/transient 7288a30126 123/366: Remove conflict with edebug |
Date: |
Tue, 25 Jan 2022 18:54:33 -0500 (EST) |
branch: externals/transient
commit 7288a301262ce0d86877756e14bb4c6eb9417556
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
Remove conflict with edebug
Closes #19.
---
lisp/transient.el | 52 ++++++++++++++++++++++++++++++++++++++++++----------
1 file changed, 42 insertions(+), 10 deletions(-)
diff --git a/lisp/transient.el b/lisp/transient.el
index a396177a8f..ecd025475d 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -1614,7 +1614,7 @@ EDIT may be non-nil."
(transient--do-suspend)
(setq this-command 'transient-suspend)
(transient--pre-exit))
- (t
+ ((not (transient--edebug-command-p))
(setq this-command 'transient-undefined))))
((and transient--editp
(transient-suffix-object)
@@ -1631,11 +1631,11 @@ EDIT may be non-nil."
(when (eq action transient--exit)
(setq transient--exitp (or transient--exitp t)))
action)
- (setq this-command
- (let ((keys (this-command-keys-vector)))
- (if (eq (aref keys (1- (length keys))) ?\C-g)
- 'transient-noop
- 'transient-undefined)))
+ (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)))))
@@ -1694,19 +1694,27 @@ EDIT may be non-nil."
(add-hook 'pre-command-hook #'transient--pre-command))
(add-hook 'post-command-hook #'transient--post-command)))
-(defun transient--suspend-override ()
+(defun transient--suspend-override (&optional minibuffer-hooks)
(transient--debug 'suspend-override)
(transient--pop-keymap 'transient--transient-map)
(transient--pop-keymap 'transient--redisplay-map)
(remove-hook 'pre-command-hook #'transient--pre-command)
- (remove-hook 'post-command-hook #'transient--post-command))
+ (remove-hook 'post-command-hook #'transient--post-command)
+ (when minibuffer-hooks
+ (remove-hook 'minibuffer-setup-hook #'transient--minibuffer-setup)
+ (remove-hook 'minibuffer-exit-hook #'transient--minibuffer-exit)
+ (advice-remove 'abort-recursive-edit #'transient--minibuffer-exit)))
-(defun transient--resume-override ()
+(defun transient--resume-override (&optional minibuffer-hooks)
(transient--debug 'resume-override)
(transient--push-keymap 'transient--transient-map)
(transient--push-keymap 'transient--redisplay-map)
(add-hook 'pre-command-hook #'transient--pre-command)
- (add-hook 'post-command-hook #'transient--post-command))
+ (add-hook 'post-command-hook #'transient--post-command)
+ (when minibuffer-hooks
+ (add-hook 'minibuffer-setup-hook #'transient--minibuffer-setup)
+ (add-hook 'minibuffer-exit-hook #'transient--minibuffer-exit)
+ (advice-add 'abort-recursive-edit :after #'transient--minibuffer-exit)))
(defun transient--post-command ()
(transient--debug 'post-command)
@@ -3041,6 +3049,30 @@ search instead."
(select-window transient--original-window)
(transient--resume-override))
+;;;; Edebug
+
+(defun transient--edebug--recursive-edit (fn arg-mode)
+ (transient--debug 'edebug--recursive-edit)
+ (if (not transient--prefix)
+ (funcall fn arg-mode)
+ (transient--suspend-override t)
+ (funcall fn arg-mode)
+ (transient--resume-override t)))
+
+(advice-add 'edebug--recursive-edit :around 'transient--edebug--recursive-edit)
+
+(defun transient--abort-edebug ()
+ (when (bound-and-true-p edebug-active)
+ (transient--emergency-exit)))
+
+(advice-add 'abort-recursive-edit :before 'transient--abort-edebug)
+(advice-add 'top-level :before 'transient--abort-edebug)
+
+(defun transient--edebug-command-p ()
+ (and (bound-and-true-p edebug-active)
+ (or (memq this-command '(top-level abort-recursive-edit))
+ (string-prefix-p "edebug" (symbol-name this-command)))))
+
;;;; Other Packages
(declare-function which-key-mode "which-key" (&optional arg))
- [elpa] externals/transient 4ef8229feb 082/366: transient--buffer-name: New variable, (continued)
- [elpa] externals/transient 4ef8229feb 082/366: transient--buffer-name: New variable, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 9fb3f797f1 103/366: Regenerate manual, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 7b62e01e72 064/366: transient-show-popup: Also show the key that invoked the prefix, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient c7ad1f01f4 080/366: transient--delete-window: Protect against misconfiguration, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient b036789121 078/366: Move require form next to the others, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient f0a7a97d6b 083/366: Fix using set transient value, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 8bfa489644 095/366: Support inserting string pseudo suffixes, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient cbcfabeec6 105/366: manual: Fix some typos and minor language issues, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 450d0f869f 114/366: transient--insert-suffix: Fix use of binding defined in object, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient f820ccc6b9 119/366: transient-format-value: Support options with multiple values, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 7288a30126 123/366: Remove conflict with edebug,
Jonas Bernoulli <=
- [elpa] externals/transient b0185a3ad6 125/366: transient--read-file-contents: Remove stray variable access, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 98ed4af766 128/366: Fix typo in doc-string, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 5f28a75609 134/366: Add htmlxref.cnf, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 846e0c200c 136/366: Update copyright years, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 0a066156c0 138/366: define-{infix, suffix, transient}-command: Indicate docstring position, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 5c0f901a15 142/366: transient-init-value: Fix another regression, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 37aec3ae59 144/366: Fix typo in doc-string, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient 76ac902ea5 149/366: Order CHANGELOG chronologically, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient fd7bb997ab 150/366: Complete CHANGELOG, Jonas Bernoulli, 2022/01/25
- [elpa] externals/transient afa0c2f984 152/366: Add redundant gitignore rules, Jonas Bernoulli, 2022/01/25