GNU bug report logs - #31155
26.1; electric-pair-mode sometimes inserts extra ) in process buffers

Previous Next

Package: emacs;

Reported by: Alex Branham <alex.branham <at> gmail.com>

Date: Sat, 14 Apr 2018 21:06:01 UTC

Severity: normal

Tags: moreinfo

Found in version 26.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 31155 in the body.
You can then email your comments to 31155 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#31155; Package emacs. (Sat, 14 Apr 2018 21:06:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alex Branham <alex.branham <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 14 Apr 2018 21:06:02 GMT) Full text and rfc822 format available.

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

From: Alex Branham <alex.branham <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.1; electric-pair-mode sometimes inserts extra ) in process buffers
Date: Sat, 14 Apr 2018 16:06:30 -0500
In buffers running processes (e.g. M-x run-python or M-x R if you have
ESS), electric-pair-mode sometimes (but not always) inserts ) instead of
closing the paren pairing. So typing exit() occasionally results in
exit())

I can't figure out how to reliably reproduce this.

In GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2018-04-11 built on mars
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000

Configured using:
 'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --mandir=/usr/share/man --with-gameuser=:games
 --with-sound=alsa --with-modules --without-gconf --without-gsettings
 --with-mailutils --with-xml2 --with-x-toolkit=lucid --with-xft
 --with-xaw3d --with-imagemagick 'CFLAGS=-march=x86-64 -mtune=generic
 -O2 -pipe -fstack-protector-strong -fno-plt'
 CPPFLAGS=-D_FORTIFY_SOURCE=2
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'

Configured features:
XAW3D XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS NOTIFY ACL
GNUTLS LIBXML2 FREETYPE LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS LUCID X11
MODULES THREADS LIBSYSTEMD LCMS2

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Python

Minor modes in effect:
  anaconda-eldoc-mode: t
  anaconda-mode: t
  electric-operator-mode: t
  magit-auto-revert-mode: t
  global-git-commit-mode: t
  shell-command-with-editor-mode: t
  company-mode: t
  ws-butler-mode: t
  global-diff-hl-mode: t
  diff-hl-mode: t
  diff-auto-refine-mode: t
  global-aggressive-indent-mode: t
  pdf-occur-global-minor-mode: t
  which-key-mode: t
  helm-mode: t
  flyspell-mode: t
  minions-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  winum-mode: t
  save-place-mode: t
  projectile-mode: t
  show-paren-mode: t
  async-bytecomp-package-mode: t
  dired-async-mode: t
  flymake-mode: t
  shell-dirtrack-mode: t
  electric-pair-mode: t
  delete-selection-mode: t
  global-auto-revert-mode: t
  auto-revert-mode: t
  auto-insert-mode: t
  auto-compile-on-load-mode: t
  auto-compile-on-save-mode: t
  override-global-mode: t
  cl-old-struct-compat-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  global-prettify-symbols-mode: t
  prettify-symbols-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  global-visual-line-mode: t
  visual-line-mode: t
  transient-mark-mode: t




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31155; Package emacs. (Sat, 14 Apr 2018 21:15:01 GMT) Full text and rfc822 format available.

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

From: Noam Postavsky <npostavs <at> gmail.com>
To: Alex Branham <alex.branham <at> gmail.com>
Cc: 31155 <at> debbugs.gnu.org
Subject: Re: bug#31155: 26.1;
 electric-pair-mode sometimes inserts extra ) in process buffers
Date: Sat, 14 Apr 2018 17:13:57 -0400
Alex Branham <alex.branham <at> gmail.com> writes:

> In buffers running processes (e.g. M-x run-python or M-x R if you have
> ESS), electric-pair-mode sometimes (but not always) inserts ) instead of
> closing the paren pairing. So typing exit() occasionally results in
> exit())
>
> I can't figure out how to reliably reproduce this.

I can reproduce by executing python code that prints an unmatched open
paren:

>>> print ("(")
(
>>> exit())





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31155; Package emacs. (Sat, 14 Apr 2018 21:17:02 GMT) Full text and rfc822 format available.

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

From: Alex Branham <alex.branham <at> gmail.com>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: 31155 <at> debbugs.gnu.org
Subject: Re: bug#31155: 26.1;
 electric-pair-mode sometimes inserts extra ) in process buffers
Date: Sat, 14 Apr 2018 16:17:43 -0500
On Sat 14 Apr 2018 at 16:13, Noam Postavsky <npostavs <at> gmail.com> wrote:

> Alex Branham <alex.branham <at> gmail.com> writes:
>
>> In buffers running processes (e.g. M-x run-python or M-x R if you have
>> ESS), electric-pair-mode sometimes (but not always) inserts ) instead of
>> closing the paren pairing. So typing exit() occasionally results in
>> exit())
>>
>> I can't figure out how to reliably reproduce this.
>
> I can reproduce by executing python code that prints an unmatched open
> paren:
>
>>>> print ("(")
> (
>>>> exit())

That might be part of the problem, but this also happens sometimes even
when I've just started R. R prints out a little message when it starts,
but doesn't have unmatched parens.

Thanks,
Alex




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31155; Package emacs. (Thu, 19 Apr 2018 01:13:02 GMT) Full text and rfc822 format available.

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

From: Noam Postavsky <npostavs <at> gmail.com>
To: Alex Branham <alex.branham <at> gmail.com>
Cc: 31155 <at> debbugs.gnu.org
Subject: Re: bug#31155: 26.1;
 electric-pair-mode sometimes inserts extra ) in process buffers
Date: Wed, 18 Apr 2018 21:12:23 -0400
tags 31155 + moreinfo
quit

Alex Branham <alex.branham <at> gmail.com> writes:

> That might be part of the problem, but this also happens sometimes even
> when I've just started R. R prints out a little message when it starts,
> but doesn't have unmatched parens.

Hmm, maybe add some tracing to narrow down the problem a bit?

    (dolist (fun '(electric-pair--balance-info
                   electric-pair-skip-if-helps-balance
                   electric-pair-syntax-info
                   electric-pair-default-skip-self))
      (trace-function-background fun))

Then take a look at the *trace-output* buffer after you manage to
reproduce the problem.




Added tag(s) moreinfo. Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 19 Apr 2018 01:13:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31155; Package emacs. (Sun, 22 Apr 2018 18:25:02 GMT) Full text and rfc822 format available.

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

From: charles <at> aurox.ch (Charles A. Roelli)
To: Alex Branham <alex.branham <at> gmail.com>
Cc: 31155 <at> debbugs.gnu.org
Subject: Re: bug#31155: 26.1;
 electric-pair-mode sometimes inserts extra ) in process buffers
Date: Sun, 22 Apr 2018 20:24:44 +0200
> From: Alex Branham <alex.branham <at> gmail.com>
> Date: Sat, 14 Apr 2018 16:06:30 -0500
> 
> In buffers running processes (e.g. M-x run-python or M-x R if you have
> ESS), electric-pair-mode sometimes (but not always) inserts ) instead of
> closing the paren pairing. So typing exit() occasionally results in
> exit())
> 
> I can't figure out how to reliably reproduce this.
> 
> In GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
>  of 2018-04-11 built on mars
> Windowing system distributor 'The X.Org Foundation', version 11.0.11906000

I've also seen this with PDB (via M-x pdb).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31155; Package emacs. (Mon, 23 Apr 2018 14:39:01 GMT) Full text and rfc822 format available.

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

From: Alex Branham <alex.branham <at> gmail.com>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: 31155 <at> debbugs.gnu.org
Subject: Re: bug#31155: 26.1;
 electric-pair-mode sometimes inserts extra ) in process buffers
Date: Mon, 23 Apr 2018 09:39:39 -0500
On Wed 18 Apr 2018 at 20:12, Noam Postavsky <npostavs <at> gmail.com> wrote:

> Hmm, maybe add some tracing to narrow down the problem a bit?
>
>     (dolist (fun '(electric-pair--balance-info
>                    electric-pair-skip-if-helps-balance
>                    electric-pair-syntax-info
>                    electric-pair-default-skip-self))
>       (trace-function-background fun))
>
> Then take a look at the *trace-output* buffer after you manage to
> reproduce the problem.

Sorry for taking so long to respond, it is difficult to capture this
happening. I finally managed to this morning, though. Here's the last
few lines of the *trace-output* buffer:

======================================================================
1 -> (electric-pair-syntax-info 91)
1 <- electric-pair-syntax-info: (40 93 nil 79153)
======================================================================
1 -> (electric-pair-syntax-info 91)
1 <- electric-pair-syntax-info: (40 93 nil 79153)
======================================================================
1 -> (electric-pair--balance-info 1 79153)
1 <- electric-pair--balance-info: ((t) t)
======================================================================
1 -> (electric-pair-syntax-info 93)
1 <- electric-pair-syntax-info: (41 91 nil 79153)
======================================================================
1 -> (electric-pair-syntax-info 91)
1 <- electric-pair-syntax-info: (40 93 nil 79153)
======================================================================
1 -> (electric-pair-syntax-info 91)
1 <- electric-pair-syntax-info: (40 93 nil 79153)
======================================================================
1 -> (electric-pair--balance-info 1 79153)
1 <- electric-pair--balance-info: ((nil . 93) nil . 93)

This happened when I typed (in an inferior R buffer):

Rhats[[

What showed up:

Rhats[[]

What should've shown up:

Rhats[[]]

Let me know if there's anything else I can do.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31155; Package emacs. (Mon, 23 Apr 2018 23:24:01 GMT) Full text and rfc822 format available.

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

From: Noam Postavsky <npostavs <at> gmail.com>
To: Alex Branham <alex.branham <at> gmail.com>
Cc: 31155 <at> debbugs.gnu.org
Subject: Re: bug#31155: 26.1;
 electric-pair-mode sometimes inserts extra ) in process buffers
Date: Mon, 23 Apr 2018 19:23:15 -0400
Alex Branham <alex.branham <at> gmail.com> writes:

> Sorry for taking so long to respond, it is difficult to capture this
> happening.

No worries, it takes as long as it takes.

> 1 -> (electric-pair-syntax-info 91)
> 1 <- electric-pair-syntax-info: (40 93 nil 79153)
> ======================================================================
> 1 -> (electric-pair--balance-info 1 79153)
> 1 <- electric-pair--balance-info: ((nil . 93) nil . 93)

> This happened when I typed (in an inferior R buffer):
>
> Rhats[[

Ah, this is a slightly different scenario than I thought, we're missing
close brackets, rather than inserting too many.  The
electric-pair--balance-info seems to be saying that you're inside a
string or comment.  Was that the case?  Or was there a stray quote in
the buffer?

Anyway, I think tracing a few more functions will be helpful:

    (dolist (fun '(electric-pair--balance-info
                   electric-pair-skip-if-helps-balance
                   electric-pair-inhibit-if-helps-balance
                   electric-pair-syntax-info
                   electric-pair-default-inhibit
                   electric-pair-default-skip-self
                   electric-pair-post-self-insert-function))
      (trace-function-background fun))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31155; Package emacs. (Thu, 26 Apr 2018 16:09:02 GMT) Full text and rfc822 format available.

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

From: Alex Branham <alex.branham <at> gmail.com>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: 31155 <at> debbugs.gnu.org
Subject: Re: bug#31155: 26.1;
 electric-pair-mode sometimes inserts extra ) in process buffers
Date: Thu, 26 Apr 2018 11:08:38 -0500
On Mon 23 Apr 2018 at 18:23, Noam Postavsky <npostavs <at> gmail.com> wrote:

> Alex Branham <alex.branham <at> gmail.com> writes:
>
>> Sorry for taking so long to respond, it is difficult to capture this
>> happening.
>
> No worries, it takes as long as it takes.
>
>> 1 -> (electric-pair-syntax-info 91)
>> 1 <- electric-pair-syntax-info: (40 93 nil 79153)
>> ======================================================================
>> 1 -> (electric-pair--balance-info 1 79153)
>> 1 <- electric-pair--balance-info: ((nil . 93) nil . 93)
>
>> This happened when I typed (in an inferior R buffer):
>>
>> Rhats[[
>
> Ah, this is a slightly different scenario than I thought, we're missing
> close brackets, rather than inserting too many.  The
> electric-pair--balance-info seems to be saying that you're inside a
> string or comment.  Was that the case?  Or was there a stray quote in
> the buffer?

Sorry, I wasn't clear. This was slightly different behavior than what I
previously reported, though I assume it's related. I was not inside a
string or comment, and there could have been a stray quote in the
buffer. I'm not sure though as I didn't save it (will do in the
future!).

> Anyway, I think tracing a few more functions will be helpful:
>
>     (dolist (fun '(electric-pair--balance-info
>                    electric-pair-skip-if-helps-balance
>                    electric-pair-inhibit-if-helps-balance
>                    electric-pair-syntax-info
>                    electric-pair-default-inhibit
>                    electric-pair-default-skip-self
>                    electric-pair-post-self-insert-function))
>       (trace-function-background fun))

I'll do that next time I stumble into this.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31155; Package emacs. (Thu, 26 Sep 2019 19:32:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Alex Branham <alex.branham <at> gmail.com>
Cc: 31155 <at> debbugs.gnu.org, Noam Postavsky <npostavs <at> gmail.com>
Subject: Re: bug#31155: 26.1; electric-pair-mode sometimes inserts extra )
 in process buffers
Date: Thu, 26 Sep 2019 21:31:12 +0200
Alex Branham <alex.branham <at> gmail.com> writes:

>> Anyway, I think tracing a few more functions will be helpful:
>>
>>     (dolist (fun '(electric-pair--balance-info
>>                    electric-pair-skip-if-helps-balance
>>                    electric-pair-inhibit-if-helps-balance
>>                    electric-pair-syntax-info
>>                    electric-pair-default-inhibit
>>                    electric-pair-default-skip-self
>>                    electric-pair-post-self-insert-function))
>>       (trace-function-background fun))
>
> I'll do that next time I stumble into this.

More information was requested, but no response was given within a
year, so I'm closing this bug report.  If the problem still exists,
please reopen this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 31155 <at> debbugs.gnu.org and Alex Branham <alex.branham <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 26 Sep 2019 19:32:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 25 Oct 2019 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 184 days ago.

Previous Next


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