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: Sun, 28 Nov 2021 07:51:33 +0000 [thread overview]
Message-ID: <01289E64-0B62-4463-9287-8D509EB9895F@stanford.edu> (raw)
In-Reply-To: <1b4dbbf030bcb92ea47c46efa4c246f3@webmail.orcon.net.nz>
>> Currently if the old package is not unloaded, the feature is still
>> present and (require p) does nothing.
>
> Certainly `require' won't do anything, but nothing prevents you from
> using `load-library' for for the same list of libraries that you were
> planning to unload.
For a multi-file package, does (load-library entry-feature) also
loads the other files? I suppose it doesn’t because usually
the entry-feature use REQUIRE instead of LOAD-LIBRARY
to load its “components”.
An adhoc solution would be to temporarily override the definition
of REQUIRE that perform LOAD-LIBRARY if the feature to be
required is part of the package. It seems that we still need
PACKAGE-FEATURES to test it… still, it sounds super ad-hoc,
not sure how bad an idea it is.
Or maybe we can upgrade REQUIRE itself so that it reloads
when a feature file is modified?
> You can't be certain that's going to be safe, though. Reloading a
> library is expected to be safe when the code is unchanged, but there's
> no requirement that I'm aware of to support loading new code over the
> old code -- that will often be fine in practice, but there's loads of
> scope for it not to be.
Your so-long library seems to have provided an excellent example
of supporting it, so I suppose it’s very doable in general.
> And as before, I don't think it's valid to unload things (even if you
> could be confident that everything supported being unloaded) because
> you destroy the configuration.
>
> I can't think of a way to reliably do what you're suggesting in the
> general case. Each approach will work in certain circumstances, but
> I don't think any approach is *generally* reliable.
As I suggested, reloading all packages/features dependent on a particular
package seems to do the trick, at least it will recover the init configs.
The conceptual model is also very clear — the operation basically
recover a part of the image state from external file system,
sort of like loading an incremental image.
It might also be useful when the user corrupted the state of a particular
package and want to recover it.
In case that such recursive reloading might result in reloading too many
packages, we might provide a switch for recursive/non-recursive reloading,
and present a list of packages to be reloaded for the user to confirm.
Maybe we can have both :unloadable and :reloadable,
reload should be used in possible, and unload-then-load
can be used as a fallback or rescuing operation.
Best,
Qiantan
next prev parent reply other threads:[~2021-11-28 7:51 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
2021-11-28 7:22 ` Phil Sainty
2021-11-28 7:51 ` Qiantan Hong [this message]
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=01289E64-0B62-4463-9287-8D509EB9895F@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.