help-gnu-emacs
[Top][All Lists]
Advanced

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

RE: A bit confused about C-h m results


From: Drew Adams
Subject: RE: A bit confused about C-h m results
Date: Tue, 8 Sep 2009 20:37:50 -0700

> If I type C-h m  emacs lists a very few keystokes/commands from lisp-
> mode. However, the list is clearly far short of the actual key
> bindings provided by lisp-mode.

AFAIK, only those few bindings are "provided" by Lisp mode. But that doesn't
mean they are the only bindings available when you are in Lisp mode.

(Note, BTW, that Emacs-Lisp mode binds a few more keys.)

> If I type C-h b I get a whole swack of key bindings,

You see the bindings that are available to you in Lisp mode.

> many of which pertain only to lisp

Which, for instance?

In emacs -Q, for Emacs 23.1, C-h b shows these bindings for the major mode (Lisp
mode):

DEL             backward-delete-char-untabify
C-c C-z run-lisp
C-M-q           indent-sexp
C-M-x           lisp-eval-defun

> and which, I suspect, are provided in lisp-mode.
> These are just listed under "global bindings."

Which of those global bindings were you thinking are provided by Lisp mode and
pertain only to Lisp? If you are thinking of things such as `C-M-d'
(`down-list'), then the answer is that such commands are generally useful,
beyond Lisp.

Similarly, a command such as `beginning-of-defun' (`C-M-a'), is useful in
multiple languages, in spite of its Lisp-sounding name. It in fact changes its
behavior, depending on the current mode (current language).

See the Elisp manual, node List Motion.

If keys are listed by `C-h b' as global bindings, then they are in the keymap
`global-map'. It's unlikely that the major mode (Lisp mode) added or changed
`global-map' bindings.

> How would I get a listing of the bindings provided by lisp-mode alone?

What you saw at the beginning of `C-h b' under the heading of major-mode
bindings, was just such a list. It is the same list you saw at the top of what
`C-h m' displays.

Otherwise, you can do this:

C-h v lisp-mode-map

Or for a human-readable listing, download library help-fns+.el, load it, and
then do this;

C-h M-k lisp-mode-map

But the list of keys is still the same. ;-)

http://www.emacswiki.org/emacs/help-fns%2b.el

I mention `C-h M-k' because it works for any keymap (that is bound to a
variable) - it's not always the case that `C-h m' and `C-h b' give you the info
you need. If you want the keys bound in a minibuffer map, for instance, you
cannot use `C-h [mb]' to get that info. But you can use `C-h M-k
minibuffer-local-must-match-map' etc.

HTH





reply via email to

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