GNU bug report logs - #12705
24.2.50; `Info-complete-menu-item' should use `add-to-list', not `push', to prevent duplicates

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Mon, 22 Oct 2012 16:29:02 UTC

Severity: normal

Found in version 24.2.50

Done: Chong Yidong <cyd <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Chong Yidong <cyd <at> gnu.org>
To: "Drew Adams" <drew.adams <at> oracle.com>
Cc: 12705-done <at> debbugs.gnu.org
Subject: bug#12705: 24.2.50; `Info-complete-menu-item' should use `add-to-list', not `push', to prevent duplicates
Date: Mon, 29 Oct 2012 18:44:36 +0800
"Drew Adams" <drew.adams <at> oracle.com> writes:

> This sexp:
> (push (match-string-no-properties 1) completions)
>  
> should be changed to this:
> (add-to-list 'completions (match-string-no-properties 1))
>
> Otherwise the same entry can be added to `completions' multiple times.
>  
> This might not be manifested in *Completions*, because Emacs removes
> duplicate candidates.  But in other completion setups (e.g. Icicles)
> duplicate candidates (e.g. same display string, but perhaps different
> alist elements) are sometimes allowed.

Sounds reasonable.  Done in trunk, using delete-dups instead of
add-to-list (in case info.el switches to lexical binding).




This bug report was last modified 12 years and 211 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.