emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* What does it mean: (define-key mode-specific-map [?a] 'org-agenda)
@ 2010-02-07 18:14 Krause, Joerg
  2010-02-07 18:30 ` Matt Lundin
  2010-02-07 18:35 ` Tassilo Horn
  0 siblings, 2 replies; 3+ messages in thread
From: Krause, Joerg @ 2010-02-07 18:14 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1.1: Type: text/plain, Size: 676 bytes --]

Hi to all,

I copied an orgmode setup from http://www.newartisans.com/2007/08/using-org-mode-as-a-day-planner.html in order to test the described way of GTDing there. Since it works fine for me, I am trying to understand, what's going on beyond the surface. I found the expression above in the setup elisp file. After examining the manual and serveral sites, I still don't understand the term [?a] within that statement. Can anybody brighten my mind?

Thank you all!



i.A. Jörg Krause


Informationstechnologie / IT
GEZE GmbH

Reinhold-Vöster-Straße 21-29
D-71229 Leonberg
Phone:  +49 7152 203-421
Fax:    +49 7152 203-77421
E-Mail: j.krause@geze.com



[-- Attachment #1.1.2: Type: text/html, Size: 1798 bytes --]

[-- Attachment #1.2: Type: image/jpeg, Size: 25134 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: What does it mean: (define-key mode-specific-map [?a] 'org-agenda)
  2010-02-07 18:14 What does it mean: (define-key mode-specific-map [?a] 'org-agenda) Krause, Joerg
@ 2010-02-07 18:30 ` Matt Lundin
  2010-02-07 18:35 ` Tassilo Horn
  1 sibling, 0 replies; 3+ messages in thread
From: Matt Lundin @ 2010-02-07 18:30 UTC (permalink / raw)
  To: Krause, Joerg; +Cc: emacs-orgmode

"Krause, Joerg" <j.krause@geze.com> writes:

> I copied an orgmode setup from http://www.newartisans.com/2007/08/
> using-org-mode-as-a-day-planner.html in order to test the described way
> of GTDing there. Since it works fine for me, I am trying to understand,
> what's going on beyond the surface. I found the expression above in the
> setup elisp file. After examining the manual and serveral sites, I
> still don't understand the term [?a] within that statement. Can anybody
> brighten my mind?

I assume you are referring to the following line?

(define-key mode-specific-map [?a] 'org-agenda)

This line binds org-agenda to "C-c a". (You can checkout the
documentation for mode-specific-map by typing "C-h v
mode-specific-map").

The org-manual suggests the following line, which does the same thing:

(global-set-key "\C-ca" 'org-agenda)

Best,
Matt

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

* Re: What does it mean: (define-key mode-specific-map [?a] 'org-agenda)
  2010-02-07 18:14 What does it mean: (define-key mode-specific-map [?a] 'org-agenda) Krause, Joerg
  2010-02-07 18:30 ` Matt Lundin
@ 2010-02-07 18:35 ` Tassilo Horn
  1 sibling, 0 replies; 3+ messages in thread
From: Tassilo Horn @ 2010-02-07 18:35 UTC (permalink / raw)
  To: emacs-orgmode

"Krause, Joerg" <j.krause@geze.com> writes:

Hi Jörg,

> 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
keymap `mode-specific-map'.

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

Bye,
Tassilo

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

end of thread, other threads:[~2010-02-07 18:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-07 18:14 What does it mean: (define-key mode-specific-map [?a] 'org-agenda) Krause, Joerg
2010-02-07 18:30 ` Matt Lundin
2010-02-07 18:35 ` Tassilo Horn

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

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).