emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/completions-highlight-modifications bfb8a71 21/25: Add ignore-er


From: Jimmy Aguilar Mena
Subject: feature/completions-highlight-modifications bfb8a71 21/25: Add ignore-errors when executing from minibuffer
Date: Fri, 20 Nov 2020 13:28:35 -0500 (EST)

branch: feature/completions-highlight-modifications
commit bfb8a712dd16fe495ba2b190f88c45f5a190c610
Author: Jimmy Aguilar Mena <spacibba@aol.com>
Commit: Jimmy Aguilar Mena <spacibba@aol.com>

    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
---
 lisp/completions-highlight.el | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/lisp/completions-highlight.el b/lisp/completions-highlight.el
index 7e7ea2c..9ce83e6 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*.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]