[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/completions-highlight-modifications 0b79af7 4/4: Other changes:
From: |
Jimmy Aguilar Mena |
Subject: |
feature/completions-highlight-modifications 0b79af7 4/4: Other changes: |
Date: |
Thu, 19 Nov 2020 01:29:52 -0500 (EST) |
branch: feature/completions-highlight-modifications
commit 0b79af7c30ccd3938de3c8d51fe403e1cfd547bb
Author: Jimmy Aguilar Mena <spacibba@aol.com>
Commit: Jimmy Aguilar Mena <spacibba@aol.com>
Other changes:
* lisp/completions-highlight.el (completions-highlight-this-completion) :
Rename as completions--highlight-this-completion
(completions-highlight-set-suffix) : New custom to control suffix in
insertion
---
lisp/completions-highlight.el | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/lisp/completions-highlight.el b/lisp/completions-highlight.el
index e19a4d8..b44abca 100644
--- a/lisp/completions-highlight.el
+++ b/lisp/completions-highlight.el
@@ -72,6 +72,15 @@ buffer is shown and updated."
:group 'completions-highlight
:version "28.1")
+(defcustom completions-highlight-set-suffix t
+ "Insert completion candidate in minibuffer
+
+When this variable is nil the completions will be highlighted but
+not inserted in the minibuffer."
+ :type 'boolean
+ :group 'completions-highlight
+ :version "28.1")
+
(defface completions-highlight
'((t :inherit highlight :extend t))
"Default face for highlighting the current line in Hl-Line mode."
@@ -85,8 +94,9 @@ buffer is shown and updated."
"Saves the the original value of completion-in-minibuffer-scroll-window.")
;; *Completions* side commands
-(defun completions-highlight-this-completion ()
+(defun completions-highlight--this-completion ()
"Highlight the completion under point or near."
+ ;; Find a completion close
(next-completion -1)
(next-completion 1)
(completions-highlight-select-near))
@@ -104,7 +114,8 @@ buffer is shown and updated."
(choice (buffer-substring-no-properties obeg oend)))
(move-overlay completions-highlight-overlay obeg oend)
- (minibuffer-completion-set-suffix choice)))
+ (when completions-highlight-set-suffix
+ (completions-highlight--set-suffix choice))))
(defsubst completions-highlight-completions-visible-p ()
"Return t if *Completions* is visible."
@@ -127,8 +138,7 @@ The argument N is passed directly to
`next-completion', the command is executed
in another window, but cursor stays in minibuffer."
(interactive "p")
- (with-minibuffer-scroll-window
- (next-completion n)))
+ (with-minibuffer-scroll-window (next-completion n)))
(defun minibuffer-previous-completion (n)
"Execute `previous-completion' in *Completions*.
@@ -136,8 +146,7 @@ The argument N is passed directly to `previous-completion',
the
command is executed in another window, but cursor stays in
minibuffer."
(interactive "p")
- (with-minibuffer-scroll-window
- (previous-completion n)))
+ (with-minibuffer-scroll-window (previous-completion n)))
(defun minibuffer-next-line-completion (n)
"Execute `next-line' in *Completions*.