emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bastien <bzg@gnu.org>
To: Xebar Saram <zeltakc@gmail.com>
Cc: org mode <emacs-orgmode@gnu.org>
Subject: Re: binding org-id-goto to a key
Date: Sat, 01 Mar 2014 08:01:47 +0100	[thread overview]
Message-ID: <878usu9zc4.fsf@bzg.ath.cx> (raw)
In-Reply-To: <CAOQHXPpY8CXkSiupa=bsqN5NvGf3WWNV7H9BGhDahFdo7POXvg@mail.gmail.com>	(Xebar Saram's message of "Sat, 1 Mar 2014 07:27:04 +0200")

Hi Xebar,

Xebar Saram <zeltakc@gmail.com> writes:

> im trying to bind some headers to specific keys using the org-id-goto
> command and so far have this:
>
> (global-set-key (kbd "<f9> l") 'org-id-goto
> "8460d499-ea32-4693-a8d4-0d08b00ba3f3")
>
> but im aware that this code isnt wrong. can anyone guide me in the
> right direction?

(global-set-key (kbd "C-<f9>")
  (lambda ()
    (interactive)
      (org-id-goto "8460d499-ea32-4693-a8d4-0d08b00ba3f3")))


For (kbd "<f9> l") to work, you need to have f9 to be a prefix key,
so I changed it to (kbd "C-<f9>") for my own test.

(lambda () ...) is an anonymous function.

(interactive) makes the function an interactive command, which is
needed for the form to be bound to the key.

HTH,

-- 
 Bastien

  reply	other threads:[~2014-03-01  7:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-01  5:27 binding org-id-goto to a key Xebar Saram
2014-03-01  7:01 ` Bastien [this message]
2014-03-01 11:08   ` Xebar Saram

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=878usu9zc4.fsf@bzg.ath.cx \
    --to=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=zeltakc@gmail.com \
    /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).