emacs-devel
[Top][All Lists]
Advanced

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

RE: "Emacs Lisp Packages" chapter in the Emacs manual


From: Drew Adams
Subject: RE: "Emacs Lisp Packages" chapter in the Emacs manual
Date: Tue, 12 May 2020 08:46:42 -0700 (PDT)

> > If the file is needed simply because the user decided to split their
> > `.emacs` file into several separate files, then `load` (or `require`)
> > is probably fine.  That is the case where the file is a configuration
> > file, i.e. loading it changes Emacs's behavior.
> >
> > If OTOH that other file is a package/library which provides a
> > particular feature (in which case, loading the file *should not*
> > change Emacs's behavior), then usually what should be done is add a
> > few autoload`s to load the file on-demand.
> 
> Well, actually all this started because I wanted to install
> Drew's help-fns+.el and it happens that Drew uses "require".

Here's a half-hearted excuse/explanation.

Loading help-fns+.el is a user (or other-library) choice.
And yes, loading it does change behavior - that's the aim.
It's not a normal library, in that sense.  Conventionally,
loading a library should not change behavior.  Mea culpa.

No, the changes are not optional (e.g., the different
behavior is not provided by a minor mode).  It's meant to,
in effect, _replace_ some of what help-fns.el does, without
replacing all of its code.  Think patch, if you like.
After loading it, you have, in a way, patched some of
help-fns.el.

Two of the `require's are soft requires: no error if not
found.  Again, a user choice: if those libraries are not
present in `load-path' then nothing happens.  They're not
really required.

Two of the `require's are hard: help-fns.el, wid-edit.el.

Yes, this way of doing things doesn't perfectly respect
the coding guidelines.  But hopefully the Commentary makes
clear that the library changes some behavior.  For example,
it points out `describe-*' commands that it redefines.

> So, in case I want to add a similar feature set, would
> 'require be too much ? Would (autoload 'help-fns+) be
> sufficient ?
> 
> When I have the information about this, I think I can
> make a satisfactory patch to the manual :)
> 
> Keep in mind that this addition is for users who know
> a minimal subset of emacs lisp (enough to play with
> their init file), not for authors.



reply via email to

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