From: Jimmy Aguilar Mena Date: Thu, 19 Nov 2020 06:19:14 +0000 (+0100) Subject: Add ignore-errors when executing from minibuffer X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bfb8a712dd16fe495ba2b190f88c45f5a190c610;p=emacs.git Add ignore-errors when executing from minibuffer This asserts that the hooks are executed in some cases like when EOB. * lisp/completions-highlight (completions-highlight-completions-visible-p) : New function --- diff --git a/lisp/completions-highlight.el b/lisp/completions-highlight.el index 7e7ea2c6bc1..9ce83e65189 100644 --- a/lisp/completions-highlight.el +++ b/lisp/completions-highlight.el @@ -106,16 +106,20 @@ buffer is shown and updated." (move-overlay completions-highlight-overlay obeg oend) (minibuffer-completion-set-suffix choice))) +(defsubst completions-highlight-completions-visible-p () + "Return t if *Completions* is visible." + (and (window-live-p minibuffer-scroll-window) + (eq t (frame-visible-p (window-frame minibuffer-scroll-window))))) + ;; Minibuffer side commands (defmacro with-minibuffer-scroll-window (&rest body) "Execute BODY in *Completions* buffer and return to `minibuffer'. The command is only executed if the `minibuffer-scroll-window' is alive and active." - `(and (window-live-p minibuffer-scroll-window) - (eq t (frame-visible-p (window-frame minibuffer-scroll-window))) + `(and (completions-highlight-completions-visible-p) (with-selected-window minibuffer-scroll-window - ,@body - (completions-highlight-this-completion)))) + (ignore-errors ,@body) + (run-hooks 'post-command-hook)))) (defun minibuffer-next-completion (n) "Execute `next-completion' in *Completions*.