From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs Subject: bug#43941: HTML+ mode: dangerous apostrophe after fullwidth parenthesis Date: Mon, 12 Oct 2020 23:26:15 +0200 Message-ID: <878scbyw3s.fsf@rub.de> References: <87pn5oq1hj.5.fsf@jidanni.org> <831ri34i0b.fsf@gnu.org> <87o8l7zdh6.fsf@rub.de> <83o8l731yd.fsf@gnu.org> <87h7qzzae2.fsf@rub.de> <83lfgb2yss.fsf@gnu.org> <87d01nz7gb.fsf@rub.de> <83blh72vlk.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5808"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 43941@debbugs.gnu.org, jidanni@jidanni.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 12 23:27:34 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 1kS5Lx-0001PT-PA for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 12 Oct 2020 23:27:33 +0200 Original-Received: from localhost ([::1]:52610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kS5Lw-0004Gd-L2 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 12 Oct 2020 17:27:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50110) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kS5LS-0004GJ-2p for bug-gnu-emacs@gnu.org; Mon, 12 Oct 2020 17:27:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60888) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kS5LR-0000k8-Q5 for bug-gnu-emacs@gnu.org; Mon, 12 Oct 2020 17:27:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kS5LR-0006X5-NH for bug-gnu-emacs@gnu.org; Mon, 12 Oct 2020 17:27:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 12 Oct 2020 21:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43941 X-GNU-PR-Package: emacs Original-Received: via spool by 43941-submit@debbugs.gnu.org id=B43941.160253799325077 (code B ref 43941); Mon, 12 Oct 2020 21:27:01 +0000 Original-Received: (at 43941) by debbugs.gnu.org; 12 Oct 2020 21:26:33 +0000 Original-Received: from localhost ([127.0.0.1]:44201 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kS5Kz-0006WO-0a for submit@debbugs.gnu.org; Mon, 12 Oct 2020 17:26:33 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:38391) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kS5Kx-0006WB-0y for 43941@debbugs.gnu.org; Mon, 12 Oct 2020 17:26:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1602537978; bh=oMPlN6GWDiaLT7lzonS2mjyFEtlqoq+0CMk5R+DAfHM=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=eebfHCGpBqb2773AaKsdfFbXrnVspmd/1jqo2l4Qlqay+c7jiYrzk8jRZBbGS2jbV s8JsJNPXrEqVRl60liqfZ6MDJeYD30Dvy535KaGTAV8lSt62VvywBKfrLm/YHNzPhH +ziO2K0LyaBLf02iAwPn8wJpsP/D2lZ9ZJRP6lMU= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from strobe-jhalfs ([188.109.168.129]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Msq6C-1kCTDu0vSS-00tDKd; Mon, 12 Oct 2020 23:26:18 +0200 In-Reply-To: <83blh72vlk.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 12 Oct 2020 20:38:15 +0300") X-Provags-ID: V03:K1:kt4aACJsPUM283aKmyf6UIli98/7DsMWK2eEaSESWI0oXAKsC5R hNfp014swLLpAVaPEBJdiWn5Pg7HAIrJKn0zjjyGHnDOwkZtlznxPa1+B+/tW4N55lV+ofp wkl++aMqLLAcQ5HjK3+NNSStH4blk0gStLTxEycrLydY8LiXhO+9Bjxss7nltU/OicfoWEm NJCtI6Ogfz2zhEsmKqZaA== X-UI-Out-Filterresults: notjunk:1;V03:K0:/78nakUoYbg=:51v3A+KLjRaHk7Tj8B3nKV 6sj8LCEdK+vTx+EJ63hN4tJJpJV5wEJtl/+UBZkztj82FylpJMKLXssyry3D98yscjTI3I/4+ FTtEqPxUqRisqamdOmWc6W65u3CF1yU44EcW/mbacLQg9e6Ud250FZKRb7BDt4RamlfcZBNGD lBrwN/oqhlhMoDisgoumAXavj/vvfNCW65pKWlRjZUkiQJKpTUnX3KBaXN4NIglhYaMx7mSpv Sv2vGeSWZRIhSy6mOhP7g/IXD97HtFJZOLaN/B+fKgC6kzSXbc/Za9UNE1u7P5DwMjKUZqXgm m7ZAJri5vvtEgNJoOiLKZT2tWho1CgqNPKMQS7eskVXN1lh6rVemyofEVguHT2zRqpSq5NubC /jUTT+yWkdw2yv61ldiF4feAEG9H1S83lD88RULXzDULk4lHZmybhck3XDEfXzEBRtBGxu5qr dVkoNus0pBXVMQtNaUOUsVS1QeJVFLj9b9ay9NytPmp7LhjLlmtpBCTs1HMz6Afb3Cy4DkAZ7 tzKmW3uLDUamBBaoOTRK1Vdv0nImszhbMNpL1OhqleTSw2BGtgvAM4Vf2yjFLbWVZxOip/Jf7 IVGa8vJsLtESoxGbVhgCC4SBgcEY6v+pD4rTMEPPYdNj2Gq1yTJR7CUqFM875SjOlBMmB9Pgt nQ4CIpDmdJq+MIyx/XJfjHvQsb1cXFqjMwVLfy3pT0jFMVBrvgKLpLvZoBVBi1cVHnnnX3lpR Lw7GbLaocVoiLLhC2nk7LRH/QKsz3r11g9XGxw+3Dq6g2v+q+pJIdxtE7YzZ3+AV/b/XAN7e 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:190362 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Mon, 12 Oct 2020 20:38:15 +0300 Eli Zaretskii wrote: >> From: Stephen Berman >> Cc: Stephen Berman , jidanni@jidanni.org, >> 43941@debbugs.gnu.org >> Date: Mon, 12 Oct 2020 19:21:08 +0200 >>=20 >> diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el >> index f3d8695e24..92a2215ed7 100644 >> --- a/lisp/textmodes/sgml-mode.el >> +++ b/lisp/textmodes/sgml-mode.el >> @@ -193,7 +193,7 @@ sgml-mode-syntax-table >>=20=20 >> (defconst sgml-tag-syntax-table >> (let ((table (sgml-make-syntax-table sgml-specials))) >> - (dolist (char '(?\( ?\) ?\{ ?\} ?\[ ?\] ?$ ?% ?& ?* ?+ ?/)) >> + (dolist (char '(?\( ?\) ?\{ ?\} ?\[ ?\] ?$ ?% ?& ?* ?+ ?/ ?=EF=BC= =88)) >> (modify-syntax-entry char "." table)) >> (unless (memq ?' sgml-specials) >> ;; Avoid that skipping a tag backwards skips any "'" prefixing it. >>=20 >> If this is the right approach, then all such characters would have to be >> added, or is there a better alternative? > > It shouldn't be hard to add to the list some of the characters that > have the paired bracket semantics, see uni-brackets.el. Some, but which? I used the following the code to add all the paired-bracket characters listed in that file: --=-=-= Content-Type: text/x-patch Content-Disposition: inline Content-Description: sgml-mode-syntax-table patch Content-Transfer-Encoding: quoted-printable diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index f3d8695e24..c2c3f61e3d 100644 =2D-- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -192,8 +192,20 @@ sgml-mode-syntax-table "Syntax table used in SGML mode. See also `sgml-specials'.") (defconst sgml-tag-syntax-table - (let ((table (sgml-make-syntax-table sgml-specials))) - (dolist (char '(?\( ?\) ?\{ ?\} ?\[ ?\] ?$ ?% ?& ?* ?+ ?/)) + (let ((table (sgml-make-syntax-table sgml-specials)) + brackets) + (setq brackets (delete-dups + (flatten-tree + (map-char-table + (lambda (key value) + (setq brackets (cons (list + (if (consp key) + (list (car key) (cdr key)) + key) + value) + brackets))) + (unicode-property-table-internal 'paired-bracket))))) + (dolist (char (append brackets (list ?$ ?% ?& ?* ?+ ?/))) (modify-syntax-entry char "." table)) (unless (memq ?' sgml-specials) ;; Avoid that skipping a tag backwards skips any "'" prefixing it. --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable But this fails to prevent the unwanted string face fontification. According to the above code, there are 120 different paired-bracket characters, so it will be time-consuming to isolate just the ones that work. > But some > SGML/HTML expert should say if that is TRT, indeed. Yes, hopefully before Someone=E2=84=A2 toils through the 120 characters. Steve Berman --=-=-=--