unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* * src/keymap.c (define-key) add practical example to docstring
@ 2013-01-07 16:14 Arne Babenhauserheide
  0 siblings, 0 replies; only message in thread
From: Arne Babenhauserheide @ 2013-01-07 16:14 UTC (permalink / raw)
  To: emacs-devel


[-- Attachment #1.1: Type: text/plain, Size: 230 bytes --]

Hi,

Based on a discussion in #emacs, I’d like to contribute the attached patch.

It adds documentation for defining keys in a keymap which would have
helped me a lot when I wrote my last minor mode.

Best wishes,
Arne

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: define-key-example.diff --]
[-- Type: text/x-patch; name="define-key-example.diff", Size: 2581 bytes --]

# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: arne_bab@web.de-20130107114658-r7tm2oqdmanez2ps
# target_branch: bzr://bzr.savannah.gnu.org/emacs/trunk/
# testament_sha1: 423a0e7828e9bdddd00b37d04a7da41effaee0af
# timestamp: 2013-01-07 12:51:40 +0100
# base_revision_id: eliz@gnu.org-20121019064312-moqbalgi86m1r07g
# 
# Begin patch
=== modified file 'src/keymap.c'
--- src/keymap.c	2012-10-10 20:09:47 +0000
+++ src/keymap.c	2013-01-07 11:46:58 +0000
@@ -1088,7 +1088,10 @@
 
 KEY is a string or a vector of symbols and characters, representing a
 sequence of keystrokes and events.  Non-ASCII characters with codes
-above 127 (such as ISO Latin-1) can be represented by vectors.
+above 127 (such as ISO Latin-1) can be represented by vectors. With
+`C-h c` you can get a string representation of any key sequence. Use
+(kbd string) to get the representation for the keymap. For example use
+(kbd "<f6>") to bind F6.
 Two types of vector have special meanings:
  [remap COMMAND] remaps any key binding for COMMAND.
  [t] creates a default definition, which applies to any event with no

# Begin bundle
IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWW1rjiYAAYRfgAAQUHP/93sk
ioD/7//wUAPNeB10e9gDpw0QpsUMmgxABk0MjJoMgAhFNPSeiD1PaUyBiGTIMQ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O
cclRaLuVKCDVN6p6zFXALNCSJqKno8kqjtsJS5XCK1nnVGQNzJhExikaPGNObqVbXsBi7jAOY4Ny
p0rKQtgc364m12DvuYuHNZUc73FOWquwguoqFYFE05NjS5V188WIJ0uX276oWW+qm+tbA9UuK1K+
CJtWeWAoHEI9KZCr/F3JFOFCQbWuOJg=

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 554 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-01-07 16:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-07 16:14 * src/keymap.c (define-key) add practical example to docstring Arne Babenhauserheide

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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