[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 210e592 1/2: Avoid cycling in minibuffer-force-comp
From: |
João Távora |
Subject: |
[Emacs-diffs] master 210e592 1/2: Avoid cycling in minibuffer-force-complete-and-exit (bug#34116) |
Date: |
Wed, 23 Jan 2019 11:33:44 -0500 (EST) |
branch: master
commit 210e592e55ade154c8d58bd467711fb69368f6cb
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
Avoid cycling in minibuffer-force-complete-and-exit (bug#34116)
* lisp/minibuffer.el (minibuffer-force-complete-and-exit): Check
completion-cycling before minibuffer-force-complete.
---
lisp/minibuffer.el | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 5760a2e..99cb669 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -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