[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/completions-highlight-modifications 9fe2441 15/18: Add custom va
From: |
Jimmy Aguilar Mena |
Subject: |
feature/completions-highlight-modifications 9fe2441 15/18: Add custom variable completions-highlight-autoselect. |
Date: |
Wed, 18 Nov 2020 22:30:36 -0500 (EST) |
branch: feature/completions-highlight-modifications
commit 9fe244142455ae1e6deceb56b61372a45fe6a3e5
Author: Jimmy Aguilar Mena <spacibba@aol.com>
Commit: Jimmy Aguilar Mena <spacibba@aol.com>
Add custom variable completions-highlight-autoselect.
* lisp/completions-highlight.el (completions-highlight-autoselect) : New
custom.
(completions-highlight-setup) : Auto selects the first candidate when
completions-highlight-autoselect is non nil.
---
lisp/completions-highlight.el | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/lisp/completions-highlight.el b/lisp/completions-highlight.el
index e675a72..78017f9 100644
--- a/lisp/completions-highlight.el
+++ b/lisp/completions-highlight.el
@@ -58,6 +58,17 @@
(require 'simple)
(require 'minibuffer)
+(defcustom completions-highlight-autoselect nil
+ "Select first candidate without extra tab.
+
+When this variable is nil an extra tab is required to select and
+highlight the first candidate in the *Completions* buffer. When
+the value is non-nil the candidate is selected every time the
+buffer is shown and updated."
+ :type 'boolean
+ :group 'completion
+ :version "28.1")
+
(defvar completions-highlight-overlay (make-overlay 0 0)
"Overlay to use when `completion-highlight-mode' is enabled.")
@@ -267,7 +278,12 @@ It is called when showing the *Completions* buffer."
;; Add completions-highlight-completions-map to *Completions*
(use-local-map (make-composed-keymap
- completions-highlight-completions-map
(current-local-map)))))
+ completions-highlight-completions-map
(current-local-map)))
+
+ ;; Autoselect candidate if enabled
+ (when completions-highlight-autoselect
+ (with-selected-window (get-buffer-window (current-buffer) 0)
+ (completions-highlight-next-completion 1)))))
(add-hook 'pre-command-hook
#'completions-highlight-minibuffer-pre-command-hook nil t)
- feature/completions-highlight-modifications 8647012 06/18: Fix recursive set-keymap-parent in completions-highlight., (continued)
- feature/completions-highlight-modifications 8647012 06/18: Fix recursive set-keymap-parent in completions-highlight., Jimmy Aguilar Mena, 2020/11/18
- feature/completions-highlight-modifications 8f3e475 03/18: Add completions-highlight-mode initial implementation., Jimmy Aguilar Mena, 2020/11/18
- feature/completions-highlight-modifications a6e73e8 04/18: Fix initial comment in completions-highlight file., Jimmy Aguilar Mena, 2020/11/18
- feature/completions-highlight-modifications 8a60d7d 08/18: Simplify numeric argument, Jimmy Aguilar Mena, 2020/11/18
- feature/completions-highlight-modifications a686211 10/18: Simplify overlay handling, Jimmy Aguilar Mena, 2020/11/18
- feature/completions-highlight-modifications 34570e1 14/18: Improve completions-highlight description in file header., Jimmy Aguilar Mena, 2020/11/18
- feature/completions-highlight-modifications bfe4747 12/18: Add parent maps, Jimmy Aguilar Mena, 2020/11/18
- feature/completions-highlight-modifications 6db2c4a 17/18: Simplify and rely more in the post-command-hook, Jimmy Aguilar Mena, 2020/11/18
- feature/completions-highlight-modifications d397d2b 13/18: Add # to function bindings, Jimmy Aguilar Mena, 2020/11/18
- feature/completions-highlight-modifications cb02cb6 11/18: Add autoload decorator., Jimmy Aguilar Mena, 2020/11/18
- feature/completions-highlight-modifications 9fe2441 15/18: Add custom variable completions-highlight-autoselect.,
Jimmy Aguilar Mena <=
- feature/completions-highlight-modifications ff46a8f 18/18: Add backtab commands., Jimmy Aguilar Mena, 2020/11/18
- feature/completions-highlight-modifications 71f60b6 07/18: Fix corner case when going out of bounds, Jimmy Aguilar Mena, 2020/11/18
- feature/completions-highlight-modifications ac93fdb 16/18: Define completions-highlight face and group, Jimmy Aguilar Mena, 2020/11/18
- feature/completions-highlight-modifications f3ad5c1 09/18: Simplify setting keymaps., Jimmy Aguilar Mena, 2020/11/18