* fail to call edebug-defun
@ 2013-07-14 9:14 Hongxu Chen
2013-07-14 13:43 ` Drew Adams
0 siblings, 1 reply; 2+ messages in thread
From: Hongxu Chen @ 2013-07-14 9:14 UTC (permalink / raw)
To: help-gnu-emacs
Dear list,
I need to take a deeper look at the execution of one of the elisp
functions, and I run `edebug-defun' on it(let's suppose we are edebug
on `find-file'), there is a confusing message about it:
byte-code: Key sequence C-x C-a C-s starts with non-prefix key C-x C-a
I know I should toggle-debug-on-error firstly, but that output quite a
huge of message(although the *Backtrace* buffer only contains 7 lines
with line wrapped) that I feel it's improper to paste here.
Also I tried to start with `emacs -q', which works fine. However since
I use quite a lot of packages from package.el and also does some
customization, I feel that figuring out the root cause is a bit
difficult for me.
Have anybody else ever came across this problem? Or would you give me
some advice?
BTW, I am using a emacs from a Ubuntu PPA by Damien
Cassou (https://launchpad.net/~cassou/+archive/emacs) and the result of
`M-x emacs-version' is GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+
Version 3.4.2) of 2013-04-14 on chindi10, modified by Debian.
Thanks!
--
Regards,
Hongxu Chen
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: fail to call edebug-defun
2013-07-14 9:14 fail to call edebug-defun Hongxu Chen
@ 2013-07-14 13:43 ` Drew Adams
0 siblings, 0 replies; 2+ messages in thread
From: Drew Adams @ 2013-07-14 13:43 UTC (permalink / raw)
To: Hongxu Chen, help-gnu-emacs
> 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'.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-07-14 13:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-14 9:14 fail to call edebug-defun Hongxu Chen
2013-07-14 13:43 ` Drew Adams
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).