From unknown Sun Jun 22 07:44:48 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12383: [Patch] Clarify the distinction between "syntax codes" and the cons cells that contain them Resent-From: Nathan Trapuzzano Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Sep 2012 00:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 12383 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 12383@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.134706503827174 (code B ref -1); Sat, 08 Sep 2012 00:44:01 +0000 Received: (at submit) by debbugs.gnu.org; 8 Sep 2012 00:43:58 +0000 Received: from localhost ([127.0.0.1]:47418 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TA99S-00074F-Cp for submit@debbugs.gnu.org; Fri, 07 Sep 2012 20:43:58 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58383) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TA99N-000744-0x for submit@debbugs.gnu.org; Fri, 07 Sep 2012 20:43:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TA991-0008RW-Bz for submit@debbugs.gnu.org; Fri, 07 Sep 2012 20:43:32 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:57099) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TA991-0008RS-8f for submit@debbugs.gnu.org; Fri, 07 Sep 2012 20:43:31 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TA990-0000rp-5W for bug-gnu-emacs@gnu.org; Fri, 07 Sep 2012 20:43:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TA98z-0008RH-1Z for bug-gnu-emacs@gnu.org; Fri, 07 Sep 2012 20:43:30 -0400 Received: from oproxy7-pub.bluehost.com ([67.222.55.9]:34981) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1TA98y-0008R5-L5 for bug-gnu-emacs@gnu.org; Fri, 07 Sep 2012 20:43:28 -0400 Received: (qmail 25823 invoked by uid 0); 8 Sep 2012 00:43:26 -0000 Received: from unknown (HELO host393.hostmonster.com) (66.147.240.193) by oproxy7.bluehost.com with SMTP; 8 Sep 2012 00:43:26 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbtrap.com; s=default; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From; bh=gQ+r3RoWetbJjmmluCEyk4dIviJSL1qqbcYxHXUVRD0=; b=PfKHaB4FThhWU4yYp/OUWWx5XfA4+PhyS8dBELf+pCqKBlLIu0VyVxhODatV/Xh46hUG2OU6xRnGIQEgvfExe4AtHpRDp5m/DmgdJJwxmnVKZsQuZhf69+jS9RXH82jL; Received: from [99.40.62.116] (port=57027 helo=Nathan-GNU) by host393.hostmonster.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.76) (envelope-from ) id 1TA98v-0003ko-Tu for bug-gnu-emacs@gnu.org; Fri, 07 Sep 2012 18:43:26 -0600 From: Nathan Trapuzzano Date: Fri, 07 Sep 2012 20:43:23 -0400 Message-ID: <87627p4a50.fsf@nbtrap.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Identified-User: {1585:host393.hostmonster.com:nbtrapco:nbtrap.com} {sentby:smtp auth 99.40.62.116 authed with nbtrap@nbtrap.com} X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 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: -6.1 (------) --=-=-= Content-Type: text/plain The lispref info node on "Syntax Table Internals" uses "syntax code" interchangeably to refer to both the car of syntax table elements and the elements (cons cells) themselves. This is confusing, for example, because the function "syntax-class" throws a wrong-type-argument error if its argument is the bare integer syntax code instead of a cons cell. I propose the following minor changes: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=syntax.texi.patch Content-Description: Clarify the distinction between "syntax codes" and the cons cells that contain them diff --git a/doc/lispref/syntax.texi b/doc/lispref/syntax.texi index 91ae435..fa000c3 100644 --- a/doc/lispref/syntax.texi +++ b/doc/lispref/syntax.texi @@ -996,18 +996,20 @@ corresponding internal form, a cons cell @code{(@var{syntax-code} @end defun @defun syntax-after pos -This function returns the syntax code of the character in the buffer -after position @var{pos}, taking account of syntax properties as well -as the syntax table. If @var{pos} is outside the buffer's accessible -portion (@pxref{Narrowing, accessible portion}), this function returns +This function returns the syntax cons cell @code{(@var{syntax-code} +. @var{matching-char})} of the character in the buffer after position +@var{pos}, taking account of syntax properties as well as the syntax +table. If @var{pos} is outside the buffer's accessible portion +(@pxref{Narrowing, accessible portion}), this function returns @code{nil}. @end defun @defun syntax-class syntax -This function returns the syntax class of the syntax code +This function returns the syntax class of the syntax table entry @var{syntax}. (It masks off the high 16 bits that hold the flags -encoded in the syntax descriptor.) If @var{syntax} is @code{nil}, it -returns @code{nil}; this is so evaluating the expression +encoded in the syntax descriptor given by the car of @var{syntax}.) +If @var{syntax} is @code{nil}, it returns @code{nil}; this is so +evaluating the expression @example (syntax-class (syntax-after pos)) --=-=-=-- From unknown Sun Jun 22 07:44:48 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12383: [Patch] Clarify the distinction between "syntax codes" and the cons cells that contain them Resent-From: Chong Yidong Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Sep 2012 14:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12383 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Nathan Trapuzzano Cc: 12383@debbugs.gnu.org Received: via spool by 12383-submit@debbugs.gnu.org id=B12383.13471143508745 (code B ref 12383); Sat, 08 Sep 2012 14:26:02 +0000 Received: (at 12383) by debbugs.gnu.org; 8 Sep 2012 14:25:50 +0000 Received: from localhost ([127.0.0.1]:48673 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TALyn-0002H0-Oe for submit@debbugs.gnu.org; Sat, 08 Sep 2012 10:25:50 -0400 Received: from mail-iy0-f172.google.com ([209.85.210.172]:57338) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TALyk-0002Gs-FK for 12383@debbugs.gnu.org; Sat, 08 Sep 2012 10:25:47 -0400 Received: by iabz21 with SMTP id z21so472898iab.3 for <12383@debbugs.gnu.org>; Sat, 08 Sep 2012 07:25:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=Y1PkZ3jY9ASbkFh53y7/nevlGPPCGDOhSGk138EheeY=; b=uN4WHsJpLOHAviEPQ+ZqmMrFhJ1pE5GCNwiO/OUrTCQGv18Xqie/BE6ekLMkEYmZly bTIRDrqafCqcEAyI8GP4eIL0M6ipMgJG7s/UN0f8IWtCdb2YVIV5NdrOQ+ECKIG9Hnp+ 0pZLk+GXgscd02sHbwHB8NdE2fKhVbbu57SXo0AZjBpGQwA4aY+/74HtgTQx4vN1MIPA DJg4jLcwYDjNElqe2ndr6T9Phq9KTbG9IHnTzU5I1RT4MJSsI/R/IkCFxTll4G/m5owq aNBOnYK2ATwC9GE5C85+zCHaKCqiohMauskQlrCtkcApPcKUiCS0TJMu7FYsbvPWDkb2 RGdA== Received: by 10.50.15.133 with SMTP id x5mr1936824igc.26.1347114322103; Sat, 08 Sep 2012 07:25:22 -0700 (PDT) Received: from ulysses (cm162.gamma80.maxonline.com.sg. [202.156.80.162]) by mx.google.com with ESMTPS id hz10sm2868452igc.12.2012.09.08.07.25.17 (version=SSLv3 cipher=OTHER); Sat, 08 Sep 2012 07:25:20 -0700 (PDT) From: Chong Yidong References: <87627p4a50.fsf@nbtrap.com> Date: Sat, 08 Sep 2012 22:25:15 +0800 In-Reply-To: <87627p4a50.fsf@nbtrap.com> (Nathan Trapuzzano's message of "Fri, 07 Sep 2012 20:43:23 -0400") Message-ID: <87392soalw.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 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.6 (--) Nathan Trapuzzano writes: > The lispref info node on "Syntax Table Internals" uses "syntax code" > interchangeably to refer to both the car of syntax table elements and > the elements (cons cells) themselves. This is confusing, for example, > because the function "syntax-class" throws a wrong-type-argument error > if its argument is the bare integer syntax code instead of a cons > cell. I propose the following minor changes: Thank you for the suggestion. It is on the right track, but I think the fix needs to go further. We need a new terminology for the cons cells stored in the syntax table. I think a good name is "raw syntax descriptors", and I've amended the manual and docstrings accordingly. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 08 10:26:00 2012 Received: (at control) by debbugs.gnu.org; 8 Sep 2012 14:26:00 +0000 Received: from localhost ([127.0.0.1]:48677 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TALyy-0002HM-32 for submit@debbugs.gnu.org; Sat, 08 Sep 2012 10:26:00 -0400 Received: from mail-ie0-f172.google.com ([209.85.223.172]:44199) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TALyw-0002HG-Sc for control@debbugs.gnu.org; Sat, 08 Sep 2012 10:25:59 -0400 Received: by ieak13 with SMTP id k13so698519iea.3 for ; Sat, 08 Sep 2012 07:25:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:mime-version:content-type; bh=VBGxSgEmZLzxwLJoglyBe3hCOLyY+nhnZTdD4fOZAyk=; b=Js1bUDxc53tAaGsOD0qXh8gDS0Rm3qu4dl/++RIkJNzTrGfxw77odHtBiXfaBrjVNO 3WJWGTz7Ypmjbefqjy6W2H2Yq8XPAQbdHGqRd5K4N0V43Vqnz1h2PSHHSIQz5onpA8aA mPvkk5aGuZqH75Boq4KyBlk3WfxpTmijwhw0EydfdIvW4yCtVh7VBzetzhkxLtpK6YzY H+PIt/kXNTzJXHQ7sWc5SY7xlpAs0zRsKL6hct3QpCKUqKM8hL4xbDpsjOcFkzSaFvCZ wW74Agmu7Y5xz3ez9uTXcTyEWOOpLZLr6hntlIEVrROADwRdPsgmz/nRb2BI+OpI2DNJ 0huw== Received: by 10.50.89.227 with SMTP id br3mr1936308igb.74.1347114334792; Sat, 08 Sep 2012 07:25:34 -0700 (PDT) Received: from ulysses (cm162.gamma80.maxonline.com.sg. [202.156.80.162]) by mx.google.com with ESMTPS id ch4sm2916828igb.2.2012.09.08.07.25.32 (version=SSLv3 cipher=OTHER); Sat, 08 Sep 2012 07:25:33 -0700 (PDT) From: Chong Yidong To: control@debbugs.gnu.org Subject: close 12383 Date: Sat, 08 Sep 2012 22:25:30 +0800 Message-ID: <87txv8twv9.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 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.6 (--) close 12383 thanks