]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/minibuffer.el (minibuffer-force-complete): Make the next completion use
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 19 Oct 2012 18:59:36 +0000 (14:59 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 19 Oct 2012 18:59:36 +0000 (14:59 -0400)
the same completion-field (bug@12221).

lisp/ChangeLog
lisp/minibuffer.el

index f9d9ad4b03d68631c31bc7f1bf1889a30782d76f..096e9a529167140e61f113b24ff15425d3896e9e 100644 (file)
@@ -1,3 +1,8 @@
+2012-10-19  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * minibuffer.el (minibuffer-force-complete): Make the next completion use
+       the same completion-field (bug@12221).
+
 2012-10-19  Martin Rudalics  <rudalics@gmx.at>
 
        * emacs-lisp/debug.el (debug): Record height of debugger window
index f464b42182dedd855a072f9635204b2d9c0f0a34..f865a0269d4d3722331bbad5f862645ad1815c12 100644 (file)
@@ -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