unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Hongxu Chen <leftcopy.chx@gmail.com>,
	help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: RE: fail to call edebug-defun
Date: Sun, 14 Jul 2013 06:43:55 -0700 (PDT)	[thread overview]
Message-ID: <bda0bb8e-fbd1-4f61-83aa-2250baed16fb@default> (raw)
In-Reply-To: <87d2qlfqqv.fsf@gmail.com>

>   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	other threads:[~2013-07-14 13:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-14  9:14 fail to call edebug-defun Hongxu Chen
2013-07-14 13:43 ` Drew Adams [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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=bda0bb8e-fbd1-4f61-83aa-2250baed16fb@default \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=leftcopy.chx@gmail.com \
    /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.
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).