Subject: Re: bug#37938: electric-pair-mode vs. U+0027 APOSTROPHE in mixed modes like HTML

From: Lars Ingebrigtsen <[email-masked]>
Date: Tue, 29 Oct 2019 12:54:15 +0100

積丹尼 Dan Jacobson <[email-masked]> writes:

>>>>>> "LI" == Lars Ingebrigtsen <[email-masked]> writes:
>
> LI> Anybody know what's that about?
>
> In emacs-version "26.3" I get Foo'', no error.
>
> LI> I'm not quite sure, but I think Dan is saying that the ' character
> LI> shouldn't be a paired character in html-mode since it isn't in
> LI> text-mode.  And that sounds reasonable.  Does anybody object to making
> LI> that change?
>
> Sounds good.

I know nothing about electric pair mode, but it seems that the behaviour
is down to the syntax class of the ' character.

(elt (syntax-table) ?\')
=> (7 . 39)

And

7              string quote           15             generic string

which makes sense, because you can have

<a foo='bar'>

and in that context it's definitely a quote character.  But when you're
typing text in HTML, then it's not.

mhtml already has support for different syntaxes in CSS/JS/HTML -- is
there a way to switch the syntax table when in tags and when not?

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