Skip to main content
added 843 characters in body
Source Link
Drew
  • 79.1k
  • 10
  • 123
  • 257

Wrt your comment: Non-interactively, the argument to describe-keymap can be a keymap object instead of the name of a keymap variable. C-h f describe-keymap:

describe-keymap is an interactive Lisp function in `help-fns+.el'.

It is bound to C-h M-k, f1 M-k, help M-k, menu-bar help-menu describe
describe-keymap.

(describe-keymap KEYMAP &optional SEARCH-SYMBOLS-P)

For more information check the manuals.

Describe key bindings in KEYMAP.
Interactively, prompt for a variable that has a keymap value.
Completion is available for the variable name.

Non-interactively:
* KEYMAP can be such a keymap variable or a keymap.
* Non-nil optional arg SEARCH-SYMBOLS-P means that if KEYMAP is not a
  symbol then search all variables for one whose value is KEYMAP.

Wrt your comment: Non-interactively, the argument to describe-keymap can be a keymap object instead of the name of a keymap variable. C-h f describe-keymap:

describe-keymap is an interactive Lisp function in `help-fns+.el'.

It is bound to C-h M-k, f1 M-k, help M-k, menu-bar help-menu describe
describe-keymap.

(describe-keymap KEYMAP &optional SEARCH-SYMBOLS-P)

For more information check the manuals.

Describe key bindings in KEYMAP.
Interactively, prompt for a variable that has a keymap value.
Completion is available for the variable name.

Non-interactively:
* KEYMAP can be such a keymap variable or a keymap.
* Non-nil optional arg SEARCH-SYMBOLS-P means that if KEYMAP is not a
  symbol then search all variables for one whose value is KEYMAP.
added 101 characters in body
Source Link
Drew
  • 79.1k
  • 10
  • 123
  • 257
  1. The first answer is that its purpose is to act as a prefix key to the keys that follow it; that is, to serve as a keymap for a certain number of key bindings. Those bindings are also shown in describe-key. Seriously; this is the purpose: to group those keys and their commands. Now what that grouping might be about is another question (see next).

  2. Beyond #1, yes. A prefix key is bound to a keymap, and that can have its own doc string. It is up to the creator of the keymap to provide a reasonable and useful doc string.

    To see the doc for a keymap, use C-h M-k (describe-keymap), from help-fns+.el.

    Here is what you see for bookmark-map, for example (manuals here is a link to the doc in the Emacs manuals):

     bookmark-map
     ------------
    
     For more information check the manuals.
    
     Keymap containing bindings to bookmark functions.
     It is not bound to any key by default: to bind it
     so that you have a bookmark prefix, just use `global-set-key' and bind a
     key of your choice to `bookmark-map'.  All interactive bookmark
     functions have a binding in this keymap.
    
     key             binding
     ---             -------
    
     d               bookmark-delete
     e               edit-bookmarks
     f               bookmark-insert-location
     g               bookmark-jump
     i               bookmark-insert
     j               bookmark-jump
     l               bookmark-load
     m               bookmark-set
     o               bookmark-jump-other-window
     r               bookmark-rename
     s               bookmark-save
     w               bookmark-write
     x               bookmark-set
    

    But some keymaps have a more rudimentary doc string. The keymap ctl-x-map, for instance, is general-purpose, so there is not much that can be said (beyond #1 above). This is what you get with C-h M-k ctl-x-map:

     ctl-x-map
     ---------
    
     For more information check the manuals.
    
     Default keymap for C-x commands.
     The normal global definition of the character C-x indirects to this keymap.
    
     key             binding
     ---             -------
    
     C-@             pop-global-mark
     C-b             list-buffers
     ...
    

    In this case, the doc string essentially just repeats #1 above: Default keymap for C-x commands.

  1. The first answer is that its purpose is to act as a prefix key to the keys that follow it; that is, to serve as a keymap for a certain number of key bindings. Those bindings are also shown in describe-key. Seriously; this is the purpose: to group those keys and their commands. Now what that grouping might be about is another question (see next).

  2. Beyond #1, yes. A prefix key is bound to a keymap, and that can have its own doc string. It is up to the creator of the keymap to provide a reasonable and useful doc string.

    To see the doc for a keymap, use C-h M-k (describe-keymap), from help-fns+.el.

    Here is what you see for bookmark-map, for example (manuals here is a link to the doc in the Emacs manuals):

     bookmark-map
     ------------
    
     For more information check the manuals.
    
     Keymap containing bindings to bookmark functions.
     It is not bound to any key by default: to bind it
     so that you have a bookmark prefix, just use `global-set-key' and bind a
     key of your choice to `bookmark-map'.  All interactive bookmark
     functions have a binding in this keymap.
    
     key             binding
     ---             -------
    
     d               bookmark-delete
     e               edit-bookmarks
     f               bookmark-insert-location
     g               bookmark-jump
     i               bookmark-insert
     j               bookmark-jump
     l               bookmark-load
     m               bookmark-set
     o               bookmark-jump-other-window
     r               bookmark-rename
     s               bookmark-save
     w               bookmark-write
     x               bookmark-set
    

    But some keymaps have a more rudimentary doc string. The keymap ctl-x-map, for instance, is general-purpose, so there is not much that can be said (beyond #1 above). This is what you get with C-h M-k ctl-x-map:

     ctl-x-map
     ---------
    
     For more information check the manuals.
    
     Default keymap for C-x commands.
     The normal global definition of the character C-x indirects to this keymap.
    
     key             binding
     ---             -------
    
     C-@             pop-global-mark
     C-b             list-buffers
     ...
    
  1. The first answer is that its purpose is to act as a prefix key to the keys that follow it; that is, to serve as a keymap for a certain number of key bindings. Those bindings are also shown in describe-key. Seriously; this is the purpose: to group those keys and their commands. Now what that grouping might be about is another question (see next).

  2. Beyond #1, yes. A prefix key is bound to a keymap, and that can have its own doc string. It is up to the creator of the keymap to provide a reasonable and useful doc string.

    To see the doc for a keymap, use C-h M-k (describe-keymap), from help-fns+.el.

    Here is what you see for bookmark-map, for example (manuals here is a link to the doc in the Emacs manuals):

     bookmark-map
     ------------
    
     For more information check the manuals.
    
     Keymap containing bindings to bookmark functions.
     It is not bound to any key by default: to bind it
     so that you have a bookmark prefix, just use `global-set-key' and bind a
     key of your choice to `bookmark-map'.  All interactive bookmark
     functions have a binding in this keymap.
    
     key             binding
     ---             -------
    
     d               bookmark-delete
     e               edit-bookmarks
     f               bookmark-insert-location
     g               bookmark-jump
     i               bookmark-insert
     j               bookmark-jump
     l               bookmark-load
     m               bookmark-set
     o               bookmark-jump-other-window
     r               bookmark-rename
     s               bookmark-save
     w               bookmark-write
     x               bookmark-set
    

    But some keymaps have a more rudimentary doc string. The keymap ctl-x-map, for instance, is general-purpose, so there is not much that can be said (beyond #1 above). This is what you get with C-h M-k ctl-x-map:

     ctl-x-map
     ---------
    
     For more information check the manuals.
    
     Default keymap for C-x commands.
     The normal global definition of the character C-x indirects to this keymap.
    
     key             binding
     ---             -------
    
     C-@             pop-global-mark
     C-b             list-buffers
     ...
    

    In this case, the doc string essentially just repeats #1 above: Default keymap for C-x commands.

Source Link
Drew
  • 79.1k
  • 10
  • 123
  • 257

  1. The first answer is that its purpose is to act as a prefix key to the keys that follow it; that is, to serve as a keymap for a certain number of key bindings. Those bindings are also shown in describe-key. Seriously; this is the purpose: to group those keys and their commands. Now what that grouping might be about is another question (see next).

  2. Beyond #1, yes. A prefix key is bound to a keymap, and that can have its own doc string. It is up to the creator of the keymap to provide a reasonable and useful doc string.

    To see the doc for a keymap, use C-h M-k (describe-keymap), from help-fns+.el.

    Here is what you see for bookmark-map, for example (manuals here is a link to the doc in the Emacs manuals):

     bookmark-map
     ------------
    
     For more information check the manuals.
    
     Keymap containing bindings to bookmark functions.
     It is not bound to any key by default: to bind it
     so that you have a bookmark prefix, just use `global-set-key' and bind a
     key of your choice to `bookmark-map'.  All interactive bookmark
     functions have a binding in this keymap.
    
     key             binding
     ---             -------
    
     d               bookmark-delete
     e               edit-bookmarks
     f               bookmark-insert-location
     g               bookmark-jump
     i               bookmark-insert
     j               bookmark-jump
     l               bookmark-load
     m               bookmark-set
     o               bookmark-jump-other-window
     r               bookmark-rename
     s               bookmark-save
     w               bookmark-write
     x               bookmark-set
    

    But some keymaps have a more rudimentary doc string. The keymap ctl-x-map, for instance, is general-purpose, so there is not much that can be said (beyond #1 above). This is what you get with C-h M-k ctl-x-map:

     ctl-x-map
     ---------
    
     For more information check the manuals.
    
     Default keymap for C-x commands.
     The normal global definition of the character C-x indirects to this keymap.
    
     key             binding
     ---             -------
    
     C-@             pop-global-mark
     C-b             list-buffers
     ...