diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/minibuffer.el | 9 | ||||
-rw-r--r-- | lisp/simple.el | 6 |
2 files changed, 13 insertions, 2 deletions
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 813ce14c59b..1578ab8e1ea 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -2328,6 +2328,15 @@ variables.") (setq deactivate-mark nil) (throw 'exit nil)) +(defun minibuffer-quit-recursive-edit () + "Quit the command that requested this recursive edit without error. +Like `abort-recursive-edit' without aborting keyboard macro +execution." + ;; See Info node `(elisp)Recursive Editing' for an explanation of + ;; throwing a function to `exit'. + (throw 'exit (lambda () + (signal 'minibuffer-quit nil)))) + (defun self-insert-and-exit () "Terminate minibuffer input." (interactive) diff --git a/lisp/simple.el b/lisp/simple.el index 5741c24eb7b..1a49fe24252 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2879,8 +2879,10 @@ Go to the history element by the absolute history position HIST-POS." The same as `command-error-default-function' but display error messages at the end of the minibuffer using `minibuffer-message' to not obscure the minibuffer contents." - (discard-input) - (ding) + (if (memq 'minibuffer-quit (get (car data) 'error-conditions)) + (ding t) + (discard-input) + (ding)) (let ((string (error-message-string data))) ;; If we know from where the error was signaled, show it in ;; *Messages*. |