From: Qiantan Hong <qthong@stanford.edu>
To: Phil Sainty <psainty@orcon.net.nz>
Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: Re: PACKAGE-FEATURES, and hot update of Emacs packages
Date: Sat, 27 Nov 2021 20:36:27 +0000 [thread overview]
Message-ID: <A775C648-D90E-4A19-837F-57B49079E5BE@stanford.edu> (raw)
In-Reply-To: <b4da24dd1595da27f2557ba15bf4a636@webmail.orcon.net.nz>
> 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!
next prev parent reply other threads:[~2021-11-27 20:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-27 9:31 PACKAGE-FEATURES, and hot update of Emacs packages Qiantan Hong
2021-11-27 10:09 ` Eli Zaretskii
2021-11-27 10:18 ` Qiantan Hong
2021-11-27 10:20 ` Qiantan Hong
2021-11-27 12:16 ` Phil Sainty
2021-11-27 13:30 ` Phil Sainty
2021-11-27 20:36 ` Qiantan Hong [this message]
2021-11-28 7:22 ` Phil Sainty
2021-11-28 7:51 ` Qiantan Hong
2021-11-28 1:04 ` Tim Cross
2021-11-28 4:23 ` Phil Sainty
2021-11-28 5:12 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=A775C648-D90E-4A19-837F-57B49079E5BE@stanford.edu \
--to=qthong@stanford.edu \
--cc=emacs-devel@gnu.org \
--cc=psainty@orcon.net.nz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.