emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/vcomplete fdb366a898 63/91: Allow controlling where to sea


From: ELPA Syncer
Subject: [nongnu] elpa/vcomplete fdb366a898 63/91: Allow controlling where to search for the completion list buffer
Date: Tue, 24 May 2022 15:59:09 -0400 (EDT)

branch: elpa/vcomplete
commit fdb366a898b0b06e181cb5a342318f20bd1d5ca6
Author: Daniel Semyonov <daniel@dsemy.com>
Commit: Daniel Semyonov <daniel@dsemy.com>

    Allow controlling where to search for the completion list buffer
    
    * vcomplete.el (vcomplete-minibuffer-search-range)
    (vcomplete-in-region-search-range): New custom variables.
---
 NEWS           |  6 ++++++
 vcomplete.el   | 43 +++++++++++++++++++++++++++++++++++++++++--
 vcomplete.texi | 18 ++++++++++++++++++
 3 files changed, 65 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index d982b290fa..9773e01716 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,12 @@
 Vcomplete NEWS -- history of user-visible changes.
 See the end of the file for an explanation of the versioning scheme.
 
+* 1.2 (in development)
+
+** Add the ability to control where to search for the completion list buffer.
+See custom variables 'vcomplete-minibuffer-search-range' and
+'vcomplete-in-region-search-range' for more information.
+
 * 1.1
 
 ** Add the 'vcomplete-highlight' face.
diff --git a/vcomplete.el b/vcomplete.el
index c21db6f6ff..2a276cb9de 100644
--- a/vcomplete.el
+++ b/vcomplete.el
@@ -101,6 +101,44 @@ Otherwise, operate according to `completion-auto-help'."
   :risky t
   :package-version '(vcomplete . 1.1))
 
+(defcustom vcomplete-minibuffer-search-range 'visible
+  "Range of search for a `*Completions*' window during minibuffer completion.
+- t means consider all windows on all frames.
+- `visible' means consider all windows on all visible frames.
+- 0 (the number zero) means consider all windows on all visible and
+  iconified frames.
+- Any other value means consider all windows on the selected frame and
+  no others."
+  :link '(info-link "(Vcomplete)Customization")
+  :type '(radio (const :tag "All windows on all frames" t)
+                (const :tag "All windows on all visible frames" visible)
+                (const
+                 :tag "All windows on all visible and iconified frames" 0)
+                (const
+                 :tag "All windows on the currently selected frame"
+                 nil))
+  :risky t
+  :package-version '(vcomplete . 1.2))
+
+(defcustom vcomplete-in-region-search-range 'visible
+  "Range of search for a `*Completions*' window during in region completion.
+- t means consider all windows on all frames.
+- `visible' means consider all windows on all visible frames.
+- 0 (the number zero) means consider all windows on all visible and
+  iconified frames.
+- Any other value means consider all windows on the selected frame and
+  no others."
+  :link '(info-link "(Vcomplete)Customization")
+  :type '(radio (const :tag "All windows on all frames" t)
+                (const :tag "All windows on all visible frames" visible)
+                (const
+                 :tag "All windows on all visible and iconified frames" 0)
+                (const
+                 :tag "All windows on the currently selected frame"
+                 nil))
+  :risky t
+  :package-version '(vcomplete . 1.2))
+
 (defface vcomplete-highlight '((t :inherit highlight))
   "Face for highlighting completions."
   :package-version '(vcomplete . 1.1))
@@ -112,7 +150,8 @@ Otherwise, operate according to `completion-auto-help'."
 While evaluating BODY, BUFFER and WINDOW are locally bound to the
 `*Completions*' buffer and window respectively."
   `(when-let ((buffer (get-buffer "*Completions*"))
-              (window (get-buffer-window buffer)))
+              (window (get-buffer-window
+                       buffer vcomplete-minibuffer-search-range)))
      (save-current-buffer
        (set-buffer buffer)
        (unless (derived-mode-p 'completion-list-mode)
@@ -217,7 +256,7 @@ With prefix argument N, move N items (negative N means move 
forward)."
 ;; disabled through `vcomplete--update-in-region'.
 (defun vcomplete--disable-completion-in-region ()
   "Stop completion in region when there is no visible `*Completions*' buffer."
-  (unless (get-buffer-window "*Completions*")
+  (unless (get-buffer-window "*Completions*" vcomplete-in-region-search-range)
     (completion-in-region-mode -1)))
 
 (defun vcomplete--setup-completions ()
diff --git a/vcomplete.texi b/vcomplete.texi
index 6321df14bd..8e6b127dee 100644
--- a/vcomplete.texi
+++ b/vcomplete.texi
@@ -199,6 +199,24 @@ also true for other ``annotation providers'' such as the 
Marginalia
 package. Consider disabling them or this option on slow computers.
 @end defopt
 
+@defopt vcomplete-minibuffer-search-range
+Range of search for a @code{completions} window during minibuffer
+completion. A value of @code{t} means consider all windows on all
+frames, @code{visible} means consider all windows on all visible
+frames, @code{0} (the number zero) means consider all windows on all
+visible and iconified frames and any other value means consider only
+the currently selected frame. By default, @code{visible} is used.
+@end defopt
+
+@defopt vcomplete-in-region-search-range
+Range of search for a @code{completions} window during minibuffer
+completion. A value of @code{t} means consider all windows on all
+frames, @code{visible} means consider all windows on all visible
+frames, @code{0} (the number zero) means consider all windows on all
+visible and iconified frames and any other value means consider only
+the currently selected frame. By default, @code{visible} is used.
+@end defopt
+
 @menu
 * Completion commands::
 @end menu



reply via email to

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