]> git.eshelyaron.com Git - emacs.git/commitdiff
(minibuffer-force-complete): Cycle the list, rather
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 24 Sep 2009 02:37:37 +0000 (02:37 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 24 Sep 2009 02:37:37 +0000 (02:37 +0000)
than just dropping elements from it (bug#4504).

lisp/ChangeLog
lisp/minibuffer.el

index e216b9e1c7f972958c63cbb2feddf8c1ccac69f9..d41c8f2d0ac565f2e6d267d59281b4f42502c154 100644 (file)
@@ -1,5 +1,8 @@
 2009-09-24  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+       * minibuffer.el (minibuffer-force-complete): Cycle the list, rather
+       than just dropping elements from it (bug#4504).
+
        * term.el (term-set-scroll-region): Don't move cursor any more.
        (term-handle-ansi-escape): Call term-goto here instead.
        Suggested by Ivan Kanis <apple@kanis.eu>.
index 90490973f80ccbdd059cbb8537b19dd653bb5c31..8f2de068444827ceb22ec1742f2ba08eccf14a83 100644 (file)
@@ -546,7 +546,9 @@ Repeated uses step through the possible completions."
       ;; completion-all-sorted-completions to nil, but we prefer not to,
       ;; so that repeated calls minibuffer-force-complete still cycle
       ;; through the previous possible completions.
-      (setq completion-all-sorted-completions (cdr all)))))
+      (let ((last (last all)))
+        (setcdr last (cons (car all) (cdr last)))
+        (setq completion-all-sorted-completions (cdr all))))))
 
 (defvar minibuffer-confirm-exit-commands
   '(minibuffer-complete minibuffer-complete-word PC-complete PC-complete-word)