[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#49518: 28.0.50; electric-pair-mode skip-self fails for single-quotes
From: |
Stephen Berman |
Subject: |
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 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
On Sat, 10 Jul 2021 18:32:34 -0700 Jim Porter <jporterbugs@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