unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#70938: 30.0.50; Edebug appropriates overriding-terminal-local-map
@ 2024-05-14 13:24 Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-05-14 19:59 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-05-14 21:23 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 2 replies; 10+ messages in thread
From: Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-05-14 13:24 UTC (permalink / raw)
  To: 70938

While I was edebugging in todo-mode.el (bug#70937) Emacs got into a
state where Edebug kicked in even after I removed the instrumentation
from the code.  AFAICT from further debugging, the issue has to do with
the way todo-mode.el uses set-transient-map.  To provide a reproducer
that does not involve todo-mode.el I have extracted and simplified the
triggering function from that file and included it in the attached file.

0. emacs -Q -l test-edebug-override-map.el
1. M-x srb-test
2. At the prompt type one of the keys listed between the curly braces,
   which removes that group and prompts again; keeping typing till there
   is no further prompt, then a message displays the typed keys in the
   order they were typed in.
3. Now visit test-edebug-override-map.el and with point in the function
   srb-test--next type `C-u C-M-x' to instrument it for Edebug.
4. Type M-s srb-test again and when Edebug stops execution, type `f'
   twice to step through the entire function so Edebug releases control.
5. Now with point again in srb-test--next type `C-M-x' to remove the
   instrumentation.  You can confirm this by repeating steps 1-2 without
   Edebug kicking.
6. Now type any of the keys that were listed in the prompt on invoking
   srb-test (these keys are the strings in the value of
   srb-test--key-groups).
=> This makes Edebug kick in with execution stopped at one of the two
   occurrences of the sexp `(setq keys-so-far (concat keys-so-far " "
   (funcall this-key)))' in srb-test--next.  The same thing happens with
   sequences containg one of these keys, e.g. `M-x k'.

I did find a way to prevent Edebug from kicking in: uncomment the lines
in the test file containing "exitfn"; this explicitly deactivates the
transient map when the function returns, but it also makes the function
a noop, so it's no fix for the problem.

After step 4., when I type `C-h b' to show all current key bindings, the
*Help* buffer contains a listing like this:

 Overriding Bindings:

Key             Binding

c .. d		#<interpreted-function AA2>
h		#<interpreted-function BAB>
i		#<interpreted-function 8CC>
k		#<interpreted-function 9AC>
n		#<interpreted-function A7F>
p		#<interpreted-function 917>
r		#<interpreted-function B53>
t		#<interpreted-function BD6>
y		#<interpreted-function 9F1>

The codes AA2, etc. are links, and clicking on these pops up a *Help
Source* buffer containing elisp code like this:

#[nil
  ((edebug-enter 'edebug-anon5 (list)
		 #'(lambda nil :closure-dont-trim-context
		     (edebug-after (edebug-before 0) 7
				   (setq keys-so-far
					 (edebug-after
					  (edebug-before 1) 6
					  (concat
					   (edebug-after 0 2
							 keys-so-far)
					   " "
					   (edebug-after
					    (edebug-before 3) 5
					    (funcall
					     (edebug-after 0 4
							   this-key)))))))

This is evidently from the instrumented function.  What I haven't been
able to determine is why this remains even after the instrumentation has
been removed; it seems that Edebug has appropriated
overriding-terminal-local-map.  The only way I have found to release it
is `M-x unload-library RET edebug'.


In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.41, cairo version 1.18.0) of 2024-05-08 built on strobelfs
Repository revision: e020f4e9ce5d98438033fea098d943c311b0fa3d
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101013
System Description: Linux From Scratch r12.1-53

Configured using:
 'configure -C 'CFLAGS=-Og -g3' PKG_CONFIG_PATH=/opt/qt5/lib/pkgconfig'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LCMS2 LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG
RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER
WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB





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

end of thread, other threads:[~2024-05-27 15:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-14 13:24 bug#70938: 30.0.50; Edebug appropriates overriding-terminal-local-map Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-14 19:59 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-14 20:15   ` Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-14 21:23 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-14 22:02   ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-15 15:24     ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-15 18:51       ` Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-21  9:15         ` Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-27 14:37           ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-27 15:48             ` Stephen Berman 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).