Comments (4)
Notes:
C layer
minibuf.c
callsrecursive_edit_1
keyboard.c
has lots ofrecursive_edit
stuff and definesrecursive-edit
andrecursive_edit_1
emacs.c
callsFrecursive_edit
e.g via LISP
recursive_edit_1
- Just calls
command_loop
like normal which ultimately callscall-interactive
so that's OK from native C.
This means that we already do the right thing subtracting out any further commands that are run, but sitting there with no actions just adds executing time to the debugged command. - Call from
minibuf.c
is fromread_minibuf
which is how minibuffers are entered. We've already advised all entries into minibuffer so that's OK from native C.
recursive_edit
- Just calls
recursive_edit_1
- Is called from
main
inemacs.c
asFrecursive_edit
, but that's too early to ever catch. Anyway that just starts a commandloop which we already model viaroot-emacs
.
elisp layer
20 calls to recursive-edit
in some major packages and modes
finish via:
throw 'exit
- throw
t
to get totop-level
, e.g.
- throw
abort-recursive-edit
C code "abort the command that caused this recursive edit OR ** minibuffer edit **"exit-recursive-edit
C code "exit"
abort-recursive-edit
- never called via C
- Just throws
'exit 't
exit-recursive-edit
- never called via C
- Just throws
'exit nil
from explain-pause-mode.
To investigate:
- Advise
unwind-protect
code needs special case to handle the exit conditions and record what's going on. If we throw out to top level, we need to unwind our own stack all the way out to root-emacs. - How does this interact with timers?? When timers fire and filters fire, what happens when you abort and exit??
- If I
exit-recursive-edit
from another function insidecall-interactively
, the code should catch the error,unwind-protect
out the first call, let elisp jump to the actual handler, and thenunwind-protect
our way if it's not to top level. Test.
from explain-pause-mode.
Everything works normally. throw 'exit t
ends up unwinding as expected to the function call site, and then quit
is thrown, and the stack unwinds with the unwind protects we already have to get back to top-level. I think a regular native-wrap
is sufficient.
from explain-pause-mode.
When you're in recursive edit, we refuse to install explain-pause-mode
, which makes sense. Adjust the messaging.
from explain-pause-mode.
Related Issues (20)
- Bug report
- not top level in wrap-native HOT 3
- Installation of explain-pause-mode failed
- Explain-pause-mode is now _disabled_ so you can continue to hopefully use Emacs
- ignore functions run on idle timers / when idle?
- Bug report (same as many others, though details may be different)
- bug report
- problem with password in shell
- installation fails in Emacs 28.2 due to the long docstrings HOT 1
- Occasional hangs in Emacs 27.1, interruptible with SIGUSR2 HOT 10
- Disabling explain-pause-mode does not clear timers created while the mode is activated HOT 4
- Exception report HOT 2
- Exception
- Continuously log all function calls to file?
- Exception on void-function
- Bug HOT 1
- error when use emacs from snap
- Bug Report Requested
- Bug report requested
- not top level in wrap-native HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from explain-pause-mode.