[Top][All Lists]

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

Re: Why js2-mode in Emacs 23.2?

From: Leo
Subject: Re: Why js2-mode in Emacs 23.2?
Date: Mon, 10 Aug 2009 14:04:38 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

On 2009-08-10 11:41 +0100, Carsten Dominik wrote:
> I see. Still, I can imagine good use cases for it. For example, if
> your package needs to do some tweaking to correctly interact with some
> library, but if that library is only used by very few people. In this
> case you'd want to avoid loading the library just to apply your
> tweaks. 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))))))
> When imenu jumps into a location in a file that is hidden by outline
> folding, then the context of point needs to be revealed. However,
> loading imenu just to do this setup is useless for user who do use
> imenu at all.

I heavily use eval-after-load in my .emacs.

It seems to me that when there is a need to use eval-after-load in a
package included in Emacs some bad-design is happening. For example,
imenu probably needs to provide a better interface for other packages to
interact with it. What org is doing, in this case, is using
eval-after-load to workaround it. Anyway I am not sure, maybe RMS or the
maintainer could clarify on the use of eval-after-load.



Leo's Emacs uptime: 6 days, 12 hours, 54 minutes, 23 seconds

reply via email to

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