2

To instrument an elisp function means to set up Emacs in such a way that whenever the function gets executed, debug mode is entered so the function can be executed stepwise. To instrument a function, move point into the definition of the function and then do C-u C-M-x (as explained here).

How can I de-instrument an elisp function I have instrumented so that Emacs won't stop and enter into debug mode every time I execute this function?

According to the Emacs manual,

To remove instrumentation from a definition, simply re-evaluate its definition in a way that does not instrument. There are two ways of evaluating forms that never instrument them: from a file with load, and from the minibuffer with eval-expression (M-:).

If I use the M-: then the function will get executed, right? I'd like to avoid this.

So this leaves me with the second option:

from a file with load

But what does it mean? Does it mean reloading the file where the function is defined by executing C-x C-f (or, alternatively, M-x revert-buffer)?

NickD
  • 27,023
  • 3
  • 23
  • 42
Evan Aad
  • 1,461
  • 1
  • 14
  • 29
  • 2
    I'm not familiar with `edebug`, but you can reevaluate your function's definition without instrumentation the same way you instrumented it to begin with; just omit the prefix argument: `M-x eval-defun` or `C-M-x` with point inside the function in question. Look at the documentation for `eval-defun`. – Basil May 31 '17 at 08:36
  • 1
    "If I use the `M-:` then the function will get executed, right?" - the idea is that you evaluate the `(defun ...)` form, not a function call. – npostavs May 31 '17 at 13:52
  • @npostavs: How can I use `M-:` to evaluate the `(define ...)` form rather than the function call? – Evan Aad May 31 '17 at 14:47
  • You put the `(defun foo () etc etc)` in answer to the `M-:` prompt (not sure I understand what your question is) – npostavs May 31 '17 at 15:29

0 Answers0