[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Orgmode] Re: What does it mean: (define-key mode-specific-map [?a] 'org
[Orgmode] Re: What does it mean: (define-key mode-specific-map [?a] 'org-agenda)
Sun, 07 Feb 2010 19:35:49 +0100
Gnus/5.13 (Gnus v5.13) Emacs/23.1.92 (gnu/linux)
"Krause, Joerg" <address@hidden> writes:
> After examining the manual and serveral sites, I still don't
> understand the term [?a] within that statement. Can anybody brighten
> my mind?
The square brackets say it's a vector, and ?x is the reader-syntax for
characters. So it's a vector with exactly one item, the character `a'.
So this statement binds the command `org-agenda' to the key `a' in the
You could have written any of the following with equal results:
(define-key mode-specific-map "?a" 'org-agenda)
(define-key mode-specific-map (kbd "a") 'org-agenda)
I prefer the `kbd' version. That understands the keybinding syntax that
is displayed in `C-h k', and which is used in all manuals, too.
,----[ C-h f kbd RET ]
| kbd is a Lisp macro in `subr.el'.
| (kbd KEYS)
| Convert KEYS to the internal Emacs key representation.
| KEYS should be a string constant in the format used for
| saving keyboard macros (see `edmacro-mode').