emacs-diffs
[Top][All Lists]
Advanced

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

scratch/icomplete-vertical-mode-improvements 856af01 1/3: Distinguish fi


From: João Távora
Subject: scratch/icomplete-vertical-mode-improvements 856af01 1/3: Distinguish fido-mode from icomplete-mode verticality
Date: Wed, 26 May 2021 07:40:59 -0400 (EDT)

branch: scratch/icomplete-vertical-mode-improvements
commit 856af014f0f8d1799c20c1d0112c644498ba5290
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    Distinguish fido-mode from icomplete-mode verticality
    
    When vertical, fido-mode will not rotate, icomplete-mode will respect
    icomplete-rotate.
    
    * lisp/icomplete.el:
    (icomplete--fido-mode-setup): Init icomplete-rotate to nil if vertical
    (icomplete--vertical-minibuffer-setup): Don't init icomplete-rotate.
    (fido-vertical-mode): Alias icomplete-vertical-mode
---
 lisp/icomplete.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index 5c4438d..6107b8f 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -223,10 +223,10 @@ the default otherwise."
   ;; We're not at all interested in cycling here (bug#34077).
   (minibuffer-force-complete nil nil 'dont-cycle))
 
-;; Both these variables are only meaningful if `icomplete-rotation' is
+;; Both these variables are only meaningful if `icomplete-rotate' is
 ;; nil.
 (defvar icomplete--comp-predecessors nil
-  "When completions to list before the selected one.")
+  "Completions to list before the selected one.")
 (defvar icomplete--last-selected nil
   "Last completion selected.")
 
@@ -374,6 +374,7 @@ if that doesn't produce a completion match."
     (setq-local icomplete-tidy-shadowed-file-names t
                 icomplete-show-matches-on-no-input t
                 icomplete-hide-common-prefix nil
+                icomplete-rotate (null icomplete-vertical-mode)
                 completion-styles '(flex)
                 completion-flex-nospace nil
                 completion-category-defaults nil
@@ -598,7 +599,6 @@ Usually run by inclusion in `minibuffer-setup-hook'."
   (use-local-map (make-composed-keymap icomplete-vertical-mode-minibuffer-map
                                        (current-local-map)))
   (setq-local icomplete-separator "\n"
-              icomplete-rotate nil
               icomplete-hide-common-prefix nil
               ;; Ask `icomplete-completions' to return enough completions 
candidates.
               icomplete-prospects-height 10
@@ -618,6 +618,8 @@ resized depends on `resize-mini-windows'."
     (add-hook 'icomplete-minibuffer-setup-hook
               #'icomplete--vertical-minibuffer-setup)))
 
+(defalias 'fido-vertical-mode 'icomplete-vertical-mode)
+
 
 
 



reply via email to

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