emacs-diffs
[Top][All Lists]
Advanced

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

feature/completions-highlight-modifications 1247e41 2/4: Add ignore-erro


From: Jimmy Aguilar Mena
Subject: feature/completions-highlight-modifications 1247e41 2/4: Add ignore-errors when executing from minibuffer
Date: Thu, 19 Nov 2020 01:29:51 -0500 (EST)

branch: feature/completions-highlight-modifications
commit 1247e41917646c8da12dbe0d91a039c7f95ded14
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]