help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to make c-u c-g debug-on-quit?


From: Kevin Rodgers
Subject: Re: How to make c-u c-g debug-on-quit?
Date: Tue, 30 Jan 2007 22:45:39 -0700
User-agent: Thunderbird 1.5.0.9 (Macintosh/20061207)

joakim@verona.se wrote:
Normally I want c-g to be quit, but sometimes I would like to go into
the debugger instead. I'ts inconvenient to do toggle-debug-on-quit and
then c-g, after the fact.

How can I achieve this? Or am I overlooking something?

You could advise keyboard-quit to interpret a prefix arg to mean that
its body should be run with debug-on-quit temporarily bound to t, but
that would have no effect during Lisp evaluation (which is when you want
to quit).  From the "Quitting and Aborting" node of the Emacs manual:

,----
|    `C-g' works by setting the variable `quit-flag' to `t' the instant
| `C-g' is typed; Emacs Lisp checks this variable frequently, and quits
| if it is non-`nil'.  `C-g' is only actually executed as a command if
| you type it while Emacs is waiting for input.  In that case, the
| command it runs is `keyboard-quit'.
`----

And from lisp/files.el:

;; This executes C-g typed while Emacs is waiting for a command.
;; Quitting out of a program does not go through here;
;; that happens in the QUIT macro at the C code level.
(defun keyboard-quit ()
  "Signal a `quit' condition.
During execution of Lisp code, this character causes a quit directly.
At top-level, as an editor command, this simply beeps."
  (interactive)
...


--
Kevin Rodgers
Denver, Colorado, USA





reply via email to

[Prev in Thread] Current Thread [Next in Thread]