emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tassilo@member.fsf.org>
To: emacs-orgmode@gnu.org
Subject: Re: What does it mean: (define-key mode-specific-map [?a] 'org-agenda)
Date: Sun, 07 Feb 2010 19:35:49 +0100	[thread overview]
Message-ID: <871vgwc2re.fsf@thinkpad.tsdh.de> (raw)
In-Reply-To: 942B3B793327BB4DA113CF35156A0A480EB112@GCVMAIL2.corp.geze.com

"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

      parent reply	other threads:[~2010-02-07 18:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871vgwc2re.fsf@thinkpad.tsdh.de \
    --to=tassilo@member.fsf.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).