]> git.eshelyaron.com Git - emacs.git/commitdiff
New command ido-switch-to-completions.
authorTassilo Horn <tsdh@gnu.org>
Fri, 8 Mar 2019 18:59:32 +0000 (19:59 +0100)
committerTassilo Horn <tsdh@gnu.org>
Fri, 8 Mar 2019 19:00:49 +0000 (20:00 +0100)
* lisp/ido.el (ido-switch-to-completions): New command.

lisp/ido.el

index c268289a18fca1baa83a397dcdc20cd5784e5df4..08540145815faaf7615e6b6f392d05737601fc95 100644 (file)
@@ -3965,8 +3965,24 @@ If `ido-change-word-sub' cannot be found in WORD, return nil."
     (exit-minibuffer)
     t))
 
+;; This is a shameless copy of `switch-to-completions'.
+(defun ido-switch-to-completions ()
+  "Select the window showing `ido-completion-buffer'."
+  (interactive)
+  (let ((window (or (get-buffer-window ido-completion-buffer 0)
+                   ;; Make sure we have a completions window.
+                    (progn (ido-completion-help)
+                           (get-buffer-window ido-completion-buffer 0)))))
+    (when window
+      (select-window window)
+      ;; In the new buffer, go to the first completion.
+      ;; FIXME: Perhaps this should be done in `ido-completion-help'.
+      (when (bobp)
+       (next-completion 1)))))
+
+
 (defun ido-completion-help ()
-  "Show possible completions in a \"*File Completions*\" buffer."
+  "Show possible completions in the `ido-completion-buffer'."
   (interactive)
   (setq ido-rescan nil)
   (let ((temp-buf (and ido-completion-buffer