mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 17:24:23 +00:00
User-friendly display of error messages at the end of minibuffer
* lisp/simple.el (minibuffer-setup-hook): Add minibuffer-error-initialize. (minibuffer-error-initialize, minibuffer-error-function): New functions. (Bug#34939)
This commit is contained in:
parent
9d72d6a3a2
commit
2aae063055
2 changed files with 28 additions and 0 deletions
6
etc/NEWS
6
etc/NEWS
|
|
@ -471,6 +471,12 @@ its functions.
|
|||
names match certain regular expressions as big. Ido won't attempt to
|
||||
list the contents of such directories when completing file names.
|
||||
|
||||
** Minibuffer
|
||||
|
||||
---
|
||||
*** Minibuffer now uses 'minibuffer-message' to display error messages
|
||||
at the end of the active minibuffer.
|
||||
|
||||
** map.el
|
||||
*** Now also understands plists.
|
||||
*** Now defined via generic functions that can be extended via 'cl-defmethod'.
|
||||
|
|
|
|||
|
|
@ -2439,6 +2439,28 @@ in the search status stack."
|
|||
Go to the history element by the absolute history position HIST-POS."
|
||||
(goto-history-element hist-pos))
|
||||
|
||||
|
||||
(add-hook 'minibuffer-setup-hook 'minibuffer-error-initialize)
|
||||
|
||||
(defun minibuffer-error-initialize ()
|
||||
"Set up minibuffer error processing."
|
||||
(setq-local command-error-function 'minibuffer-error-function))
|
||||
|
||||
(defun minibuffer-error-function (data context caller)
|
||||
"Display error messages in the active minibuffer.
|
||||
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)
|
||||
(let ((string (error-message-string data)))
|
||||
;; If we know from where the error was signaled, show it in
|
||||
;; *Messages*.
|
||||
(let ((inhibit-message t))
|
||||
(message "%s%s" (if caller (format "%s: " caller) "") string))
|
||||
;; Display an error message at the end of the minibuffer.
|
||||
(minibuffer-message (concat context string))))
|
||||
|
||||
|
||||
;Put this on C-x u, so we can force that rather than C-_ into startup msg
|
||||
(define-obsolete-function-alias 'advertised-undo 'undo "23.2")
|
||||
|
|
|
|||
Loading…
Reference in a new issue