[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why js2-mode in Emacs 23.2?

From: Glenn Morris
Subject: Re: Why js2-mode in Emacs 23.2?
Date: Mon, 10 Aug 2009 21:13:11 -0400
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

Carsten Dominik wrote:

> I'd say this is a good case for using eval-after-load in a normal
> Emacs library.
> Here is an example from Org-mode:
> (eval-after-load "imenu"
>   '(progn
>      (add-hook 'imenu-after-jump-hook
>              (lambda ()
>                (if (eq major-mode 'org-mode)
>                    (org-show-context 'org-goto))))))
> However, loading imenu just to do this setup is useless for user who
> do use imenu at all.

That would work just fine without eval-after-load or requiring imenu.
A hook does not need to be defined before calling add-hook.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]