[Top][All Lists]

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

RE: fail to call edebug-defun

From: Drew Adams
Subject: RE: fail to call edebug-defun
Date: Sun, 14 Jul 2013 06:43:55 -0700 (PDT)

>   byte-code: Key sequence C-x C-a C-s starts with non-prefix key C-x C-a

This message means that `C-x C-a' has not yet been defined as a prefix key.

Imagine that you wanted to set `C-x C-a C-s' in the global keymap to command
`forward-char'.  If you try `M-x global-set-key RET C-x C-a C-s' you never
get a chance to hit `C-s'.  Emacs interrupts after `C-x C-a', thinking that
you want to bind the key `C-x C-a'.  Emacs doesn't know that you want that
to be a prefix key.  (Emacs does know, out of the box, that `C-x' is a
prefix key - it is predefined as such.)

Do this first:

(define-key your-keymap (kbd "C-x C-a") nil)

That still does not tell Emacs that `C-x C-a' is to be a prefix key, but
it does liberate it to become one.  It tells Emacs that `C-x C-a' has no
key binding.

Now you can bind `C-x C-a C-s':

(define-key your-keymap (kbd "C-x C-a C-s") 'your-command)

Now Emacs knows that `C-x C-a' is a prefix key in `your-keymap'.  If you
used `global-set-key' above, instead of `define-key' with `your-keymap',
then after the `C-x C-a C-s' definition you would be able to do
`M-x global-set-key RET C-x C-a C-s' and Emacs would not interrupt after
`C-x C-a'.  Instead, it would wait, expecting another key to follow.

Someone else will be able to answer your question about edebug.  I use
ordinary `debug', myself.  (E.g., `debug-on-entry',
`toggle-debug-on-error', or explicit `(debug)' calls in the code.)

See also (elisp) `Prefix Keys'.

reply via email to

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