From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: npostavs@gmail.com Newsgroups: gmane.emacs.bugs Subject: bug#36035: 26.2; doc string of `add-to-list' Date: Fri, 31 May 2019 16:51:02 -0400 Message-ID: <855zpqcpqh.fsf@gmail.com> References: <556e648d-6911-40bc-815c-9e348cb7f058@default> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="211617"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.92 (windows-nt) Cc: 36035@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 31 22:52:11 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hWoVV-000ssg-VY for geb-bug-gnu-emacs@m.gmane.org; Fri, 31 May 2019 22:52:10 +0200 Original-Received: from localhost ([127.0.0.1]:49024 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWoVV-00054d-0X for geb-bug-gnu-emacs@m.gmane.org; Fri, 31 May 2019 16:52:09 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57566) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWoVP-00054T-BA for bug-gnu-emacs@gnu.org; Fri, 31 May 2019 16:52:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hWoVO-0003YK-CW for bug-gnu-emacs@gnu.org; Fri, 31 May 2019 16:52:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51090) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hWoVO-0003YF-9M for bug-gnu-emacs@gnu.org; Fri, 31 May 2019 16:52:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hWoVO-000486-7h for bug-gnu-emacs@gnu.org; Fri, 31 May 2019 16:52:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@gmail.com Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 31 May 2019 20:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36035 X-GNU-PR-Package: emacs Original-Received: via spool by 36035-submit@debbugs.gnu.org id=B36035.155933587715727 (code B ref 36035); Fri, 31 May 2019 20:52:02 +0000 Original-Received: (at 36035) by debbugs.gnu.org; 31 May 2019 20:51:17 +0000 Original-Received: from localhost ([127.0.0.1]:36397 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hWoUe-00045a-VL for submit@debbugs.gnu.org; Fri, 31 May 2019 16:51:17 -0400 Original-Received: from mail-io1-f50.google.com ([209.85.166.50]:37083) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hWoUd-00045A-NM for 36035@debbugs.gnu.org; Fri, 31 May 2019 16:51:16 -0400 Original-Received: by mail-io1-f50.google.com with SMTP id e5so9371091iok.4 for <36035@debbugs.gnu.org>; Fri, 31 May 2019 13:51:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=QHHDNKnpTfY+zXVeLnTcnDKTyWcZObT4leM6v4wUnWQ=; b=HQDvCjZA2oPMyyu31EUHShwmFqP4iaqX26mVySFY3vVkh6IHmvmz7RVBP9rh3go6vy 828Gz47ezgglXnZ/KHB3DhO8NVmnFxyFmnmSeJS7M6Bu2BTDCbR0VL76GRJiaVNQhI/q MPzr7uPKlRNc6JCleeDSSLFfGrSV8Diko+I9dpLjgQB4eeSYBEMU4A2kO5ZFYP0vMMEB T1ryEWW9fV12wLJu6XFIWa47SQNtvsLdD2oJJfcNm0DvdlJNp7E2XMbY9cFibSySfHF/ lii6IXj5iEcMGNORLgYNuZWSodJg7TxrptuBAa86Qt8cEWWC+YTXg4Zeb/ZiCvm0Ssqo jrPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=QHHDNKnpTfY+zXVeLnTcnDKTyWcZObT4leM6v4wUnWQ=; b=EGThIF12Yk38RbMrEWzsGV49yxuHJhNh3rIBcJrX+jJTTphCH29GYdnYWAvtkaNogo vz/XVA7P0hhO0Sy2Tuw2jl/VJtYZQfIzVhKAK2deACXCOSCZL25ivSB45+DE3tcPxMgR gTEKDXFSPn2CtjSDBnyW8+TINv9gZp3uA6lo3ebCIGtfa+CDztfB6tlpGOE1sowWjAsV 0G5vXjOgQmTu/OifgsVI3YXm2WN3aFHnDYOaogcTuHXL+TBA7peCAl8G1QDaW2YiTefb 8nybhsJes30lLRMu66w8oisfajyhaKK2jCdsQjCM0LP8X1cG8SWjPFsHL0SBunJAkDIO AYXw== X-Gm-Message-State: APjAAAUONR8kPtD0XAzGJHuk58kspf/ZrXu3AEy167lxFH+ItpRrsFR+ M2qRmDGqIEIVKiBiEwNQDUiglxRW X-Google-Smtp-Source: APXvYqx0H4Ja7Hrg1+yntbdIJM40nnEUjOpwP7spK+wn7jWsYR/Cdas+jTp9CdSUbHVunfvka/qHVQ== X-Received: by 2002:a6b:7d49:: with SMTP id d9mr2117079ioq.50.1559335869695; Fri, 31 May 2019 13:51:09 -0700 (PDT) Original-Received: from vhost2 (CPE001143542e1f-CMf81d0f809fa0.cpe.net.cable.rogers.com. [99.230.51.196]) by smtp.gmail.com with ESMTPSA id h185sm2767890itb.16.2019.05.31.13.51.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 31 May 2019 13:51:09 -0700 (PDT) In-Reply-To: <556e648d-6911-40bc-815c-9e348cb7f058@default> (Drew Adams's message of "Fri, 31 May 2019 13:46:16 -0700 (PDT)") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:159982 Archived-At: Drew Adams 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"))