[Top][All Lists]

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

Re: interactive feel of Emacs: the need for speed, and -Q [measure.el]

From: chad
Subject: Re: interactive feel of Emacs: the need for speed, and -Q [measure.el]
Date: Thu, 23 Apr 2020 13:05:43 -0700

I long ago adopted the use of require in my .emacs file as a well-worn shorthand for "load this unless it's already loaded". Is there an alternative that I should be using instead? (Please forgive the thread necromancy; I just ran across this usage of require again today, and remembered this thread.)


On Thu, Apr 16, 2020 at 1:14 PM Stefan Monnier <address@hidden> wrote:
>>>>> Here are my requires:
>>> As a general rule, `require` should not appear in a `~/.emacs`.
>>> It's for use at the top of a library file.
> What's the replacement, then?
>> They should be replaced with the relevant (load-file "...autoloads").
> That doesn't do the same thing at all.  What if you want to use functions
> that are not autoloaded, or macros?

In your ~/.emacs?

Presumably if users can be expected to use a function/macro directly
from ~/.emacs, the package should mark that function/macro as autoloaded
(especially for macros; for functions this can often be avoided if the
function is expected to be called only from with the corresponding mode
hook or an `eval-after-load`).

If not, it's a case that doesn't fall within the "general rule" and then
you'd have to consider the details to know what *should* happen and what
can be done temporarily until the ideal situation can be applied.


reply via email to

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