From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#53260: char-syntax differs in interpreter and bytecode Date: Sat, 15 Jan 2022 18:29:41 +0100 Message-ID: <978B1D34-1F52-4B3E-B2E2-7ADA95155068@acm.org> References: <0A87E4BA-4741-4688-A005-912ABFC86B83@acm.org> <8735lpmm4f.fsf@gnus.org> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26336"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen , 53260@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 15 18:30:21 2022 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 1n8mse-0006gn-Sh for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 Jan 2022 18:30:20 +0100 Original-Received: from localhost ([::1]:46390 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8msd-0007uM-Ax for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 Jan 2022 12:30:19 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43312) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8msS-0007uC-S1 for bug-gnu-emacs@gnu.org; Sat, 15 Jan 2022 12:30:09 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48740) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n8msN-0006KI-Hd for bug-gnu-emacs@gnu.org; Sat, 15 Jan 2022 12:30:08 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n8msN-0008Oo-6T for bug-gnu-emacs@gnu.org; Sat, 15 Jan 2022 12:30:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Jan 2022 17:30:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53260 X-GNU-PR-Package: emacs Original-Received: via spool by 53260-submit@debbugs.gnu.org id=B53260.164226779632244 (code B ref 53260); Sat, 15 Jan 2022 17:30:03 +0000 Original-Received: (at 53260) by debbugs.gnu.org; 15 Jan 2022 17:29:56 +0000 Original-Received: from localhost ([127.0.0.1]:41643 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n8msG-0008O0-C0 for submit@debbugs.gnu.org; Sat, 15 Jan 2022 12:29:56 -0500 Original-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 ) id 1n8msC-0008Nj-Ol for 53260@debbugs.gnu.org; Sat, 15 Jan 2022 12:29:55 -0500 X-Authenticated-User: mattiase@bredband.net 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@acm.or Original-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 In-Reply-To: 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-Flags: 0 X-CTCH-ScoreCust: 0.000 X-Origin-Country: SE 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:224320 Archived-At: 15 jan. 2022 kl. 15.46 skrev Stefan Monnier : > 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.