From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: How does one set up a syntax table for (* and //? Date: Wed, 11 Jan 2017 20:31:44 -0500 Message-ID: <18d576b9-fe12-c09a-32f9-ad0da86f2d27@gmail.com> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2XPWwDGIDftUF6JGQ3xHDnMCNQmn4GSor" X-Trace: blaine.gmane.org 1484184779 26520 195.159.176.226 (12 Jan 2017 01:32:59 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 12 Jan 2017 01:32:59 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 Cc: Emacs developers To: Noam Postavsky Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 12 02:32:55 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cRUFl-0004df-WC for ged-emacs-devel@m.gmane.org; Thu, 12 Jan 2017 02:32:34 +0100 Original-Received: from localhost ([::1]:58567 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRUFq-0000eH-HG for ged-emacs-devel@m.gmane.org; Wed, 11 Jan 2017 20:32:38 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40119) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRUFB-0000ZF-7D for emacs-devel@gnu.org; Wed, 11 Jan 2017 20:31:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cRUF7-0001pG-9o for emacs-devel@gnu.org; Wed, 11 Jan 2017 20:31:57 -0500 Original-Received: from mout.kundenserver.de ([212.227.126.131]:51237) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cRUF6-0001nz-Ue for emacs-devel@gnu.org; Wed, 11 Jan 2017 20:31:53 -0500 Original-Received: from [18.111.103.8] ([18.111.103.8]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.168]) with ESMTPSA (Nemesis) id 0LkGC3-1d2T0z1E9j-00cNhG; Thu, 12 Jan 2017 02:31:38 +0100 In-Reply-To: X-Provags-ID: V03:K0:ukbVApLl9cGFbvyIiqJomL96Sk/JlpAdGako1qlVeubCgVGyLhr CpcqLFQUinDfnu5/8vzLIwzjvREwlJZO3htd/q2tvq5OK/4tVwUHY+T9FpNIUQxGxsXQKt9 FuIjlEuH3id62EPUacR0/7BbTf7xCY3vuN6MzF+oEJPsbS7CGpajgiWz6pK6XNNjm1jl/r4 KdizQc7Xvop7YheLJN+OA== X-UI-Out-Filterresults: notjunk:1;V01:K0:JuTdstn4TFg=:gvbH42GaI80IaQASKIQteN g339D6jo50TT22LzJm3cRpwGOBK8P5QlQgJGf5ATBlic+0vbNs/Qpae58gcxPwbNhv0c3yD1q 4EowVP9oXEU048AwdhMcCPj736xDV33N4UclZoazvRrqtOto9rtrrfnd/mjemFBbEi5s6O8KP Qfz2iv6BJ6uwz+Rd3aXzEytSayw4cydvkdjFVwCfP5aMJUG13UszdhNVfxLpZiw4bqD6AcJLB 4MdnuL+JLCqiNgjGISU9UmgrXyAqMQ1vPYTSdtO3CtuniqsDuFWay+GXurS3af9RCPzmRzlLE LQ6ETd4zxd61hPy1PaLy3d22aGERNOUJiyTiv4KIud+ZugrXgViOK0H0Ly7rkxC0vjbFsltzV LqqOVQjVgJQ8tL74UZNeEO0+PJ8ZP7KwYukqPgtBDayCYNjrjUm+PB65Xmc8Kxzh0h7zoIBxI 30gI9CcESzk2Xr3BM5LoCuwmR21HmgxCeWeYhQY7eU/AZbAHS5P4TVOufIdfa3O+d1bOyoG7p mndYFD0K7MznvhQ8e4NEDZsJQXMJXiGxoX8tLNGhmRAgC/WGH9cSA4WOT+911Php4GFK7nQL2 uXiHAMf9rHZ/Q//0Mw4kGatVZIQR2KKL7+qNXo8j1zVePDMHUPX3Y2i7hCIAga0ub7JeswtKX s1kWpVKxWasV3wSKzGXJt3vP3eXAWEt3JDBrJXn5Q7PMVLVtI9a3F4Tp1borg4fkRY/k= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.131 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:211218 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --2XPWwDGIDftUF6JGQ3xHDnMCNQmn4GSor Content-Type: multipart/mixed; boundary="h2J5LeSO5tNxMSArRjp9pQMTmSnTiImio"; protected-headers="v1" From: =?UTF-8?Q?Cl=c3=a9ment_Pit--Claudel?= To: Noam Postavsky Cc: Emacs developers Message-ID: <18d576b9-fe12-c09a-32f9-ad0da86f2d27@gmail.com> Subject: Re: How does one set up a syntax table for (* and //? References: In-Reply-To: --h2J5LeSO5tNxMSArRjp9pQMTmSnTiImio Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2017-01-11 20:19, Noam Postavsky wrote: > On Wed, Jan 11, 2017 at 10:44 AM, Cl=C3=A9ment Pit--Claudel > wrote: >> >> As far as I can tell from the docs, the following syntax table should = recognize // =E2=80=A6 line comments and nestable (* =E2=80=A6 *) comment= s properly: >> >> (defvar example-syntax-table >> (let ((table (make-syntax-table))) >> (modify-syntax-entry ?* ". 23" table) >> (modify-syntax-entry ?/ ". 12c" table) >> (modify-syntax-entry ?\n "> c" table) >> (modify-syntax-entry ?\( "()1n" table) >> (modify-syntax-entry ?\) ")(4n" table) >> table)) > [...] >> In this example, the last line (=E2=80=9Cwhich incorrectly extends pas= t the newline?=E2=80=9D), is considered to be a comment, because the sequ= ence "(/" is treated as a multiline comment opener. >=20 > You don't want "a" style comment chars combining with "c" style > comment chars. Unfortunately, Emacs doesn't implement that. I think > you'll have to implement these kind of comments with a > syntax-propertize-function. Yeah, that's what I was afraid of. Is there code that depends on this (a mixing with c)? If not, could we co= nsider changing the semantics of "c" instead? This mixing isn't clear fro= m the documentation, AFAICT. I guess such a change would break the hypothetical situation in which one= would need to be able to say that a character is an opener for both "a" = and "c", but a closer for only "c", though. Cheers, Cl=C3=A9ment. --h2J5LeSO5tNxMSArRjp9pQMTmSnTiImio-- --2XPWwDGIDftUF6JGQ3xHDnMCNQmn4GSor Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYdtyGAAoJEPqg+cTm90wj40YP/RrjUqFIjpVkciLnAQl6kso9 ursocsHITqz/0dbA6DjPFt0Ibg3HNMHp4/APJWoftZ5WBC/BmxdVGxqMrdQObGdz qq71l+rNpoyJKKI0g6F007ecZ3VJo77TooXwnrzvGw+uv1z8eOq2giZpUpG75uvq 5rf7k81mQMVxQyYxhoNMZhRlPB76cXILvvbVIuEskTdoa/0WsMpJYI2nnvQY57uy 8yg+Jd+P3t2/gMAqnes5Nie16QQ6txv6muEOCJcjXg6BA688x5Ey9v+o6QbbQ12d APPzfn44SJR3VjfLCcX9n5GaRESqBX0Oy/3qhNTjepJNjIjs1ta/CQqDpgY76Ie0 xJSJzg0eID8GPJSaIgUAUmoj0VzTpN+VDUl3tgVvHVNd5fEzqd+CZavIdjLSa2qi Lhev1zjQjTrt6XvDRtwE0zI8NAi2bdRofRCe0E8CN7YjqhJE9nGJhlqI6WiBMAwe L38K+1frv3gWysiO//9KW9daQQDHjBj+QGjK2gHVyzfNRomlT1h+6T5AwLs7S2hN kvrc1lztJX+yo0llGUI0vpzXhzC5K2JTZq3ATLtA65WILztjdXnCb+XkVLpE3HW9 jrjMWsgXaxcHdT3iTCj3vYSMAsrDiMj7UtplClPE6n5Ea8rcc9HjQg3MuV/QWFWB 5XinR9PrBc4uUgyJiG11 =Kyd5 -----END PGP SIGNATURE----- --2XPWwDGIDftUF6JGQ3xHDnMCNQmn4GSor--