unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Gustavo Barros <gusbrs.2016@gmail.com>
To: "João Távora" <joaotavora@gmail.com>
Cc: 36307@debbugs.gnu.org
Subject: bug#36307: 26.2; Interaction between electric-pair and electric-quote
Date: Mon, 19 Apr 2021 16:55:42 -0300	[thread overview]
Message-ID: <87pmyqf3r5.fsf@gmail.com> (raw)
In-Reply-To: <CALDnm52dm=RwaT1u3EBXSFnH_riVXjfR1Qy8eeZ2+5P9abKEMQ@mail.gmail.com>

Hi João,

On Mon, 19 Apr 2021 at 16:16, João Távora <joaotavora@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.






  reply	other threads:[~2021-04-19 19:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-20 13:20 bug#36307: 26.2; Interaction between electric-pair and electric-quote Gustavo Barros
2019-06-26 17:37 ` Gustavo Barros
2019-09-18 20:26   ` Gustavo Barros
2021-04-19 15:53     ` Gustavo Barros
2021-04-19 19:12       ` João Távora
2021-04-19 19:16         ` João Távora
2021-04-19 19:55           ` Gustavo Barros [this message]
2021-10-19  9:35         ` Gustavo Barros

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=87pmyqf3r5.fsf@gmail.com \
    --to=gusbrs.2016@gmail.com \
    --cc=36307@debbugs.gnu.org \
    --cc=joaotavora@gmail.com \
    /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).