]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid cycling in minibuffer-force-complete-and-exit (bug#34116)
authorJoão Távora <joaotavora@gmail.com>
Wed, 23 Jan 2019 16:17:03 +0000 (16:17 +0000)
committerJoão Távora <joaotavora@gmail.com>
Wed, 23 Jan 2019 16:31:08 +0000 (16:31 +0000)
* lisp/minibuffer.el (minibuffer-force-complete-and-exit): Check
completion-cycling before minibuffer-force-complete.

lisp/minibuffer.el

index 5760a2e49de50680e8929bdfbbd510033b4c5600..99cb66926bb6d978e6ca91582eecc101f62e0e33 100644 (file)
@@ -1257,7 +1257,13 @@ scroll the window of possible completions."
 (defun minibuffer-force-complete-and-exit ()
   "Complete the minibuffer with first of the matches and exit."
   (interactive)
-  (minibuffer-force-complete)
+  ;; If `completion-cycling' is t, then surely a
+  ;; `minibuffer-force-complete' has already executed.  This is not
+  ;; just for speed: the extra rotation caused by the second
+  ;; unnecessary call would mess up the final result value
+  ;; (bug#34116).
+  (unless completion-cycling
+    (minibuffer-force-complete))
   (completion--complete-and-exit
    (minibuffer-prompt-end) (point-max) #'exit-minibuffer
    ;; If the previous completion completed to an element which fails