GNU bug report logs - #49518
28.0.50; electric-pair-mode skip-self fails for single-quotes in python-mode

Previous Next

Package: emacs;

Reported by: Jim Porter <jporterbugs <at> gmail.com>

Date: Sun, 11 Jul 2021 01:33:01 UTC

Severity: normal

Found in version 28.0.50

Done: João Távora <joaotavora <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Stephen Berman <stephen.berman <at> gmx.net>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: 49518 <at> debbugs.gnu.org
Subject: Re: bug#49518: 28.0.50; electric-pair-mode skip-self fails for
 single-quotes in python-mode
Date: Sun, 11 Jul 2021 10:11:20 +0200
On Sat, 10 Jul 2021 18:32:34 -0700 Jim Porter <jporterbugs <at> gmail.com> wrote:

> To reproduce this issue:
>
>   1.  emacs -Q --eval '(electric-pair-mode)' foo.py
>   2a. Type " (double-quote); result should be "|", where | is the point
>   2b. Type " (double-quote); result should be ""|
>       (Note: This is the correct behavior, as I understand it.)
>   3.  Delete everything (optional)
>   4a. Type ' (single-quote); result should be '|'
>   4b. Type ' (single-quote); result is ''|', but (I think) it should be ''|
[...]
> One possible fix would be for `python-mode' to locally set
> `electric-pair-text-syntax-table' to `python-mode-syntax-table'. This
> seems to work for me after some basic testing, but I'm not confident
> it's the right thing to do here; I don't see any examples of other
> modes that do this, and I haven't thought over all the possible
> problems with it.

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.

Steve Berman




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

Previous Next


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