emacs-devel
[Top][All Lists]
Advanced

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

Re: Question: loading code when two packages are load?


From: Qiantan Hong
Subject: Re: Question: loading code when two packages are load?
Date: Thu, 9 Sep 2021 02:05:50 +0000

> - Put the code inside an `with-eval-after-load`.

Thanks! This looks like exactly what I need.
I don’t understand why the manual says
"well-designed Lisp programs should not use with-eval-after-load”
and advocate for using require though. 
Isn’t with-eval-after-load exactly the lazy counterpart of require?

> Would the "autoload" facility solve this problem?

To my understanding autoload triggers file loading when function invoked,
while in my case I need to invoke function on file loading 
(to augment the behavior of that file).
It sounds like after-load-functions (although eval-after-load works as well
because we just need to target some specific packages),
but somehow manual says it’s an “abnormal hook” which I don’t really understand.

The Hooks for Loading info section seems to try very hard to
talk people out of using itself.


Best,
Qiantan


reply via email to

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