all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* confusion on keymap's forms in doc
@ 2008-10-28  6:41 Xah
  2008-10-31  3:26 ` Kevin Rodgers
  0 siblings, 1 reply; 2+ messages in thread
From: Xah @ 2008-10-28  6:41 UTC (permalink / raw)
  To: help-gnu-emacs

here's something unclear to me:

According to the manual
http://xahlee.org/elisp/Format-of-Keymaps.html

quote:
«
Each keymap is a list whose CAR is the symbol `keymap'.  The remaining
elements of the list define the key bindings of the keymap.

...

   Here as an example is the local keymap for Lisp mode, a sparse
keymap.  It defines bindings for <DEL> and <TAB>, plus `C-c C-l',
`M-C-q', and `M-C-x'.

     lisp-mode-map
     =>
     (keymap
      (3 keymap
         ;; C-c C-z
         (26 . run-lisp))
      (27 keymap
          ;; `M-C-x', treated as `<ESC> C-x'
          (24 . lisp-send-defun)
          keymap
          ;; `M-C-q', treated as `<ESC> C-q'
          (17 . indent-sexp))
      ;; This part is inherited from `lisp-mode-shared-map'.
      keymap
      ;; <DEL>
      (127 . backward-delete-char-untabify)
      (27 keymap
          ;; `M-C-q', treated as `<ESC> C-q'
          (17 . indent-sexp))
      (9 . lisp-indent-line))
»

if we look at the lisp-mode-map example above, it has 5 items. (not
counting the first item “keymap”, and the third item ‘keymap’ is
probably typo orphaned from above comment line”)

If we look at the item

(3 keymap
         ;; C-c C-z
         (26 . run-lisp))

this does not seem to be one of the form specified for allowed
elements in a keymap. The doc says the following form is allowed:

«
(type . binding)
(t . binding)
char-table
string
»

Should the doc add a form “(type . keymap)”?

also, in:
http://xahlee.org/elisp/Inheritance-and-Keymaps.html
it says:

«A keymap can inherit the bindings of another keymap, which we call
the parent keymap. Such a keymap looks like this:

     (keymap bindings... . parent-keymap)
»

if i understand it correctly, when expanded, such a keymap looks like
this:

(keymap
element-1
element-2
element-3
...
element-n
symbolOfParentKeymap
)

So, effectively, such a keymap is effectively having a
symbolOfParentKeymap appended to the original keymap list. Is that
right?

  Xah
∑ http://xahlee.org/^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-10-31  3:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-28  6:41 confusion on keymap's forms in doc Xah
2008-10-31  3:26 ` Kevin Rodgers

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.