Giter Club home page Giter Club logo

Comments (4)

lastquestion avatar lastquestion commented on June 3, 2024

Notes:

C layer

  • minibuf.c calls recursive_edit_1
  • keyboard.c has lots of recursive_edit stuff and defines recursive-edit and recursive_edit_1
  • emacs.c calls Frecursive_edit e.g via LISP

recursive_edit_1

  • Just calls command_loop like normal which ultimately calls call-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 from read_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 in emacs.c as Frecursive_edit, but that's too early to ever catch. Anyway that just starts a commandloop which we already model via root-emacs.

elisp layer

20 calls to recursive-edit in some major packages and modes

finish via:

  • throw 'exit
    • throw t to get to top-level, e.g.
  • 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.

lastquestion avatar lastquestion commented on June 3, 2024

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 inside call-interactively, the code should catch the error, unwind-protect out the first call, let elisp jump to the actual handler, and then unwind-protect our way if it's not to top level. Test.

from explain-pause-mode.

lastquestion avatar lastquestion commented on June 3, 2024

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.

lastquestion avatar lastquestion commented on June 3, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.