GNU bug report logs - #36035
26.2; doc string of `add-to-list'

Previous Next

Package: emacs;

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

Date: Fri, 31 May 2019 20:47:02 UTC

Severity: minor

Found in version 26.2

Done: Drew Adams <drew.adams <at> oracle.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: npostavs <at> gmail.com
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 36035 <at> debbugs.gnu.org
Subject: bug#36035: 26.2; doc string of `add-to-list'
Date: Fri, 31 May 2019 16:51:02 -0400
Drew Adams <drew.adams <at> oracle.com> writes:

> But one might easily get the impression that it does NOT add ELEMENT if
> it is already present.  And that's just plain wrong.
>
> (setq foo '((a . "aaa") (b . "bbb"))) ; => ((a . "aaa") (b . "bbb"))
>
> (add-to-list 'foo '(a . "@@@@")) ; => ((a . "@@@@") (a . "aaa") (b . "bbb"))

Have you mixed up add-to-list with some hypothetical add-to-alist?

(setq foo '((a . "aaa") (b . "bbb"))) ; => ((a . "aaa") (b . "bbb"))

(add-to-list 'foo '(a . "aaa")) ; => ((a . "aaa") (b . "bbb"))




This bug report was last modified 5 years and 354 days ago.

Previous Next


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