[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/completions-highlight-modifications e143246 10/25: Simplify over
From: |
Jimmy Aguilar Mena |
Subject: |
feature/completions-highlight-modifications e143246 10/25: Simplify overlay handling |
Date: |
Fri, 20 Nov 2020 13:28:33 -0500 (EST) |
branch: feature/completions-highlight-modifications
commit e143246df8d6babd2830fcbfe17238e0d6c45d1f
Author: Jimmy Aguilar Mena <spacibba@aol.com>
Commit: Jimmy Aguilar Mena <spacibba@aol.com>
Simplify overlay handling
* lisp/completions-highlight.el (completions-highlight-overlay) :
created on load.
(completions-highlight-completions-pre-command-hook) : Don't move
overlay here.
(completions-highlight-minibuffer-pre-command-hook) : Use delete overlay
instead of conditional
(completions-highlight-mode) : Use overlay-put here instead of the setup.
---
lisp/completions-highlight.el | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/lisp/completions-highlight.el b/lisp/completions-highlight.el
index 31442da..f9d85bd 100644
--- a/lisp/completions-highlight.el
+++ b/lisp/completions-highlight.el
@@ -37,7 +37,7 @@
(require 'simple)
(require 'minibuffer)
-(defvar completions-highlight-overlay nil
+(defvar completions-highlight-overlay (make-overlay 0 0)
"Overlay to use when `completion-highlight-mode' is enabled.")
(defvar minibuffer-tab-through-completions-function-save nil
@@ -223,7 +223,6 @@ should be assigned to
completion-in-minibuffer-scroll-window."
(defun completions-highlight-completions-pre-command-hook ()
"Function `pre-command-hook' to use only in the *Completions."
- (move-overlay completions-highlight-overlay 0 0)
(minibuffer-completion-set-suffix ""))
(defun completions-highlight-minibuffer-pre-command-hook ()
@@ -234,25 +233,24 @@ should be assigned to
completion-in-minibuffer-scroll-window."
(defun completions-highlight-setup ()
"Function to call when enabling the `completion-highlight-mode' mode.
It is called when showing the *Completions* buffer."
+ (delete-overlay completions-highlight-overlay)
(with-current-buffer standard-output
(when (string= (buffer-name) "*Completions*")
- (unless (overlayp completions-highlight-overlay)
- (setq completions-highlight-overlay (make-overlay 0 0))
- (overlay-put completions-highlight-overlay 'face 'highlight))
(add-hook 'pre-command-hook
#'completions-highlight-completions-pre-command-hook nil t)
(add-hook 'isearch-mode-end-hook
#'completions-highlight-this-completion nil t)
+ ;; Add completions-highlight-completions-map to *Completions*
(use-local-map (make-composed-keymap
completions-highlight-completions-map
(current-local-map)))))
(add-hook 'pre-command-hook
#'completions-highlight-minibuffer-pre-command-hook nil t)
- ;; Add completions-highlight-minibuffer-map bindings to minibuffer map
+ ;; Add completions-highlight-minibuffer-map bindings to minibuffer
(use-local-map (make-composed-keymap
completions-highlight-minibuffer-map (current-local-map))))
@@ -263,7 +261,9 @@ It is called when showing the *Completions* buffer."
(if completions-highlight-mode
(progn
- (setq minibuffer-tab-through-completions-function-save
+ (overlay-put completions-highlight-overlay 'face 'highlight)
+
+ (setq minibuffer-tab-through-completions-function-save
minibuffer-tab-through-completions-function)
(setq minibuffer-tab-through-completions-function
- feature/completions-highlight-modifications 31d6ec4 12/25: Add parent maps, (continued)
- feature/completions-highlight-modifications 31d6ec4 12/25: Add parent maps, Jimmy Aguilar Mena, 2020/11/20
- feature/completions-highlight-modifications c6943d7 09/25: Simplify setting keymaps., Jimmy Aguilar Mena, 2020/11/20
- feature/completions-highlight-modifications 11431bc 13/25: Add # to function bindings, Jimmy Aguilar Mena, 2020/11/20
- feature/completions-highlight-modifications f19039c 14/25: Improve completions-highlight description in file header., Jimmy Aguilar Mena, 2020/11/20
- feature/completions-highlight-modifications ce8b5b2 17/25: Simplify and rely more in the post-command-hook, Jimmy Aguilar Mena, 2020/11/20
- feature/completions-highlight-modifications 3f0f13e 18/25: Add backtab commands., Jimmy Aguilar Mena, 2020/11/20
- feature/completions-highlight-modifications 6ea2c5c 20/25: Fixes:, Jimmy Aguilar Mena, 2020/11/20
- feature/completions-highlight-modifications 25f23b1 25/25: Add try to close completions more often like zsh., Jimmy Aguilar Mena, 2020/11/20
- feature/completions-highlight-modifications 5cf9dd6 11/25: Add autoload decorator., Jimmy Aguilar Mena, 2020/11/20
- feature/completions-highlight-modifications 6cea893 07/25: Fix corner case when going out of bounds, Jimmy Aguilar Mena, 2020/11/20
- feature/completions-highlight-modifications e143246 10/25: Simplify overlay handling,
Jimmy Aguilar Mena <=
- feature/completions-highlight-modifications ab1e2e6 15/25: Add custom variable completions-highlight-autoselect., Jimmy Aguilar Mena, 2020/11/20
- feature/completions-highlight-modifications 10359ba 19/25: Fix previous commit, Jimmy Aguilar Mena, 2020/11/20
- feature/completions-highlight-modifications bfb8a71 21/25: Add ignore-errors when executing from minibuffer, Jimmy Aguilar Mena, 2020/11/20
- feature/completions-highlight-modifications 3319dcc 22/25: New command minibuffer-choose-completion, Jimmy Aguilar Mena, 2020/11/20
- feature/completions-highlight-modifications 6369e59 23/25: Other changes:, Jimmy Aguilar Mena, 2020/11/20
- feature/completions-highlight-modifications c990a28 24/25: Simplify and add custom, Jimmy Aguilar Mena, 2020/11/20
- feature/completions-highlight-modifications 42f47e7 06/25: Fix recursive set-keymap-parent in completions-highlight., Jimmy Aguilar Mena, 2020/11/20
- feature/completions-highlight-modifications 644d5e5 08/25: Simplify numeric argument, Jimmy Aguilar Mena, 2020/11/20
- feature/completions-highlight-modifications 268170e 16/25: Define completions-highlight face and group, Jimmy Aguilar Mena, 2020/11/20