Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs - how to see/how to debug a single elisp function/emacs command

Tags:

emacs

elisp

There is one thing that I don't like on table function in Org-mode for emacs. I would like to see all the functions that get executed by function that I run as Emacs command.

What is the best way to do that? Any tips how to get started with debuging elisp code, especially single command of interest?

like image 546
Jarek Avatar asked Nov 25 '11 19:11

Jarek


People also ask

How do I debug Emacs?

You can enter the debugger when you call the function by calling debug-on-entry . Now, type d again, eight times, slowly. Each time you type d , Emacs will evaluate another expression in the function definition. By typing d , you were able to step through the function.

How do I start Emacs with debug init?

When you start emacs from a terminal simply add it after the command so that your complete command looks like emacs --debug-init . Show activity on this post. Just write emacs --debug-init in your terminal, you can do M-x info RET to see the other options and learn what is for what.

How do I exit debug in Emacs?

q. Terminate the program being debugged; return to top-level Emacs command execution. If the debugger was entered due to a C-g but you really want to quit, and not debug, use the q command.


1 Answers

  1. C-hf function name to find the source code for the function.
  2. C-uC-M-x to instrument the function for Edebug.

Whenever the function is called, Emacs will drop into Edebug which makes it easy to execute the function step by step, inspect variables, and do other typical debugging tasks. See (info "(Elisp)Edebug") for more information.

like image 110
Michael Hoffman Avatar answered Sep 27 '22 15:09

Michael Hoffman