emacs-devel
[Top][All Lists]
Advanced

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

Re: PACKAGE-FEATURES, and hot update of Emacs packages


From: Qiantan Hong
Subject: Re: PACKAGE-FEATURES, and hot update of Emacs packages
Date: Sat, 27 Nov 2021 20:36:27 +0000

> Unloading a feature will trash the user's configuration, and so when
> you load the updated library only the default config will be set --
> unless the user used `eval-after-load' (which certainly can't be
> assumed).  As such, I don't think that could work as a reliable "hot
> update" process.
I think if the user doesn’t use eval-after-load
(which I assumed is actually used a lot because the popularity
of lazy-loading in init.el) and instead do 
(require f) …configs…
eagerly, that makes the init feature depends on feature f.
To have consistent behavior we just need to also reload
all dependents of the package.

> My approach to this general issue (in libraries I've written) has been
> to detect at load time if the user had an older version of the library
> loaded, and to perform any appropriate in-place upgrades.  E.g.:
> https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/so-long.el?id=aebba085cba1#n2012
This require the user to reload the file.
Currently if the old package is not unloaded, the feature is still
present and (require p) does nothing.
It might be trivial to do so for a single-file/feature package,
but less so for a multi-file or even directory-nested one.
Is there a reasonable way to do it?

It seems that an adhoc way would be to remove 
(package-features p) from features without actually unloading,
and then (require p). It also requires PACKAGE-FEATURES!

reply via email to

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