unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#36067: 27.0.50; Edebug leaves undefined RET in minibuffer
@ 2019-06-03  2:20 Michael Heerdegen
  2019-06-21 10:14 ` Noam Postavsky
  2024-04-21  4:24 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 2 replies; 10+ messages in thread
From: Michael Heerdegen @ 2019-06-03  2:20 UTC (permalink / raw)
  To: 36067


Hi,

sorry, no recipe.  Quite often when I have used edebug, I think often I
killed the session by going to top-level (q), normal RET in the
minibuffer doesn't work any more.  Hitting the key RET does nothing.  I
have to restart Emacs (I need to close it with the mouse or something
like that).

I have no clue why this happens.  Dunno if it is my fault.  Anyone else
seeing this?


Thanks,

Michael.


In GNU Emacs 27.0.50 (build 19, x86_64-pc-linux-gnu, GTK+ Version 3.24.5)
 of 2019-06-03 built on drachen
Repository revision: ae7e0657b20037eb386aa21a35f05bcb4c283611
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12003000
System Description: Debian GNU/Linux 10 (buster)





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

* bug#36067: 27.0.50; Edebug leaves undefined RET in minibuffer
  2019-06-03  2:20 bug#36067: 27.0.50; Edebug leaves undefined RET in minibuffer Michael Heerdegen
@ 2019-06-21 10:14 ` Noam Postavsky
  2019-06-21 14:59   ` Michael Heerdegen
  2019-06-21 15:14   ` Eric Abrahamsen
  2024-04-21  4:24 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 2 replies; 10+ messages in thread
From: Noam Postavsky @ 2019-06-21 10:14 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 36067

tags 36067 + unreproducible
quit

Michael Heerdegen <michael_heerdegen@web.de> writes:

> sorry, no recipe.  Quite often when I have used edebug, I think often I
> killed the session by going to top-level (q), normal RET in the
> minibuffer doesn't work any more.  Hitting the key RET does nothing.  I
> have to restart Emacs (I need to close it with the mouse or something
> like that).

Do you mean that you're stuck in the minibuffer too?  Or just that the
minibuffer becomes non-functional, while other normal typing still
works.

> I have no clue why this happens.  Dunno if it is my fault.  Anyone else
> seeing this?

Don't think I've ever seen that before.  I know the 'transient' package
(which magit now uses for its popup UI), can have a bad interaction with
edebug when trying to debug its code.  I think it's due to how it messes
with transient keymaps in post/pre comman hooks.  Maybe you have
something similar happen here?





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

* bug#36067: 27.0.50; Edebug leaves undefined RET in minibuffer
  2019-06-21 10:14 ` Noam Postavsky
@ 2019-06-21 14:59   ` Michael Heerdegen
  2019-07-09  2:08     ` Michael Heerdegen
  2019-06-21 15:14   ` Eric Abrahamsen
  1 sibling, 1 reply; 10+ messages in thread
From: Michael Heerdegen @ 2019-06-21 14:59 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 36067

Noam Postavsky <npostavs@gmail.com> writes:

> > sorry, no recipe.  Quite often when I have used edebug, I think often I
> > killed the session by going to top-level (q), normal RET in the
> > minibuffer doesn't work any more.  Hitting the key RET does nothing.  I
> > have to restart Emacs (I need to close it with the mouse or something
> > like that).
>
> Do you mean that you're stuck in the minibuffer too?  Or just that the
> minibuffer becomes non-functional, while other normal typing still
> works.

The latter.  I'm not stuck in the minibuffer.  RET not working in the
minibuffer is actually the only symptom.

> > I have no clue why this happens.  Dunno if it is my fault.  Anyone else
> > seeing this?
>
> Don't think I've ever seen that before.  I know the 'transient' package
> (which magit now uses for its popup UI), can have a bad interaction with
> edebug when trying to debug its code.  I think it's due to how it messes
> with transient keymaps in post/pre comman hooks.  Maybe you have
> something similar happen here?

I'll try to find out when I see this the next time.  I tried in the past
but gave up since it was APITA without working minibuffers.

The reason why I created the bug report was that I saw the issue quite
often, while edebugging quite different things.  I hadn't the feeling
that it was specific to the debugged code.  Could still be just Helm
interfering with Edebug or something like that, yes.  Hope I can find
out the next time.

Thanks so far,

Michael.






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

* bug#36067: 27.0.50; Edebug leaves undefined RET in minibuffer
  2019-06-21 10:14 ` Noam Postavsky
  2019-06-21 14:59   ` Michael Heerdegen
@ 2019-06-21 15:14   ` Eric Abrahamsen
  2019-06-21 15:59     ` Michael Heerdegen
                       ` (2 more replies)
  1 sibling, 3 replies; 10+ messages in thread
From: Eric Abrahamsen @ 2019-06-21 15:14 UTC (permalink / raw)
  To: 36067

Noam Postavsky <npostavs@gmail.com> writes:

> tags 36067 + unreproducible
> quit
>
> Michael Heerdegen <michael_heerdegen@web.de> writes:
>
>> sorry, no recipe.  Quite often when I have used edebug, I think often I
>> killed the session by going to top-level (q), normal RET in the
>> minibuffer doesn't work any more.  Hitting the key RET does nothing.  I
>> have to restart Emacs (I need to close it with the mouse or something
>> like that).
>
> Do you mean that you're stuck in the minibuffer too?  Or just that the
> minibuffer becomes non-functional, while other normal typing still
> works.
>
>> I have no clue why this happens.  Dunno if it is my fault.  Anyone else
>> seeing this?
>
> Don't think I've ever seen that before.  I know the 'transient' package
> (which magit now uses for its popup UI), can have a bad interaction with
> edebug when trying to debug its code.  I think it's due to how it messes
> with transient keymaps in post/pre comman hooks.  Maybe you have
> something similar happen here?

I may have seen something similar, where there seems to be an cursor in
the minibuffer, sort of like a prompt with no text, but you can't "get
there" to quit the prompt. I've found that `exit-recursive-edit' gets
out of it. Ignore me if this is unrelated...






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

* bug#36067: 27.0.50; Edebug leaves undefined RET in minibuffer
  2019-06-21 15:14   ` Eric Abrahamsen
@ 2019-06-21 15:59     ` Michael Heerdegen
  2019-06-22  8:22     ` martin rudalics
  2021-08-10 16:11     ` Lars Ingebrigtsen
  2 siblings, 0 replies; 10+ messages in thread
From: Michael Heerdegen @ 2019-06-21 15:59 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: 36067

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> I may have seen something similar, where there seems to be an cursor in
> the minibuffer, sort of like a prompt with no text, but you can't "get
> there" to quit the prompt. I've found that `exit-recursive-edit' gets
> out of it. Ignore me if this is unrelated...

Yes, seems unrelated ;-) as it's quite different from what I see.  FWIW,
I think I sometimes see what you describe when there is an active
minibuffer in another frame.

Michael.





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

* bug#36067: 27.0.50; Edebug leaves undefined RET in minibuffer
  2019-06-21 15:14   ` Eric Abrahamsen
  2019-06-21 15:59     ` Michael Heerdegen
@ 2019-06-22  8:22     ` martin rudalics
  2021-08-10 16:11     ` Lars Ingebrigtsen
  2 siblings, 0 replies; 10+ messages in thread
From: martin rudalics @ 2019-06-22  8:22 UTC (permalink / raw)
  To: Eric Abrahamsen, 36067

 > I may have seen something similar, where there seems to be an cursor in
 > the minibuffer, sort of like a prompt with no text, but you can't "get
 > there" to quit the prompt. I've found that `exit-recursive-edit' gets
 > out of it. Ignore me if this is unrelated...

It's quite easy to confuse Emacs by selecting the minibuffer window
without activating the minibuffer.  With Emacs -Q evaluate

(select-window (minibuffer-window))

Here I now can't get out the minibuffer window via C-g nor C-M-c
(there's no recursive editing in progress) or some key I bind
'abort-recursive-edit' to - C-] being non-functional on my keyboard -
(again because there's not recursive editing in progress).

M-x ESC does nothing.  Plain ESC ESC ESC gets me (with
'debug-on-error' set)

(error "Window nil is a minibuffer window")
   signal(error ("Window nil is a minibuffer window"))
   error("Window %s is a minibuffer window" nil)
   switch-to-prev-buffer(nil bury)
   bury-buffer()
   keyboard-escape-quit()
   funcall-interactively(keyboard-escape-quit)
   call-interactively(keyboard-escape-quit nil nil)
   command-execute(keyboard-escape-quit)

M-ESC is handled by the OS.

The only things that work here are M-x quit which then displays the
*Messages* buffer and one of M-x ESC ESC ESC, M-x keyboard-quit and
M-x keyboard-escape-quit which all get me back to *scratch*.

Also, selecting another window by clicking into it with the mouse
works.  Things do get worse when the minibuffer is on another (maybe
iconified, invisible ...) frame.

So we'd have to check whether the behavior the OP sees is just some
such looping as I described above or something rooted deeper in the
edebug code.

martin





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

* bug#36067: 27.0.50; Edebug leaves undefined RET in minibuffer
  2019-06-21 14:59   ` Michael Heerdegen
@ 2019-07-09  2:08     ` Michael Heerdegen
  0 siblings, 0 replies; 10+ messages in thread
From: Michael Heerdegen @ 2019-07-09  2:08 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 36067

Michael Heerdegen <michael_heerdegen@web.de> writes:

> > Don't think I've ever seen that before.  I know the 'transient'
> > package (which magit now uses for its popup UI), can have a bad
> > interaction with edebug when trying to debug its code.  I think it's
> > due to how it messes with transient keymaps in post/pre comman
> > hooks.  Maybe you have something similar happen here?
>
> I'll try to find out when I see this the next time.

I saw it again.  This time indeed a left over transient-map was the
culprit.  The transient-map had been installed with `set-transient-map'
with a KEEP-PRED that should have been failing, but somehow, due to the
interaction with edebug, or just the recursive edit, the transient map
stayed alive, I guess the KEEP-PRED was not tested anymore, but I'm not
sure.  It's not easy to reproduce the issue at will, so I have a hard
time to find out more.

Michael.





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

* bug#36067: 27.0.50; Edebug leaves undefined RET in minibuffer
  2019-06-21 15:14   ` Eric Abrahamsen
  2019-06-21 15:59     ` Michael Heerdegen
  2019-06-22  8:22     ` martin rudalics
@ 2021-08-10 16:11     ` Lars Ingebrigtsen
  2 siblings, 0 replies; 10+ messages in thread
From: Lars Ingebrigtsen @ 2021-08-10 16:11 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: 36067

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> I may have seen something similar, where there seems to be an cursor in
> the minibuffer, sort of like a prompt with no text, but you can't "get
> there" to quit the prompt. I've found that `exit-recursive-edit' gets
> out of it. Ignore me if this is unrelated...

Yes, I've seen similar behaviour -- I've never been able to reproduce
how it happens, but it's usually to do with entering edebug/a backtrace,
and then doing something else, and then `C-g'-ing out of something, and
then Emacs is in this weird state.

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





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

* bug#36067: 27.0.50; Edebug leaves undefined RET in minibuffer
  2019-06-03  2:20 bug#36067: 27.0.50; Edebug leaves undefined RET in minibuffer Michael Heerdegen
  2019-06-21 10:14 ` Noam Postavsky
@ 2024-04-21  4:24 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-04-21  6:02   ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 10+ messages in thread
From: Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-04-21  4:24 UTC (permalink / raw)
  To: 36067

Hello,

Something that might be related:

If you edebug some code that uses `unwind-protect' to ensure certain
cleanup things are done, and you quit Edebug before those protected
forms are reached, they will never be executed.  This can break your
session in diverse surprising ways.

Here is a harmless example to demonstrate what I mean:

#+begin_src emacs-lisp
(defvar a 0)

(unwind-protect
    (progn (setq a 27)
           (message "%d" (+ a 19)))
  (setq a 0))
#+end_src

When you edebug the `unwind-protect' form and hit q (quit) when the
`message' call has been reached, your session will remain with a binding
of 27 for a - which is normally impossible and should never happen.

Quitting Edebug is a very dangerous operation for an Emacs session.


Michael.





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

* bug#36067: 27.0.50; Edebug leaves undefined RET in minibuffer
  2024-04-21  4:24 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-04-21  6:02   ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 10+ messages in thread
From: Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-04-21  6:02 UTC (permalink / raw)
  To: 36067

I had written:

> #+begin_src emacs-lisp
> (defvar a 0)
>
> (unwind-protect
>     (progn (setq a 27)
>            (message "%d" (+ a 19)))
>   (setq a 0))
> #+end_src
>
> When you edebug the `unwind-protect' form and hit q (quit) when the
> `message' call has been reached, your session will remain with a binding
> of 27 for a - which is normally impossible and should never happen.

Although - I apologize - this is not what is happening: Edebug always
stops at the unwind forms.

I guess what I always do is thinking: "I said quit, why does it stop
again?" and quit again - which then explicitly skips the execution of
any unwind forms - bad for me.

So: should quitting maybe also set the mode to something like Go-nonstop
before calling `top-level' - would that behave better?


Michael.





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

end of thread, other threads:[~2024-04-21  6:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-03  2:20 bug#36067: 27.0.50; Edebug leaves undefined RET in minibuffer Michael Heerdegen
2019-06-21 10:14 ` Noam Postavsky
2019-06-21 14:59   ` Michael Heerdegen
2019-07-09  2:08     ` Michael Heerdegen
2019-06-21 15:14   ` Eric Abrahamsen
2019-06-21 15:59     ` Michael Heerdegen
2019-06-22  8:22     ` martin rudalics
2021-08-10 16:11     ` Lars Ingebrigtsen
2024-04-21  4:24 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-21  6:02   ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors

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