unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: [Emacs-diffs] /srv/bzr/emacs/trunk r107346: Check FROM arg to substring in icomplete-completions
       [not found] <E1RzOQw-0002hP-7M@vcs.savannah.gnu.org>
@ 2012-02-23 15:42 ` Stefan Monnier
  2012-03-02 16:52   ` Leo
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Monnier @ 2012-02-23 15:42 UTC (permalink / raw)
  To: Leo Liu; +Cc: emacs-devel

>   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



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Emacs-diffs] /srv/bzr/emacs/trunk r107346: Check FROM arg to substring in icomplete-completions
  2012-02-23 15:42 ` [Emacs-diffs] /srv/bzr/emacs/trunk r107346: Check FROM arg to substring in icomplete-completions Stefan Monnier
@ 2012-03-02 16:52   ` Leo
  0 siblings, 0 replies; 2+ messages in thread
From: Leo @ 2012-03-02 16:52 UTC (permalink / raw)
  To: emacs-devel

On 2012-02-23 23:42 +0800, Stefan Monnier wrote:
> 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.

Thank you for the tip.

[snipped 12 lines]
> 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?".

Thanks for fixing it properly.

Leo




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-03-02 16:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <E1RzOQw-0002hP-7M@vcs.savannah.gnu.org>
2012-02-23 15:42 ` [Emacs-diffs] /srv/bzr/emacs/trunk r107346: Check FROM arg to substring in icomplete-completions Stefan Monnier
2012-03-02 16:52   ` Leo

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).