emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] /srv/bzr/emacs/trunk r107346: Check FROM arg to substr


From: Stefan Monnier
Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r107346: Check FROM arg to substring in icomplete-completions
Date: Thu, 23 Feb 2012 10:42:24 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (gnu/linux)

>   See: http://debbugs.gnu.org/10850

Please use Bazaar's "--fixes" argument (or the "Fixes:" header in
*VC-Log*).  This will work "automatically" in *VC-Log* if you use C-c
C-a to fill the buffer from the ChangeLog.

> @@ -347,7 +347,9 @@
>           (setq prospects nil)
>         (while (and comps (not limit))
>           (setq comp
> -                  (if prefix-len (substring (car comps) prefix-len) (car 
> comps))
> +               (if (and prefix-len (<= prefix-len (length (car comps))))
> +                   (substring (car comps) prefix-len)
> +                 (car comps))
>                 comps (cdr comps))
>           (cond ((string-equal comp "") (setq most-is-exact t))
>                 ((member comp prospects))

Actually, this is not the right fix: it just papers over another bug.
The most immediate bug is where we compute prefix-len: the `if' takes
the first branch (the "fast-path") but the test is not thorough enough
for your test case and returns an incorrect answer.  I've disabled the
fast-path (and reverted your patch since it's then unneeded).

But note that cycle-completion still has several other problems when
combined with icomplete.  Some are plain bugs (working on one of them
as we speak), and others are mostly design issues "what should ideally
happen?".


        Stefan



reply via email to

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