GNU bug report logs - #37938
electric-pair-mode vs. U+0027 APOSTROPHE in mixed modes like HTML

Previous Next

Package: emacs;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Sun, 27 Oct 2019 03:23:02 UTC

Severity: minor

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: bug-gnu-emacs <at> gnu.org
Subject: electric-pair-mode vs. U+0027 APOSTROPHE in mixed modes like HTML
Date: Sun, 27 Oct 2019 08:14:15 +0800
No wonder my web pages are getting filled with:

Let's go to Bob's house.''

But my email replies are thankfully still just:

Let's go to Bob's house.

Compare typing that into

$ emacs -nw -Q -f electric-pair-mode /tmp/e.html vs.
$ emacs -nw -Q -f electric-pair-mode /tmp/e.txt

Anyway, sure, within HTML angle brackets we want the automatic paring
for attributes. But most of the time we are typing content... So the
program is not smart enough.

Neither electric-pair-mode's docsrting nor (info "(emacs) Matching")
mention how to tell it 'hands off' for .html modes like it already knows
for .txt modes.

Anyways, these days you've got to double check what you typed. (And then
sometimes with some programs even then you can't be sure...)

(The back apostrophe(s) "hides" in the block cursor, so the user doesn't
realize it, getting shoved along, parked behind the newline.)

My testing shows the problem only occurs with U+0027 APOSTROPHE. All the
other pairs act great. (E.g., a welcomed paired U+0022 QUOTATION MARK in
all modes.)

So, U+0027 APOSTROPHE currently doesn't pair in text mode. Good. It should
also not pair in HTML mode. Or at least the documentation should say...

emacs-version "26.3"




This bug report was last modified 5 years and 233 days ago.

Previous Next


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