unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Behaviour of electric-pair-mode for single quotes
@ 2019-12-30 11:41 Pankaj Jangid
  2019-12-30 15:29 ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Pankaj Jangid @ 2019-12-30 11:41 UTC (permalink / raw)
  To: emacs-devel

Has the behaviour of electric-pair-mode changed for single quotes? I am
on emacs-27 (MacOS). And I have noticed that it is not working for
single quotes. If I remember correctly then it used to work for single
quotes.

Am I correct in my understanding?

If I am correct then I'll file a bug-report.

Regards
-- 
Pankaj Jangid





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Behaviour of electric-pair-mode for single quotes
  2019-12-30 11:41 Behaviour of electric-pair-mode for single quotes Pankaj Jangid
@ 2019-12-30 15:29 ` Eli Zaretskii
  2019-12-30 17:47   ` Pankaj Jangid
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2019-12-30 15:29 UTC (permalink / raw)
  To: Pankaj Jangid; +Cc: emacs-devel

> From: Pankaj Jangid <p4j@j4d.net>
> Date: Mon, 30 Dec 2019 11:41:49 +0000
> 
> Has the behaviour of electric-pair-mode changed for single quotes? I am
> on emacs-27 (MacOS). And I have noticed that it is not working for
> single quotes. If I remember correctly then it used to work for single
> quotes.

Seems to work for me, but you didn't show any steps to reproduce, so
maybe I didn't try what you did.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Behaviour of electric-pair-mode for single quotes
  2019-12-30 15:29 ` Eli Zaretskii
@ 2019-12-30 17:47   ` Pankaj Jangid
  2019-12-30 17:59     ` Noam Postavsky
  0 siblings, 1 reply; 5+ messages in thread
From: Pankaj Jangid @ 2019-12-30 17:47 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

>> Has the behaviour of electric-pair-mode changed for single quotes? I
>> am on emacs-27 (MacOS). And I have noticed that it is not working for
>> single quotes. If I remember correctly then it used to work for
>> single quotes.
>
> Seems to work for me, but you didn't show any steps to reproduce, so
> maybe I didn't try what you did.

Now I have tried it again in various modes. I just noticed that the
pairing doesn't work in some modes which obviously has good reasons.
It is not required in text-mode, message-mode, lisp-mode and may be
some other modes.

But in python-mode, there is a strange behaviour. Steps:

1. ./src/emacs -Q
2. open a temporary python file (or switch mode)
3. Following is the behaviour with keystrokes

Key Strokes    Output
'              '' <point before 2nd tick>
''             ''' <point before 3rd tick>
'''            '''''' <point before 4th tick>
''''           ''''''' <point before 5th tick>

Is this the expected behaviour?

Regards,
-- 
Pankaj Jangid



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Behaviour of electric-pair-mode for single quotes
  2019-12-30 17:47   ` Pankaj Jangid
@ 2019-12-30 17:59     ` Noam Postavsky
  2019-12-31 11:00       ` Pankaj Jangid
  0 siblings, 1 reply; 5+ messages in thread
From: Noam Postavsky @ 2019-12-30 17:59 UTC (permalink / raw)
  To: Pankaj Jangid; +Cc: Eli Zaretskii, Emacs developers

On Mon, 30 Dec 2019 at 12:47, Pankaj Jangid <p4j@j4d.net> wrote:

> But in python-mode, there is a strange behaviour. Steps:
>
> 1. ./src/emacs -Q
> 2. open a temporary python file (or switch mode)
> 3. Following is the behaviour with keystrokes
>
> Key Strokes    Output
> '              '' <point before 2nd tick>
> ''             ''' <point before 3rd tick>
> '''            '''''' <point before 4th tick>
> ''''           ''''''' <point before 5th tick>
>
> Is this the expected behaviour?

I think it's intentional, remember that python supports triple quotes
as a string delimiter. See longstring in
https://docs.python.org/3/reference/lexical_analysis.html#literals



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Behaviour of electric-pair-mode for single quotes
  2019-12-30 17:59     ` Noam Postavsky
@ 2019-12-31 11:00       ` Pankaj Jangid
  0 siblings, 0 replies; 5+ messages in thread
From: Pankaj Jangid @ 2019-12-31 11:00 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: Eli Zaretskii, Emacs developers

>>>>> Noam Postavsky <npostavs@gmail.com> writes:
>> But in python-mode, there is a strange behaviour. Steps:
>>
>> 1. ./src/emacs -Q
>> 2. open a temporary python file (or switch mode)
>> 3. Following is the behaviour with keystrokes
>>
>> Key Strokes    Output
>> '              '' <point before 2nd tick>
>> ''             ''' <point before 3rd tick>
>> '''            '''''' <point before 4th tick>
>> ''''           ''''''' <point before 5th tick>
>>
>> Is this the expected behaviour?
>
> I think it's intentional, remember that python supports triple quotes
> as a string delimiter. See longstring in
> https://docs.python.org/3/reference/lexical_analysis.html#literals

Understood that. But as I have specified above (look at 2nd and 4th
row), there is imbalance in the output; total odd number of
single-quotes in the output.



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-12-31 11:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-30 11:41 Behaviour of electric-pair-mode for single quotes Pankaj Jangid
2019-12-30 15:29 ` Eli Zaretskii
2019-12-30 17:47   ` Pankaj Jangid
2019-12-30 17:59     ` Noam Postavsky
2019-12-31 11:00       ` Pankaj Jangid

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).