GNU bug report logs - #36307
26.2; Interaction between electric-pair and electric-quote

Previous Next

Package: emacs;

Reported by: Gustavo Barros <gusbrs.2016 <at> gmail.com>

Date: Thu, 20 Jun 2019 13:21:02 UTC

Severity: minor

Merged with 36309

Found in version 26.2

Full log


View this message in rfc822 format

From: Gustavo Barros <gusbrs.2016 <at> gmail.com>
To: João Távora <joaotavora <at> gmail.com>
Cc: 36307 <at> debbugs.gnu.org
Subject: bug#36307: 26.2; Interaction between electric-pair and electric-quote
Date: Mon, 19 Apr 2021 16:55:42 -0300
Hi João,

On Mon, 19 Apr 2021 at 16:16, João Távora <joaotavora <at> gmail.com> wrote:

> After reading your issue in diagonal, it seems it's to do with
> electric-quote-mode and electric-pair-mode.  I wrote the latter
> mostly, but I didn't write the former, which I think is only for
> UTF-8 quotes.  I personally turn it off.  I don't think it respects
> the auto-balancing ideas I put into electric-pair-mode.
>
> (if that's even what you're asking about, I still haven't read and
> processed all your text).
>

Thanks for answering.

Yes, the TL;DR is: `electric-pair-mode' ignores 
`electric-pair-inhibit-predicate' and 
`electric-pair-skip-whitespace-function' when the input character is not 
of syntax class `(?\( ?\" ?\$)'.

This indeed affects `electric-quote-mode', thought the problem is in 
`electric-pair-mode' and should be dealt with there since the check 
happens in `electric-pair-post-self-insert-function' which runs after 
`electric-quote-mode's post-self-insert-function.  As a matter of fact, 
the reproduction example in the full report shows a case where 
`electric-pair-mode' fails for this reason by itself, without 
`electric-quote-mode'.  The case is `text-mode' where "\"" is of syntax 
class punctuation (not string), so that the pairing is never inhibited.

And I'm fine with whatever is your timing for this.  I had been living 
with half measures for a couple of years now, and now that I understood 
the problem better I could come up with a better local workaround (no 
good for a proper fix, unfortunately).  I really just reported back 
because it would be nice if this was fixed upstream.

Best regards,
Gustavo.

PS: I wrote in the report:

> What I failed to get when I originally reported is that, given the 
> depths set at each of these modes' hooks, 
> `electric-indent-post-self-insert-function' runs before 
> `electric-pair-post-self-insert-function'.

And I meant "`electric-quote-post-self-insert-function' runs before 
`electric-pair-post-self-insert-function'".  It was a copy-paste 
mistake, `electric-indent-mode' is out of the picture here altogether.





This bug report was last modified 3 years and 244 days ago.

Previous Next


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