emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Add-hook or org-defkey?
@ 2011-02-04 17:32 Nathan Neff
  2011-02-04 17:41 ` suvayu ali
  0 siblings, 1 reply; 2+ messages in thread
From: Nathan Neff @ 2011-02-04 17:32 UTC (permalink / raw)
  To: emacs-orgmode

I've seen both of these methods used to define/re-define keys
in org-agenda mode:

--------------- hook-way -------------------------
(add-hook 'org-agenda-mode-hook
             '(lambda ()
                (define-key org-agenda-mode-map "w" 'org-agenda-refile)
))

--------------- another way ----------------

(org-defkey org-agenda-mode-map "w" 'org-agenda-refile)

Is there an advantage to using one way versus the other?

Seems like the second way is simpler.

Thanks,
--Nate

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

* Re: Add-hook or org-defkey?
  2011-02-04 17:32 Add-hook or org-defkey? Nathan Neff
@ 2011-02-04 17:41 ` suvayu ali
  0 siblings, 0 replies; 2+ messages in thread
From: suvayu ali @ 2011-02-04 17:41 UTC (permalink / raw)
  To: Nathan Neff; +Cc: emacs-orgmode

On Fri, Feb 4, 2011 at 9:32 AM, Nathan Neff <nathan.neff@gmail.com> wrote:
> I've seen both of these methods used to define/re-define keys
> in org-agenda mode:
>
> --------------- hook-way -------------------------
> (add-hook 'org-agenda-mode-hook
>             '(lambda ()
>                (define-key org-agenda-mode-map "w" 'org-agenda-refile)
> ))
>
> --------------- another way ----------------
>
> (org-defkey org-agenda-mode-map "w" 'org-agenda-refile)
>
> Is there an advantage to using one way versus the other?
>
> Seems like the second way is simpler.

As far as I know if you are using the proper keymap (as in this case),
there is no difference. I would prefer the 2nd way.

>
> Thanks,
> --Nate

-- 
Suvayu

Open source is the future. It sets us free.

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

end of thread, other threads:[~2011-02-04 17:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-04 17:32 Add-hook or org-defkey? Nathan Neff
2011-02-04 17:41 ` suvayu ali

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