GNU bug report logs - #53260
char-syntax differs in interpreter and bytecode

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Mattias Engdegård <mattiase@HIDDEN>; dated Fri, 14 Jan 2022 16:44:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 53260 <at> debbugs.gnu.org:


Received: (at 53260) by debbugs.gnu.org; 15 Jan 2022 17:29:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 15 12:29:56 2022
Received: from localhost ([127.0.0.1]:41643 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1n8msG-0008O0-C0
	for submit <at> debbugs.gnu.org; Sat, 15 Jan 2022 12:29:56 -0500
Received: from mail1450c50.megamailservers.eu ([91.136.14.50]:52520
 helo=mail265c50.megamailservers.eu)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattiase@HIDDEN>) id 1n8msC-0008Nj-Ol
 for 53260 <at> debbugs.gnu.org; Sat, 15 Jan 2022 12:29:55 -0500
X-Authenticated-User: mattiase@HIDDEN
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu;
 s=maildub; t=1642267785;
 bh=4J+jkEMHIslKO91n4EwKmB209GcdjcaXAB4VGcCh58w=;
 h=Subject:From:In-Reply-To:Date:Cc:References:To:From;
 b=gYOCv8zcIVwoeESNl3e9ZcZiq54sZZ4FOSXjb9IQ5UOA/zMmDLk5rdN0RRql1zqNI
 UB7pXTUSngTm47/dkiDyEeXpa2qyE83dFWm3E9VGVuBGljNE6cA2NqV64sF0WaB+nq
 9/Owptqx+Keo+akXWpLvJ1eMrWS4hA9VEb+yrGWA=
Feedback-ID: mattiase@HIDDEN
Received: from smtpclient.apple (c188-150-171-71.bredband.tele2.se
 [188.150.171.71]) (authenticated bits=0)
 by mail265c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 20FHTgVw002298; 
 Sat, 15 Jan 2022 17:29:44 +0000
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\))
Subject: Re: bug#53260: char-syntax differs in interpreter and bytecode
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>
In-Reply-To: <jwvee59kqoh.fsf-monnier+emacs@HIDDEN>
Date: Sat, 15 Jan 2022 18:29:41 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <978B1D34-1F52-4B3E-B2E2-7ADA95155068@HIDDEN>
References: <0A87E4BA-4741-4688-A005-912ABFC86B83@HIDDEN>
 <8735lpmm4f.fsf@HIDDEN> <jwvee59kqoh.fsf-monnier+emacs@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
X-Mailer: Apple Mail (2.3654.120.0.1.13)
X-CTCH-RefID: str=0001.0A742F24.61E30489.001C, ss=1, re=0.000, recu=0.000,
 reip=0.000, cl=1, cld=1, fgs=0
X-CTCH-VOD: Unknown
X-CTCH-Spam: Unknown
X-CTCH-Score: 0.000
X-CTCH-Rules: 
X-CTCH-Flags: 0
X-CTCH-ScoreCust: 0.000
X-Origin-Country: SE
X-Spam-Score: 1.4 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  15 jan. 2022 kl. 15.46 skrev Stefan Monnier <monnier@HIDDEN>:
    > If you’re trying to determine the syntax of characters in the buffer,
    > this is probably the wrong function to use, because it can’t take > ‘syntax-table’
    text properties into account. Consi [...] 
 
 Content analysis details:   (1.4 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  1.0 SPF_SOFTFAIL           SPF: sender does not match SPF record (softfail)
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
  0.4 KHOP_HELO_FCRDNS       Relay HELO differs from its IP's reverse DNS
X-Debbugs-Envelope-To: 53260
Cc: Lars Ingebrigtsen <larsi@HIDDEN>, 53260 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

15 jan. 2022 kl. 15.46 skrev Stefan Monnier <monnier@HIDDEN>:

>    If you=E2=80=99re trying to determine the syntax of characters in =
the buffer,
>    this is probably the wrong function to use, because it can=E2=80=99t =
take
>    =E2=80=98syntax-table=E2=80=99 text properties into account.  =
Consider using
>    =E2=80=98syntax-after=E2=80=99 instead.
>=20
> The "can't" is because `char-syntax` doesn't know where the char comes =
from.

This is true and it leaves a narrower use for `char-syntax` in =
mode-specific code -- ie, when syntax-table text properties do not need =
to be taken into account.

I propose we do the following:

1. Remove SETUP_BUFFER_SYNTAX_TABLE() from Fchar_syntax because as far =
as I can tell it has no effect at all.

2. Remove make_char_multibyte(c) from Bchar_syntax because it seems to =
be the wrong thing to do: in a unibyte buffer, wouldn't the syntax table =
be indexed by byte value (so that char 255 in the buffer corresponds to =
entry 255 in the syntax table rather than entry 0x3fffff)?

3. Now both implementations are identical. Replace the one in the =
byte-code interpreter with a call to Fchar_syntax.

> I think he meant "rare" w.r.t dynamic count rather than static count.

Yes, that's right.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#53260; Package emacs. Full text available.

Message received at 53260 <at> debbugs.gnu.org:


Received: (at 53260) by debbugs.gnu.org; 15 Jan 2022 14:46:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 15 09:46:41 2022
Received: from localhost ([127.0.0.1]:39602 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1n8kKH-0003ME-Lm
	for submit <at> debbugs.gnu.org; Sat, 15 Jan 2022 09:46:41 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:29744)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1n8kKE-0003Lx-Uj
 for 53260 <at> debbugs.gnu.org; Sat, 15 Jan 2022 09:46:40 -0500
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id BA767440CB2;
 Sat, 15 Jan 2022 09:46:32 -0500 (EST)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 5DCF0440C89;
 Sat, 15 Jan 2022 09:46:31 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1642257991;
 bh=yXyo3veV8B+Ukq7PiACYOu6IEcQPDV0pRHezAB2AKrg=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=RD4Vyqn+hlhdTkTAm2J0wbi4NXsJGid6zmdCztXgXtCECimgLehGgRegjKs0zQ01U
 FhZDuQ6BIZQdsdX3sTdT/bEG0jitagWiGNzlzMhsTvVf7CLQFlljyAEUxoOfzOGGNP
 Lk5Ok4X/xTt3mL4EYojd6JJziWcMwZVrv8Gxq20atJvb4/cvgmNX5l8UkAj0H40/XX
 vFfuFXLi054UKms5q0VsRsBAg/KblnrXs13HGib2CxJ+2BIESD7nV9GdSPgYeSvslv
 GMMXyKdSMbdOvpPtMDpWdbxeEARrLPzEZ1RbtOpx3c5DVcl48IoGOxnoHhROMARQZR
 Tqrbl4QGwJZLw==
Received: from pastel (unknown [216.154.30.173])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 1E335120403;
 Sat, 15 Jan 2022 09:46:31 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#53260: char-syntax differs in interpreter and bytecode
Message-ID: <jwvee59kqoh.fsf-monnier+emacs@HIDDEN>
References: <0A87E4BA-4741-4688-A005-912ABFC86B83@HIDDEN>
 <8735lpmm4f.fsf@HIDDEN>
Date: Sat, 15 Jan 2022 09:46:30 -0500
In-Reply-To: <8735lpmm4f.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Sat,
 15 Jan 2022 09:36:16 +0100")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.542 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 53260
Cc: Mattias =?windows-1252?Q?Engdeg=E5rd?= <mattiase@HIDDEN>,
 53260 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Lars Ingebrigtsen [2022-01-15 09:36:16] wrote:
> Mattias Engdeg=C3=A5rd <mattiase@HIDDEN> writes:
>> Fchar_syntax and the bytecode Bchar_syntax differ:
>> Fchar_syntax calls SETUP_BUFFER_SYNTAX_TABLE. Bchar_syntax does not.
>> Bchar_syntax converts arguments to multibyte.  Fchar_syntax does not.
> [...]
>> And, most importantly, what would be the correct code?
> Hm.  Perhaps Stefan has an opinion; added to the CCs.

My past opinion is in its docstring:

    If you=E2=80=99re trying to determine the syntax of characters in the b=
uffer,
    this is probably the wrong function to use, because it can=E2=80=99t ta=
ke
    =E2=80=98syntax-table=E2=80=99 text properties into account.  Consider =
using
    =E2=80=98syntax-after=E2=80=99 instead.

The "can't" is because `char-syntax` doesn't know where the char comes from.

>> (I suppose char-syntax is rare enough that we could call Fchar_syntax
>> from Bchar_syntax and thus avoid any future divergence.)
> Used 172 times in-core, which isn't that rare...

I think he meant "rare" w.r.t dynamic count rather than static count.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#53260; Package emacs. Full text available.

Message received at 53260 <at> debbugs.gnu.org:


Received: (at 53260) by debbugs.gnu.org; 15 Jan 2022 08:36:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 15 03:36:30 2022
Received: from localhost ([127.0.0.1]:38938 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1n8eY1-0008D2-VE
	for submit <at> debbugs.gnu.org; Sat, 15 Jan 2022 03:36:30 -0500
Received: from quimby.gnus.org ([95.216.78.240]:46536)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1n8eXz-0008Ck-K5
 for 53260 <at> debbugs.gnu.org; Sat, 15 Jan 2022 03:36:28 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID
 :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=Qaeis2wTkA2khsynrrk8h3unvSr0Y0Ehe7Rzh2Er+4Q=; b=ApvArmraYjrj6J/MzYNvTSg2b5
 qhuk+ETfq1H6EK+d79iTwCEWpe5Ma4PbqAMBqXVJra2R/p8LPPyYvpjRdYBf6RnBcpXVFyqAQDnS9
 9HM0tSR+chyLjqGjruqGObRvNkzADfXW7Nu1TJ9ManZAK+hhbM+xDEtMUuqI5KdAD/08=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1n8eXp-0002eg-L3; Sat, 15 Jan 2022 09:36:20 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= <mattiase@HIDDEN>
Subject: Re: bug#53260: char-syntax differs in interpreter and bytecode
References: <0A87E4BA-4741-4688-A005-912ABFC86B83@HIDDEN>
X-Now-Playing: Joni Mitchell's _Archives: The Early Years (3)_: "I Don't
 Know Where I Stand"
Date: Sat, 15 Jan 2022 09:36:16 +0100
In-Reply-To: <0A87E4BA-4741-4688-A005-912ABFC86B83@HIDDEN> ("Mattias
 =?utf-8?Q?Engdeg=C3=A5rd=22's?= message of "Fri, 14 Jan 2022 17:43:00
 +0100")
Message-ID: <8735lpmm4f.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 
 Content preview:  Mattias Engdegård <mattiase@HIDDEN> writes: > Fchar_syntax
    and the bytecode Bchar_syntax differ: > > Fchar_syntax calls SETUP_BUFFER_SYNTAX_TABLE.
    Bchar_syntax does not. > Bchar_syntax converts arguments to multibyte. Fchar_syntax
    does not. 
 
 Content analysis details:   (-2.9 points, 5.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
                             [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 53260
Cc: 53260 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Mattias Engdeg=C3=A5rd <mattiase@HIDDEN> writes:

> Fchar_syntax and the bytecode Bchar_syntax differ:
>
> Fchar_syntax calls SETUP_BUFFER_SYNTAX_TABLE. Bchar_syntax does not.
> Bchar_syntax converts arguments to multibyte. Fchar_syntax does not.

[...]

> And, most importantly, what would be the correct code?

Hm.  Perhaps Stefan has an opinion; added to the CCs.

> (I suppose char-syntax is rare enough that we could call Fchar_syntax
> from Bchar_syntax and thus avoid any future divergence.)

Used 172 times in-core, which isn't that rare...

--=20
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#53260; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 14 Jan 2022 16:43:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 14 11:43:13 2022
Received: from localhost ([127.0.0.1]:37958 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1n8PfV-0006BD-Lg
	for submit <at> debbugs.gnu.org; Fri, 14 Jan 2022 11:43:13 -0500
Received: from lists.gnu.org ([209.51.188.17]:36318)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattiase@HIDDEN>) id 1n8PfS-0006B1-9v
 for submit <at> debbugs.gnu.org; Fri, 14 Jan 2022 11:43:12 -0500
Received: from eggs.gnu.org ([209.51.188.92]:58720)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <mattiase@HIDDEN>) id 1n8PfR-0008Qq-GU
 for bug-gnu-emacs@HIDDEN; Fri, 14 Jan 2022 11:43:09 -0500
Received: from mail235c50.megamailservers.eu ([91.136.10.245]:59376
 helo=mail56c50.megamailservers.eu)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <mattiase@HIDDEN>) id 1n8PfP-0003sk-1U
 for bug-gnu-emacs@HIDDEN; Fri, 14 Jan 2022 11:43:09 -0500
X-Authenticated-User: mattiase@HIDDEN
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu;
 s=maildub; t=1642178583;
 bh=fLUw87GwKJG8MqLQfRlIzucolAC4C36rpdLbKEz848I=;
 h=From:Subject:Date:To:From;
 b=J14XSLmm91HH3qzroj/Ye51bvtC880sl8q8ROr8bQ+/h01y1h+CTQNouC/Zet0IM+
 Oc0OUKlJ+Bgs3maSvz+tMapZdnYlQM4zlBxdVsKNzj8oHn2NAzWbR4TbYOIBj7C5ig
 IjR0nsxtrg/If5256AyuH6nwwxivQ769+arp63Qw=
Feedback-ID: mattiase@HIDDEN
Received: from smtpclient.apple (c188-150-171-71.bredband.tele2.se
 [188.150.171.71]) (authenticated bits=0)
 by mail56c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 20EGh1Li023455
 for <bug-gnu-emacs@HIDDEN>; Fri, 14 Jan 2022 16:43:03 +0000
From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= <mattiase@HIDDEN>
Content-Type: text/plain;
	charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\))
Subject: char-syntax differs in interpreter and bytecode
Message-Id: <0A87E4BA-4741-4688-A005-912ABFC86B83@HIDDEN>
Date: Fri, 14 Jan 2022 17:43:00 +0100
To: bug-gnu-emacs@HIDDEN
X-Mailer: Apple Mail (2.3654.120.0.1.13)
X-CTCH-RefID: str=0001.0A742F27.61E1A817.003E, ss=1, re=0.000, recu=0.000,
 reip=0.000, cl=1, cld=1, fgs=0
X-CTCH-VOD: Unknown
X-CTCH-Spam: Unknown
X-CTCH-Score: 0.000
X-CTCH-Rules: 
X-CTCH-Flags: 0
X-CTCH-ScoreCust: 0.000
X-Origin-Country: SE
Received-SPF: softfail client-ip=91.136.10.245; envelope-from=mattiase@HIDDEN;
 helo=mail56c50.megamailservers.eu
X-Spam_score_int: -11
X-Spam_score: -1.2
X-Spam_bar: -
X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, SPF_HELO_NONE=0.001,
 SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

Fchar_syntax and the bytecode Bchar_syntax differ:

Fchar_syntax calls SETUP_BUFFER_SYNTAX_TABLE. Bchar_syntax does not.
Bchar_syntax converts arguments to multibyte. Fchar_syntax does not.

The last property can be used to get different behaviour:

(let ((cs (byte-compile (lambda (x) (char-syntax x)))))
  (with-temp-buffer
    (let ((st (make-syntax-table)))
      (set-buffer-multibyte nil)
      (modify-syntax-entry 128 "_" st)
      (set-syntax-table st)
      (list (funcall cs 128) (char-syntax 128)))))
-> (119 95)

Not sure how to expose the presence or absence of =
SETUP_BUFFER_SYNTAX_TABLE. Suggestions?

And, most importantly, what would be the correct code?

(I suppose char-syntax is rare enough that we could call Fchar_syntax =
from Bchar_syntax and thus avoid any future divergence.)





Acknowledgement sent to Mattias Engdegård <mattiase@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#53260; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 15 Jan 2022 17:45:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.