unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#31155: 26.1; electric-pair-mode sometimes inserts extra ) in process buffers
@ 2018-04-14 21:06 Alex Branham
  2018-04-14 21:13 ` Noam Postavsky
  2018-04-22 18:24 ` Charles A. Roelli
  0 siblings, 2 replies; 9+ messages in thread
From: Alex Branham @ 2018-04-14 21:06 UTC (permalink / raw)
  To: 31155

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





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

* bug#31155: 26.1; electric-pair-mode sometimes inserts extra ) in process buffers
  2018-04-14 21:06 bug#31155: 26.1; electric-pair-mode sometimes inserts extra ) in process buffers Alex Branham
@ 2018-04-14 21:13 ` Noam Postavsky
  2018-04-14 21:17   ` Alex Branham
  2018-04-22 18:24 ` Charles A. Roelli
  1 sibling, 1 reply; 9+ messages in thread
From: Noam Postavsky @ 2018-04-14 21:13 UTC (permalink / raw)
  To: Alex Branham; +Cc: 31155

Alex Branham <alex.branham@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())






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

* bug#31155: 26.1; electric-pair-mode sometimes inserts extra ) in process buffers
  2018-04-14 21:13 ` Noam Postavsky
@ 2018-04-14 21:17   ` Alex Branham
  2018-04-19  1:12     ` Noam Postavsky
  0 siblings, 1 reply; 9+ messages in thread
From: Alex Branham @ 2018-04-14 21:17 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 31155


On Sat 14 Apr 2018 at 16:13, Noam Postavsky <npostavs@gmail.com> wrote:

> Alex Branham <alex.branham@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





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

* bug#31155: 26.1; electric-pair-mode sometimes inserts extra ) in process buffers
  2018-04-14 21:17   ` Alex Branham
@ 2018-04-19  1:12     ` Noam Postavsky
  2018-04-23 14:39       ` Alex Branham
  0 siblings, 1 reply; 9+ messages in thread
From: Noam Postavsky @ 2018-04-19  1:12 UTC (permalink / raw)
  To: Alex Branham; +Cc: 31155

tags 31155 + moreinfo
quit

Alex Branham <alex.branham@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.





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

* bug#31155: 26.1; electric-pair-mode sometimes inserts extra ) in process buffers
  2018-04-14 21:06 bug#31155: 26.1; electric-pair-mode sometimes inserts extra ) in process buffers Alex Branham
  2018-04-14 21:13 ` Noam Postavsky
@ 2018-04-22 18:24 ` Charles A. Roelli
  1 sibling, 0 replies; 9+ messages in thread
From: Charles A. Roelli @ 2018-04-22 18:24 UTC (permalink / raw)
  To: Alex Branham; +Cc: 31155

> From: Alex Branham <alex.branham@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).





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

* bug#31155: 26.1; electric-pair-mode sometimes inserts extra ) in process buffers
  2018-04-19  1:12     ` Noam Postavsky
@ 2018-04-23 14:39       ` Alex Branham
  2018-04-23 23:23         ` Noam Postavsky
  0 siblings, 1 reply; 9+ messages in thread
From: Alex Branham @ 2018-04-23 14:39 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 31155


On Wed 18 Apr 2018 at 20:12, Noam Postavsky <npostavs@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.





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

* bug#31155: 26.1; electric-pair-mode sometimes inserts extra ) in process buffers
  2018-04-23 14:39       ` Alex Branham
@ 2018-04-23 23:23         ` Noam Postavsky
  2018-04-26 16:08           ` Alex Branham
  0 siblings, 1 reply; 9+ messages in thread
From: Noam Postavsky @ 2018-04-23 23:23 UTC (permalink / raw)
  To: Alex Branham; +Cc: 31155

Alex Branham <alex.branham@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))





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

* bug#31155: 26.1; electric-pair-mode sometimes inserts extra ) in process buffers
  2018-04-23 23:23         ` Noam Postavsky
@ 2018-04-26 16:08           ` Alex Branham
  2019-09-26 19:31             ` Lars Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Alex Branham @ 2018-04-26 16:08 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 31155


On Mon 23 Apr 2018 at 18:23, Noam Postavsky <npostavs@gmail.com> wrote:

> Alex Branham <alex.branham@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.





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

* bug#31155: 26.1; electric-pair-mode sometimes inserts extra ) in process buffers
  2018-04-26 16:08           ` Alex Branham
@ 2019-09-26 19:31             ` Lars Ingebrigtsen
  0 siblings, 0 replies; 9+ messages in thread
From: Lars Ingebrigtsen @ 2019-09-26 19:31 UTC (permalink / raw)
  To: Alex Branham; +Cc: 31155, Noam Postavsky

Alex Branham <alex.branham@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





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

end of thread, other threads:[~2019-09-26 19:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-14 21:06 bug#31155: 26.1; electric-pair-mode sometimes inserts extra ) in process buffers Alex Branham
2018-04-14 21:13 ` Noam Postavsky
2018-04-14 21:17   ` Alex Branham
2018-04-19  1:12     ` Noam Postavsky
2018-04-23 14:39       ` Alex Branham
2018-04-23 23:23         ` Noam Postavsky
2018-04-26 16:08           ` Alex Branham
2019-09-26 19:31             ` Lars Ingebrigtsen
2018-04-22 18:24 ` Charles A. Roelli

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