emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r107395: * lisp/icomplete.el (icomple


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r107395: * lisp/icomplete.el (icomplete-completions): Replace last fix.
Date: Thu, 23 Feb 2012 10:36:07 -0500
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107395
fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10850
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Thu 2012-02-23 10:36:07 -0500
message:
  * lisp/icomplete.el (icomplete-completions): Replace last fix.
modified:
  lisp/ChangeLog
  lisp/icomplete.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-02-23 08:32:18 +0000
+++ b/lisp/ChangeLog    2012-02-23 15:36:07 +0000
@@ -1,3 +1,8 @@
+2012-02-23  Stefan Monnier  <address@hidden>
+
+       * icomplete.el (icomplete-completions): Replace last fix with a better
+       one (bug#10850).
+
 2012-02-23  Dmitry Gutov  <address@hidden>
 
        * emacs-lisp/lisp.el (beginning-of-defun-raw): Don't call end-of-defun

=== modified file 'lisp/icomplete.el'
--- a/lisp/icomplete.el 2012-02-20 08:06:52 +0000
+++ b/lisp/icomplete.el 2012-02-23 15:36:07 +0000
@@ -333,23 +333,23 @@
                  (window-width)))
              (prefix-len
               ;; Find the common prefix among `comps'.
-             (if (eq t (compare-strings (car comps) nil (length most)
-                                        most nil nil completion-ignore-case))
-                  ;; Common case.
-                 (length most)
-                ;; Else, use try-completion.
-               (let ((comps-prefix (try-completion "" comps)))
-                  (and (stringp comps-prefix)
-                       (length comps-prefix)))))
+             ;; We can't use the optimization below because its assumptions
+             ;; aren't always true, e.g. when completion-cycling (bug#10850):
+             ;; (if (eq t (compare-strings (car comps) nil (length most)
+             ;;                         most nil nil completion-ignore-case))
+             ;;     ;; Common case.
+             ;;     (length most)
+             ;; Else, use try-completion.
+             (let ((comps-prefix (try-completion "" comps)))
+               (and (stringp comps-prefix)
+                    (length comps-prefix)))) ;;)
 
             prospects most-is-exact comp limit)
        (if (eq most-try t) ;; (or (null (cdr comps))
            (setq prospects nil)
          (while (and comps (not limit))
            (setq comp
-                 (if (and prefix-len (<= prefix-len (length (car comps))))
-                     (substring (car comps) prefix-len)
-                   (car comps))
+                 (if prefix-len (substring (car comps) prefix-len) (car comps))
                  comps (cdr comps))
            (cond ((string-equal comp "") (setq most-is-exact t))
                  ((member comp prospects))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]