From unknown Wed Jun 18 23:03:33 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#9482 <9482@debbugs.gnu.org> To: bug#9482 <9482@debbugs.gnu.org> Subject: Status: Documentation bug: Emacs Lisp Manual should say quoting does not cons explicitly in quoting section. related to bug#9469 Reply-To: bug#9482 <9482@debbugs.gnu.org> Date: Thu, 19 Jun 2025 06:03:33 +0000 retitle 9482 Documentation bug: Emacs Lisp Manual should say quoting does n= ot cons explicitly in quoting section. related to bug#9469 reassign 9482 emacs submitter 9482 Le Wang severity 9482 minor thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 12 11:05:55 2011 Received: (at submit) by debbugs.gnu.org; 12 Sep 2011 15:05:56 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R3855-0007EV-9M for submit@debbugs.gnu.org; Mon, 12 Sep 2011 11:05:55 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R3852-0007EO-GL for submit@debbugs.gnu.org; Mon, 12 Sep 2011 11:05:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R380o-0000pP-1V for submit@debbugs.gnu.org; Mon, 12 Sep 2011 11:01:30 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:34943) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R380n-0000pL-WF for submit@debbugs.gnu.org; Mon, 12 Sep 2011 11:01:30 -0400 Received: from eggs.gnu.org ([140.186.70.92]:45148) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R380m-0005zV-Oo for bug-gnu-emacs@gnu.org; Mon, 12 Sep 2011 11:01:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R380l-0000ot-Ps for bug-gnu-emacs@gnu.org; Mon, 12 Sep 2011 11:01:28 -0400 Received: from mail-pz0-f44.google.com ([209.85.210.44]:54067) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R380l-0000of-DN for bug-gnu-emacs@gnu.org; Mon, 12 Sep 2011 11:01:27 -0400 Received: by pzk36 with SMTP id 36so7728485pzk.17 for ; Mon, 12 Sep 2011 08:01:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=bkYIkzU73HurwTy/xMwWBl2lRYWMzSoRyCRbXFFMaNI=; b=Q1Y9A1EJ76ZjQ/CEBrDZ3B6L38aWl49raMq1EoM2hqCLShUR/EW+uy4zkb/NFYyD0z u9A/onphbTETc69UNzfM/B6/30uSEY/yMELlAdK+XUz9Ol1bUDEgWB9YArPngJCtWdaP vCMOf4CNLyrXSn2ZIIxjeDfUmxj+nS05SlnA0= MIME-Version: 1.0 Received: by 10.68.38.35 with SMTP id d3mr4962013pbk.452.1315839685079; Mon, 12 Sep 2011 08:01:25 -0700 (PDT) Received: by 10.68.58.138 with HTTP; Mon, 12 Sep 2011 08:01:23 -0700 (PDT) Date: Mon, 12 Sep 2011 23:01:23 +0800 Message-ID: Subject: Documentation bug: Emacs Lisp Manual should say quoting does not cons explicitly in quoting section. related to bug#9469 From: Le Wang To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -5.2 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.3 (-----) Relevant page here: http://www.gnu.org/s/emacs/manual/html_node/elisp/Quoting.html I was confused and always assumed that '(a . b) is simply short hand for (cons 'a 'b) Reading stackexchange, it seems at least some other people are under this impression as well. This works a majority of the time, but when it fails it's really surprising. In fact, the manual already has an example of this pit-fall in the nconc section: http://www.gnu.org/software/emacs/elisp/html_node/Rearrangement.html I think the quoting section should give an explicit warning with a reference to the nconc example. -- Le From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 13 09:30:03 2011 Received: (at 9482) by debbugs.gnu.org; 13 Sep 2011 13:30:03 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R3T3q-0006B7-9L for submit@debbugs.gnu.org; Tue, 13 Sep 2011 09:30:03 -0400 Received: from mail-pz0-f47.google.com ([209.85.210.47]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R3T3k-0006AY-Jq for 9482@debbugs.gnu.org; Tue, 13 Sep 2011 09:29:58 -0400 Received: by pzk2 with SMTP id 2so752110pzk.20 for <9482@debbugs.gnu.org>; Tue, 13 Sep 2011 06:25:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=/HpcdlvenGCE7/WyjWzIZ7JvY8wap/JUP10CBA44k68=; b=v30xYsdzkTtIsUH15VCcVaajFQcwDKq//9C1q/sh44tVJLA0rS8Xx7tsgcmXwjA/yV iQHZCskJTMWgA5t2gym2DSa9HTefAPDy+J11hBksK/WSblDVmPFOKImTp42Zegw6MXtT AEKnIY3sZCEj6ACjjvd1Pw+2qEM7v9vCkEsBM= MIME-Version: 1.0 Received: by 10.68.24.69 with SMTP id s5mr3829262pbf.519.1315920328410; Tue, 13 Sep 2011 06:25:28 -0700 (PDT) Received: by 10.68.58.138 with HTTP; Tue, 13 Sep 2011 06:25:28 -0700 (PDT) Date: Tue, 13 Sep 2011 21:25:28 +0800 Message-ID: Subject: specific manual text suggestion From: Le Wang To: Stefan Monnier Content-Type: text/plain; charset=ISO-8859-1 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: 9482 Cc: 9482@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.1 (----) Hi Stefan, As I mentioned in this bug. The manual already has an example of this trap in the nconc section. Maybe just a pointer to it. So my suggestion for specific text would be: "WARNING: '(a . b) is not short-hand for (cons 'a 'b). The former does not cons. Quoting should be reserved for constants that will *NEVER* change. See nconc for example of unexpected results when a quoted object is modified." My terminology may be not quite right, but if I read something like this, the difference would be much clearer. -- Le From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 16 10:19:27 2011 Received: (at 9482-done) by debbugs.gnu.org; 16 Sep 2011 14:19:27 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R4ZGJ-0007nY-Cv for submit@debbugs.gnu.org; Fri, 16 Sep 2011 10:19:27 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R4ZGH-0007nR-EY for 9482-done@debbugs.gnu.org; Fri, 16 Sep 2011 10:19:26 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjEFAJ9Yc05FpYYd/2dsb2JhbABBpV6BfHiBUwEBBAFWIwULCw4mEhQYDSSICrRlhngEoE6ERA X-IronPort-AV: E=Sophos;i="4.68,393,1312171200"; d="scan'208";a="136705561" Received: from 69-165-134-29.dsl.teksavvy.com (HELO pastel.home) ([69.165.134.29]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 16 Sep 2011 10:14:40 -0400 Received: by pastel.home (Postfix, from userid 20848) id BA3AE58F87; Fri, 16 Sep 2011 10:14:39 -0400 (EDT) From: Stefan Monnier To: Le Wang Subject: Re: specific manual text suggestion Message-ID: References: Date: Fri, 16 Sep 2011 10:14:39 -0400 In-Reply-To: (Le Wang's message of "Tue, 13 Sep 2011 21:25:28 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 9482-done Cc: 9482-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.1 (--) > My terminology may be not quite right, but if I read something like > this, the difference would be much clearer. Thanks for your sample text. I tweaked it a bit to make it hopefully even more explicit, see patch below. Stefan --- src/eval.c 2011-09-09 01:06:52 +0000 +++ src/eval.c 2011-09-16 14:09:39 +0000 @@ -475,6 +475,14 @@ DEFUN ("quote", Fquote, Squote, 1, UNEVALLED, 0, doc: /* Return the argument, without evaluating it. `(quote x)' yields `x'. +Warning: `quote' does not construct its return value, but just returns +the value that was pre-constructed by the Lisp reader (see info node +`(elisp)Printed Representation'). +This means that '(a . b) is not identical to (cons 'a 'b): the former +does not cons. Quoting should be reserved for constants that will +never be modified by side-effects, unless you like self-modifying +code. See the common pitfall in info node `(elisp)Rearrangement' for +an example of unexpected results when a quoted object is modified. usage: (quote ARG) */) (Lisp_Object args) { From unknown Wed Jun 18 23:03:33 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 15 Oct 2011 11:24:08 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator