From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.devel Subject: Re: How does one set up a syntax table for (* and //? Date: Wed, 11 Jan 2017 20:19:52 -0500 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1484184007 25991 195.159.176.226 (12 Jan 2017 01:20:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 12 Jan 2017 01:20:07 +0000 (UTC) Cc: Emacs developers To: =?UTF-8?B?Q2zDqW1lbnQgUGl0LS1DbGF1ZGVs?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 12 02:20:00 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 1cRU3Z-0005t4-HD for ged-emacs-devel@m.gmane.org; Thu, 12 Jan 2017 02:19:57 +0100 Original-Received: from localhost ([::1]:58526 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRU3d-00029Y-To for ged-emacs-devel@m.gmane.org; Wed, 11 Jan 2017 20:20:01 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35817) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRU3W-00029H-VL for emacs-devel@gnu.org; Wed, 11 Jan 2017 20:19:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cRU3W-0006ay-6M for emacs-devel@gnu.org; Wed, 11 Jan 2017 20:19:54 -0500 Original-Received: from mail-oi0-x22c.google.com ([2607:f8b0:4003:c06::22c]:33538) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cRU3W-0006al-14 for emacs-devel@gnu.org; Wed, 11 Jan 2017 20:19:54 -0500 Original-Received: by mail-oi0-x22c.google.com with SMTP id w204so6713360oiw.0 for ; Wed, 11 Jan 2017 17:19:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=vya7b/xrzP9gCqG9td/YyY71yg4zwXPJligtVLn3hxM=; b=QYLLOqJZItf46GFg+n72X/hHS38AMiyuGan2MmVxO+/T0qjNHruNXDeNsRAEeoeKOC LxRozsxCixlKYR4tnrSN5pWdC+KkqY0wQ0Xuc4NnsvsP/t6lEyc2Zk2rjNkOz2xX9SnV vdrEDM8RjF+RoC0cA7EMm1yWoDgkcQN3va6/1JMtRz/p1vPyuQHBg7Z7FP0/Gm5/0wCi kjGtnMnm7QKt2C5DGdbwNN0S9EiM1Gpq89v8gABjXFbm0NByNdSi8VD+Bo+YJsufTWMC u9wqSp0gppDxATYYL70gen9sEzTkZfSaRD3OnfVkKvzOzUR2yS2DKsA9qSJQSFkqEjIH LbmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=vya7b/xrzP9gCqG9td/YyY71yg4zwXPJligtVLn3hxM=; b=boMt0iOiCt3gxOkGIbBqX8+KTLgYGPVskFzeyg6nW0LDwSvOeyshAHyL5osGs99l0A FmO2pnPrSRiip0qpsH7Qm94T4Kg3Ruh68vsVmhjnAKGEq7mBX125pGZ0/UjhLqJp/Tzq 1ahoBIdh7j4q2RIhSO3SZripCiOCjtJ2UI1AsMNHcAIvdb6CQ8hX8Wqjd7/U3WQxAMKg eZXoowy6hiYYTgH93OX4QxxAT90WETAbbYYO/0gGmkrGufKxLs3nA9WHgWboYuUNWgEB Dtbi0dUkCPgZdwfvXkWY1hZV6kg16lEnPBft/Tu3AXJnKRuQgQARj/8xoE8xh9bkp6av gGOg== X-Gm-Message-State: AIkVDXJrX6IwRNcA1C0WOAYbvMf0CPag07DNrrSQDGv47nYfMOikAGERzmA0zffE+FD4j6lshnjYcI9HMXLsrg== X-Received: by 10.157.58.119 with SMTP id j110mr5429441otc.208.1484183993303; Wed, 11 Jan 2017 17:19:53 -0800 (PST) Original-Received: by 10.157.21.117 with HTTP; Wed, 11 Jan 2017 17:19:52 -0800 (PST) In-Reply-To: X-Google-Sender-Auth: acbgTLWQuOKmnhWVydq8UsWUru8 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4003:c06::22c 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:211217 Archived-At: 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 rec= ognize // =E2=80=A6 line comments and nestable (* =E2=80=A6 *) comments pro= perly: > > (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 past t= he newline?=E2=80=9D), is considered to be a comment, because the sequence = "(/" is treated as a multiline comment opener. 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.