all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kevin Rodgers <kevin.d.rodgers@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: How to make c-u c-g debug-on-quit?
Date: Tue, 30 Jan 2007 22:45:39 -0700	[thread overview]
Message-ID: <eppadp$81m$1@sea.gmane.org> (raw)
In-Reply-To: <m3lkjqbxdo.fsf@kurono.home>

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	other threads:[~2007-01-31  5:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-25 21:38 How to make c-u c-g debug-on-quit? joakim
2007-01-31  5:45 ` Kevin Rodgers [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='eppadp$81m$1@sea.gmane.org' \
    --to=kevin.d.rodgers@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.