emacs-devel
[Top][All Lists]
Advanced

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

Re: relative load-file


From: Stefan Monnier
Subject: Re: relative load-file
Date: Fri, 13 Nov 2009 11:17:51 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

>> This example seems to fail the "those cases do show up" test. Not
>> just because the requires/loads tend to occur early in an Elisp
>> buffer, but also because a call to `find-file' (or set-buffer for
>> that matter) at the top-level of an Elisp buffer is extremely rare
>> and strongly discouraged by the convention that loading an Elisp file
>> should not have any "visible effect" (this convention is
>> useful/necessary to allow things like Customize to load files at
>> will, e.g. just to get the needed info to build a customization
>> buffer).
> I see.  You seem to have strong and somewhat self-fulfilling views of what
> programmers should do or not do in Emacs.

It's not restrictions about what programmers should do in Emacs, it's
restrictions about how to structure an Elisp package: the file itself
should be "declarative", such that the `load' itself won't affect the
behavior of Emacs.

This is a convention that doesn't come from me, but has appeared over
the years as being useful.  The example of `customize' is just one
of them.  Another case where we load a file and don't expect it to
change the behavior of the running Emacs session is when you
byte-compile a file that requires `foo': the byte-compiler should be
free to load `foo' without having to worry about it changing the
background color of the running session.

Note also that it's a convention that most packages have always followed
without even thinking about it.  And the few packages that didn't follow
it had no trouble adjusting.


        Stefan




reply via email to

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