unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stephen Berman <stephen.berman@gmx.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Stephen Berman <stephen.berman@gmx.net>,
	43941@debbugs.gnu.org, jidanni@jidanni.org
Subject: bug#43941: HTML+ mode: dangerous apostrophe after fullwidth parenthesis
Date: Mon, 12 Oct 2020 19:21:08 +0200	[thread overview]
Message-ID: <87d01nz7gb.fsf@rub.de> (raw)
In-Reply-To: <83lfgb2yss.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 12 Oct 2020 19:29:07 +0300")

[-- Attachment #1: Type: text/plain, Size: 1039 bytes --]

On Mon, 12 Oct 2020 19:29:07 +0300 Eli Zaretskii <eliz@gnu.org> wrote:

>> From: Stephen Berman <stephen.berman@gmx.net>
>> Cc: Stephen Berman <stephen.berman@gmx.net>,  jidanni@jidanni.org,
>>   43941@debbugs.gnu.org
>> Date: Mon, 12 Oct 2020 18:17:41 +0200
>> 
>> >> But the face does not change if `(' is used instead of `(', e.g. copy
>> >> the following two lines into a buffer and type `M-x html-mode' (or `M-x
>> >> mhtml-mode', the face change appears in both):
>> >
>> > So which of them is a bug?
>> 
>> In the context of the OP it seems clear that string face is wrong.  So
>> in my simpler example, that means the display of the second line
>> containing FULLWIDTH LEFT PARENTHESIS is buggy.
>
> Do the ASCII parentheses have some syntactic significance in this
> context, then?  If not, why do the parentheses affect the meaning of
> the apostrophe?

It seems they do have some syntactic significance, since the following
patch prevents string face in the examples with FULLWIDTH LEFT
PARENTHESIS:


[-- Attachment #2: sgml-mode.el patch --]
[-- Type: text/x-patch, Size: 614 bytes --]

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
 
 (defconst sgml-tag-syntax-table
   (let ((table (sgml-make-syntax-table sgml-specials)))
-    (dolist (char '(?\( ?\) ?\{ ?\} ?\[ ?\] ?$ ?% ?& ?* ?+ ?/))
+    (dolist (char '(?\( ?\) ?\{ ?\} ?\[ ?\] ?$ ?% ?& ?* ?+ ?/ ?())
       (modify-syntax-entry char "." table))
     (unless (memq ?' sgml-specials)
       ;; Avoid that skipping a tag backwards skips any "'" prefixing it.

[-- Attachment #3: Type: text/plain, Size: 129 bytes --]


If this is the right approach, then all such characters would have to be
added, or is there a better alternative?

Steve Berman

  reply	other threads:[~2020-10-12 17:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-11 14:30 bug#43941: HTML+ mode: dangerous apostrophe after fullwidth parenthesis 積丹尼 Dan Jacobson
2020-10-12 14:48 ` Eli Zaretskii
2020-10-12 14:52   ` 積丹尼 Dan Jacobson
2020-10-12 15:11   ` Stephen Berman
2020-10-12 15:20     ` Eli Zaretskii
2020-10-12 16:17       ` Stephen Berman
2020-10-12 16:29         ` Eli Zaretskii
2020-10-12 17:21           ` Stephen Berman [this message]
2020-10-12 17:38             ` Eli Zaretskii
2020-10-12 21:26               ` Stephen Berman
2020-10-13 10:37                 ` Stephen Berman
2021-06-13 12:21                   ` bug#43941: bug#40844: html mode sometimes fooled by apostrophe Lars Ingebrigtsen
2021-06-13 18:14                     ` Stephen Berman
2021-06-14 13:00                       ` bug#43941: bug#46312: HTML+ mode vs. quotes Lars Ingebrigtsen
2021-06-14 13:02                         ` bug#40844: " Eli Zaretskii
2021-06-14 13:52                         ` Stephen Berman
2021-06-14 13:58                           ` bug#43941: " Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d01nz7gb.fsf@rub.de \
    --to=stephen.berman@gmx.net \
    --cc=43941@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=jidanni@jidanni.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).