unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: emacs-devel@gnu.org
Subject: Re: pkg-autoloads.el vs. pkg-loaddefs.el
Date: Wed, 19 Jun 2024 11:58:28 -0400	[thread overview]
Message-ID: <jwv8qz16icf.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87h6dp9cde.fsf@localhost> (Ihor Radchenko's message of "Wed, 19 Jun 2024 15:32:45 +0000")

>>> May an approach like `require-with-check' be used here?  Then, the
>>> reloading only occurs when there is a potential mixing of package
>>> versions.
>>
>> Could be, tho I'm not sure exactly what "an approach like
>> `require-with-check`" would look like.
>
> Something like
>
> (defun package-activate-1...
> ...
>
> (let ((autoload-feature (intern (format "%s-autoloads"
>                              (package-desc-name pkg-desc)))))
>   (when (and (featurep autoload-feature)
>              (require-with-check autoload-feature nil 'reload))
>     ;; If pkg-autoload.el is already loaded from a different path,
>     ;; reload the package.
>     (warn ...)
>     (setq reload t)))
>     
> (when reload
>   (package--reload-previously-loaded pkg-desc))
>   
> (with-demoted-errors "Error loading autoloads: %s"
>   (load (package--autoloads-file-name pkg-desc) nil t))

Hmm... I wonder when that `featurep` test would trigger, tho.

E.g. for Org usually the "old already loaded Org" is the one from Emacs
which doesn't come with an `org-autoloads.el`.

As for the case where we've already loaded an older version of an
ELPA package, this requires two versions of the same ELPA package which
is unusual (except during an upgrade, but that case already passes the
`reload` arg).


        Stefan




  reply	other threads:[~2024-06-19 15:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-20 12:56 pkg-autoloads.el vs. pkg-loaddefs.el Ihor Radchenko
2024-06-14 13:54 ` Stefan Monnier via Emacs development discussions.
2024-06-17 13:45   ` Ihor Radchenko
2024-06-17 14:04     ` Stefan Monnier
2024-06-18 16:00       ` Ihor Radchenko
2024-06-18 17:23         ` Stefan Monnier
2024-06-18 17:39           ` Ihor Radchenko
2024-06-18 19:43             ` Stefan Monnier
2024-06-18 20:03               ` Ihor Radchenko
2024-06-18 20:12                 ` Stefan Monnier
2024-06-19 15:32                   ` Ihor Radchenko
2024-06-19 15:58                     ` Stefan Monnier [this message]
2024-06-19 16:22                       ` Ihor Radchenko
2024-06-19 20:35                         ` Stefan Monnier
2024-06-20  5:01                           ` Eli Zaretskii
2024-06-20 15:33                           ` Ihor Radchenko

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv8qz16icf.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=yantar92@posteo.net \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).