3

I'm following the tutorial's "Making error": reproduced in the screenshot below. The manufactured error does not open the Backtrace window as it should. The same page says "It is possible to prevent Emacs entering the debugger in cases like this. [...] in the echo area and look like this:

 Symbol's function definition is void: this

". And that is indeed what I get. Thus my question: how to switch on the backtrace feature?

screenshot below The manufactured error

Drew
  • 75,699
  • 9
  • 109
  • 225
  • 1
    I don't know why the manual doesn't specify that you need to first type `M-x toggle-debug-on-error` or evaluate `(setq debug-on-error t)`. Perhaps the manual needs to be revised to instruct the user to first enable debugging before performing the test .... However, I haven't memorized the manual, so maybe it says it somewhere and it's just not obvious. – lawlist Nov 03 '19 at 06:02
  • 1
    This is on account of `C-h v eval-expression-debug-on-error`, which is `t` by default; so when the user evals the invalid code, they ought to get the expected backtrace. xuchunyang has spotted the reason for it not happening in this case. – phils Nov 03 '19 at 11:40

1 Answers1

4

In your mode line, [...] suggests you have an existing backtrace is running, you need to quit this one in order to trigger a new backtrace, you can do this by C-x b *Backtrace* and q.

If there is something in the mode line you don't understand, you can use mouse hover to see the tooltip. For example, if you hover [ or ], it will say something like "Recursive edit, type C-M-c to get out". (emacs) Recursive Edit is a feature that allow users continue to use Emacs without quit the current command, in this debugging case, you can use continue to use Emacs as usual while you're debugging Emacs itself. To quit one Recursive edit, you can use C-M-c (exit-recursive-edit, one level) or C-] (abort-recursive-edit, all levels) or M-x top-level (actually q in the end of the first paragraph runs top-level).

xuchunyang
  • 14,302
  • 1
  • 18
  • 39
  • OP: The mode-line indication that you are in a recursive edit (`[...]`) is not very noticeable. If you'd like to see it be more noticeable, and even indicate different levels of `recusion-depth`, you can use library [`rec-edit.el`](https://www.emacswiki.org/emacs/download/rec-edit.el) for that. – Drew Nov 03 '19 at 17:14