summaryrefslogtreecommitdiff
path: root/lisp/minibuffer.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2012-10-19 14:59:36 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2012-10-19 14:59:36 -0400
commit8e8083185c417eedbaadf0b33c7089da72fe2250 (patch)
treeec9734b1c89f815edb11914aaee81e168aceb7d8 /lisp/minibuffer.el
parent2c43889e841d1c4e19d876ec2c7d078b940d10d0 (diff)
downloademacs-8e8083185c417eedbaadf0b33c7089da72fe2250.tar.gz
* lisp/minibuffer.el (minibuffer-force-complete): Make the next completion use
the same completion-field (bug@12221).
Diffstat (limited to 'lisp/minibuffer.el')
-rw-r--r--lisp/minibuffer.el19
1 files changed, 17 insertions, 2 deletions
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index f464b42182d..f865a0269d4 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -1134,7 +1134,23 @@ Repeated uses step through the possible completions."
;; through the previous possible completions.
(let ((last (last all)))
(setcdr last (cons (car all) (cdr last)))
- (completion--cache-all-sorted-completions (cdr all)))))))
+ (completion--cache-all-sorted-completions (cdr all)))
+ ;; Make sure repeated uses cycle, even though completion--done might
+ ;; have added a space or something that moved us outside of the field.
+ ;; (bug#12221).
+ (let* ((table minibuffer-completion-table)
+ (pred minibuffer-completion-predicate)
+ (extra-prop completion-extra-properties)
+ (cmd
+ (lambda () "Cycle through the possible completions."
+ (interactive)
+ (let ((completion-extra-properties extra-prop))
+ (completion-in-region start (point) table pred)))))
+ (set-temporary-overlay-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map [remap completion-at-point] cmd)
+ (define-key map (vector last-command-event) cmd)
+ map)))))))
(defvar minibuffer-confirm-exit-commands
'(completion-at-point minibuffer-complete
@@ -1557,7 +1573,6 @@ variables.")
(let* ((exit-fun (plist-get completion-extra-properties :exit-function))
(pre-msg (and exit-fun (current-message))))
(cl-assert (memq finished '(exact sole finished unknown)))
- ;; FIXME: exit-fun should receive `finished' as a parameter.
(when exit-fun
(when (eq finished 'unknown)
(setq finished