unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How to make c-u c-g debug-on-quit?
@ 2007-01-25 21:38 joakim
  2007-01-31  5:45 ` Kevin Rodgers
  0 siblings, 1 reply; 2+ messages in thread
From: joakim @ 2007-01-25 21:38 UTC (permalink / raw)
  To: help-gnu-emacs

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?
-- 
Joakim Verona
http://www.verona.se

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to make c-u c-g debug-on-quit?
  2007-01-25 21:38 How to make c-u c-g debug-on-quit? joakim
@ 2007-01-31  5:45 ` Kevin Rodgers
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Rodgers @ 2007-01-31  5:45 UTC (permalink / raw)
  To: help-gnu-emacs

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-01-31  5:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-25 21:38 How to make c-u c-g debug-on-quit? joakim
2007-01-31  5:45 ` Kevin Rodgers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).