From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#43558: [PATCH]: Fix (forward-comment 1) when end delimiter is escaped. Date: Sun, 22 Nov 2020 23:34:18 +0200 Message-ID: <00dc580c-3b48-c185-9020-2cb2b7528884@yandex.ru> References: <20200924102022.GA4714@ACM> <20201119211822.GE6259@ACM> <20201122131231.GB5912@ACM> <20201122170830.GD5912@ACM> <20201122181957.GF5912@ACM> <73ccc858-dd03-248f-4b89-5679a8f3cd63@yandex.ru> <20201122211353.GH5912@ACM> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39799"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 Cc: 43558@debbugs.gnu.org, Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , Stefan Monnier To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 22 22:35:12 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kgx0o-000ADh-Cm for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 22 Nov 2020 22:35:10 +0100 Original-Received: from localhost ([::1]:58366 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kgx0n-0002Lj-Dj for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 22 Nov 2020 16:35:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55776) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kgx0g-0002LW-Cs for bug-gnu-emacs@gnu.org; Sun, 22 Nov 2020 16:35:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36905) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kgx0g-0003j9-5l for bug-gnu-emacs@gnu.org; Sun, 22 Nov 2020 16:35:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kgx0g-0008RL-3L for bug-gnu-emacs@gnu.org; Sun, 22 Nov 2020 16:35:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 22 Nov 2020 21:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43558 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 43558-submit@debbugs.gnu.org id=B43558.160608086832395 (code B ref 43558); Sun, 22 Nov 2020 21:35:02 +0000 Original-Received: (at 43558) by debbugs.gnu.org; 22 Nov 2020 21:34:28 +0000 Original-Received: from localhost ([127.0.0.1]:48451 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kgx08-0008QR-Hj for submit@debbugs.gnu.org; Sun, 22 Nov 2020 16:34:28 -0500 Original-Received: from mail-wr1-f53.google.com ([209.85.221.53]:33416) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kgx06-0008QE-KK for 43558@debbugs.gnu.org; Sun, 22 Nov 2020 16:34:27 -0500 Original-Received: by mail-wr1-f53.google.com with SMTP id u12so16753252wrt.0 for <43558@debbugs.gnu.org>; Sun, 22 Nov 2020 13:34:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=tf+9oNtewtx/+lYIaYbUJ6/iZjePgKkjZD+iiqNCwJE=; b=OagKYC/9Fl+cnZgVamPqQp3dSSYOVPFXOAQvrdKO2hIx8aREXl4m2Tl8tovas6Wx+i wCXpZu4knowryR5mqf65GhmSr7pjq+9M1zV1SUAXPfbUmtjPUfcOfkHOTSJLFaJQ+6ZL odReZc4YzPLwayY965JeRvADq/mjzhVj+7hVhA8WEKAbWu94/4r9TTnCnJ9UIEpOP+CM e1XGt8reaT/RV6wF98vb5NE61qQvlLGU7z+LWnRVt/pSoo3CKcGv5lJ86Xmc3CFzW92w NLyV/NYVcPPsEmiE2urCHJlAUZKFdc9PkRRe1fl6XChXvpUvGzCsJ4GdNFpPD4DPGRiW j3vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=tf+9oNtewtx/+lYIaYbUJ6/iZjePgKkjZD+iiqNCwJE=; b=oENin2USK/kQdvAKSWWFEb0kC0s6XZoblQoJrptpx0vHitpB9J1DGszat3HGzikm5Z Ss3TeGifwy9oOs+YxgrpnAV9lhdHa63Yv69gLGA/wR0iZv6olI3cBP4Z6MxmVfhwD5W2 k22x6ik20VpfD3RQHTWdLAepyRLXhs3n9skXu83YM7FRqVcoyTWmkj7GDbsQluh2gC5p BdJMc3JTKqeAsKepfitS3L/iuDSrEfsVEg/A4Oc4/QWdDlMcPigAz2yTmpLAV69R+3YK s+BaFjUF2Rt5qwa2Z5isPglLFE+53iqYCLh7C+ym0XeEjuLsWWaBRgqbGqR9C1TusI94 AzKw== X-Gm-Message-State: AOAM532PLBlZAokiT1uS7va60l+JYLxs4BPSBY8e9sigU22zqB/W7SvM METb1eAljvEhZOhXUKaqN6Y= X-Google-Smtp-Source: ABdhPJwVtePl3N5DChTD3utR6Y69qUiEH0ysFzt8NXxc0JcJu4zLNdlrso/HMrxJz6sV7s6uKD8l3A== X-Received: by 2002:adf:eacb:: with SMTP id o11mr27907412wrn.208.1606080860668; Sun, 22 Nov 2020 13:34:20 -0800 (PST) Original-Received: from [192.168.0.4] ([66.205.71.3]) by smtp.googlemail.com with ESMTPSA id m3sm16210739wrv.6.2020.11.22.13.34.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 22 Nov 2020 13:34:19 -0800 (PST) In-Reply-To: <20201122211353.GH5912@ACM> Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:193880 Archived-At: Hi Alan, On 22.11.2020 23:13, Alan Mackenzie wrote: > Coding up the Ruby block comments in syntax.c would involve string > comparisons, for example, and would be an entirely new flavour inside > that file. It would involve examining individual letters rather than > just their syntax. It could be made to support a new syntax using a finite state machine, something like that. And the strings could be converted to such by the major mode. But you're right, it would be more difficult. > By contrast, coding up the escaped NL in syntax.c was straightforward and > natural. > > Have you looked at the patch? Yup. It's not terrible, but it's still a bunch of new if/elses that one would need to grasp to maintain that code. >>> Presumably ruby-mode handles these with syntax-table text properties >>> applied to the = sign and the terminating d, which is a little clumsy, >>> but not too bad, at the Lisp level. > >> This is just two more regexps to search for (and propertize). I don't >> expect that the slowdown from them is in any way perceptible. > >> And the general point is that the Emacs syntax table structure doesn't >> necessarily have to mirror the syntax of the C language. > > Maybe not, but the point remains, that for this fix, a fix at the C level > is objectively better than a fix at the Lisp level. Furthermore, the C > level change is already implemented and has been well tested. Why is it objectively better? With user experience (speed, latencies, etc) being equal or within the margin of error, I think it's more logical to go with simpler data structures and low level APIs. Finally, as I recall you feel strongly about supporting older Emacs versions, a significant number of them. Doing that fix in Lisp would allow you to fix the bug for those versions too. Not just Emacs 28+.