Subject: Re: bug#36035: 26.2; doc string of `add-to-list'

From: [email-masked]
Date: Fri, 31 May 2019 16:51:02 -0400

Drew Adams <[email-masked]> 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"))