Subject: bug#49518: 28.0.50; electric-pair-mode skip-self fails for single-quotes in python-mode

From: Jim Porter <[email-masked]>
Date: Sun, 11 Jul 2021 10:34:19 -0700

On Sun, Jul 11, 2021 at 1:11 AM Stephen Berman <[email-masked]> wrote:
>
> One thing that's kinda nice about the current behavior of typing
> single-quote in python-mode is that if you type it three times in a row
> you get '''|''', so it's ready for typing a multiple string.  This
> doesn't happen with double-quote, and after setting
> electric-pair-text-syntax-table to python-mode-syntax-table it doesn't
> happen any more with single-quote.

That's true, and I've been working on a patch to make that behavior
more robust. The code for that is in
`python-electric-pair-string-delimiter', but I think an improved
implementation of that would depend on how this bug is fixed. I have a
local patch that works for me, but it depends on the other
electric-pair settings I use, so it couldn't merge as-is.

In particular, it would need to take into account the various possible
settings for `electric-pair-skip-self', since with that set to nil,
I'd generally expect `python-electric-pair-string-delimiter' to be a
no-op (we should already have three quote characters after point, so
no need to insert more).