Disable minibuffer error silencer hack in Emacs 27+

In older versions of Emacs (26.3 and below), the minibuffer would
replace the whole minibuffer's contents just to display error messages.
This was very frustrating for mundane errors, like the "text is
read-only" error you get when you press backspace at BOL.

Later versions of Emacs now display errors at the end of the minibuffer,
so this hack will no longer be needed when we drop 26.x support later
this year.
This commit is contained in:
Henrik Lissner 2021-05-03 17:31:03 -04:00
parent b65d8ae3ac
commit 623127597f

View file

@ -738,15 +738,17 @@ disable it to fix all that visual noise."
(add-function :around whitespace-enable-predicate #'doom-disable-whitespace-mode-in-childframes-a)) (add-function :around whitespace-enable-predicate #'doom-disable-whitespace-mode-in-childframes-a))
;; Don't display messages in the minibuffer when using the minibuffer ;; Don't display messages in the minibuffer when using the minibuffer
(defmacro doom-silence-motion-key (command key) ;; DEPRECATED Remove when Emacs 26.x support is dropped.
(let ((key-command (intern (format "doom/silent-%s" command)))) (eval-when! (not EMACS27+)
`(progn (defmacro doom-silence-motion-key (command key)
(defun ,key-command () (let ((key-command (intern (format "doom/silent-%s" command))))
(interactive) `(progn
(ignore-errors (call-interactively ',command))) (defun ,key-command ()
(define-key minibuffer-local-map (kbd ,key) #',key-command)))) (interactive)
(doom-silence-motion-key backward-delete-char "<backspace>") (ignore-errors (call-interactively ',command)))
(doom-silence-motion-key delete-char "<delete>") (define-key minibuffer-local-map (kbd ,key) #',key-command))))
(doom-silence-motion-key backward-delete-char "<backspace>")
(doom-silence-motion-key delete-char "<delete>"))
(provide 'core-ui) (provide 'core-ui)
;;; core-ui.el ends here ;;; core-ui.el ends here