all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* A bit confused about C-h m results
@ 2009-09-08 19:22 djp
  2009-09-09  3:37 ` Drew Adams
  0 siblings, 1 reply; 4+ messages in thread
From: djp @ 2009-09-08 19:22 UTC (permalink / raw)
  To: help-gnu-emacs

I have settled on emacs as my main ide for learning lisp. So far, so
good, but - I cannot quite figure out what happens when I try to get
help on lisp-mode.

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.

If I type C-h b I get a whole swack of key bindings, many of which
pertain only to lisp and which, I suspect, are provided in lisp-mode.
These are just listed unde "global bindings."

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: A bit confused about C-h m results
  2009-09-08 19:22 A bit confused about C-h m results djp
@ 2009-09-09  3:37 ` Drew Adams
  2009-09-09  4:09   ` David Penton
       [not found]   ` <mailman.6286.1252483528.2239.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 4+ messages in thread
From: Drew Adams @ 2009-09-09  3:37 UTC (permalink / raw)
  To: 'djp', help-gnu-emacs

> 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





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: A bit confused about C-h m results
  2009-09-09  3:37 ` Drew Adams
@ 2009-09-09  4:09   ` David Penton
       [not found]   ` <mailman.6286.1252483528.2239.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 4+ messages in thread
From: David Penton @ 2009-09-09  4:09 UTC (permalink / raw)
  To: Drew Adams; +Cc: help-gnu-emacs

Thanks much for a very good answer. You hit upon the source of my  
confusion exactly.

The commands you mention (down-list, beginning-of-defun) are lisp-y  
sounding, so I assumed they only pertained to lisp-mode. Moreover,  
some of the functions appear to be defined in lisp.el, although they  
are apparently useful in broader contexts. But being defined in  
lisp.el added to my confusion.

Also, I am a newbie at using this group so I don't know if I should  
reply-all or just reply to the group. Kindly correct me if I am wrong  
by doing reply-all.

Thanks again for the good answer.

On 8-Sep-09, at 11:37 PM, Drew Adams wrote:

>> 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
>





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: A bit confused about C-h m results
       [not found]   ` <mailman.6286.1252483528.2239.help-gnu-emacs@gnu.org>
@ 2009-09-11 20:57     ` John A Pershing Jr
  0 siblings, 0 replies; 4+ messages in thread
From: John A Pershing Jr @ 2009-09-11 20:57 UTC (permalink / raw)
  To: help-gnu-emacs

David Penton <djp@arqux.com> writes:

> Thanks much for a very good answer. You hit upon the source of my
> confusion exactly.
>
> The commands you mention (down-list, beginning-of-defun) are lisp-y
> sounding, so I assumed they only pertained to lisp-mode. Moreover,
> some of the functions appear to be defined in lisp.el, although they
> are apparently useful in broader contexts. But being defined in
> lisp.el added to my confusion.

And you will find even more "programmy" key bindings that "do the right
thing" in Lisp mode (and a different "right thing" in Java mode, or C++
mode, or whataver).  E.g., starting a comment with M-; (which is bound
to 'comment-dwim'), or TAB at the beginning of a line, or using C-j
instead of RET at the end of a line.

It probably would be useful for Help to document these sorts of things,
which may not be obvious to the beginner, who has been typing text in
the past where TAB is simply a tab and there aren't any comments.  At
least C-h M tells you how Delete works for that mode, what the comment
delimiter is, and what denotes a "paragraph".

  -jp


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-09-11 20:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-08 19:22 A bit confused about C-h m results djp
2009-09-09  3:37 ` Drew Adams
2009-09-09  4:09   ` David Penton
     [not found]   ` <mailman.6286.1252483528.2239.help-gnu-emacs@gnu.org>
2009-09-11 20:57     ` John A Pershing Jr

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.