all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Pogonyshev <pogonyshev@gmail.com>
To: 56614@debbugs.gnu.org
Subject: bug#56614: two problems with `package--reload-previously-loaded'
Date: Sun, 17 Jul 2022 14:42:47 +0200	[thread overview]
Message-ID: <CAG7Bpar5bUhDmgH_O3WvUtg2kamHXrrVpQhr8PQCxc9u0UGbFw@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1552 bytes --]

Commit 9dfd945a2c added function `package--reload-previously-loaded'.
Previously package library would just always reload all package files
(except its autoloads), new function tries to be smart and avoid reloading
unneeded things, presumably for performance reasons.

However, this has created at least two problems for Eldev (
https://github.com/doublep/eldev), Elisp development tool.

1. Function excludes package's current directory, see variable
`load-path-sans-dir'. This is problematic if a package is reinstalled from
the same directory after changes have been made. I know this is not how
things usually work, but it seems to create problems for no reason: if the
same directory is never used, why bother about it here? Normal usecases are
not affected at all, why "special" usecases that reuse the same directory
suffer.

2. When searching in `load-history', the function ignores changes from
byte-compiled to source and vice versa, i.e. `.el' -> `.elc' and `.elc' ->
`.el'. In other words, if you replace a byte-compiled file with a
non-compiled (or vice versa), it never gets reloaded. A simple fix (having
zero effect in normal usecases) would be e.g. this:

        (truename (file-truename canonical))
        (found (or (member truename history)
                   (member (if (string-suffix-p ".el" truename)
                               (replace-regexp-in-string (rx ".el" eos)
".elc" truename t)
                             (replace-regexp-in-string (rx ".elc" eos)
".el" truename t))
                           history)))

Paul

[-- Attachment #2: Type: text/html, Size: 1921 bytes --]

             reply	other threads:[~2022-07-17 12:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-17 12:42 Paul Pogonyshev [this message]
2022-07-23  8:30 ` bug#56614: two problems with `package--reload-previously-loaded' Lars Ingebrigtsen
2022-07-24  9:02   ` Paul Pogonyshev
2022-07-24  9:06     ` Lars Ingebrigtsen
     [not found] ` <jwv5ye8xxit.fsf-monnier+emacs@gnu.org>
     [not found]   ` <CAG7Bparvk4=u992jdmgNqnsjYajDnjupDhhsHRksW38SERcuLA@mail.gmail.com>
2022-12-18 23:48     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-19  9:07       ` Paul Pogonyshev

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=CAG7Bpar5bUhDmgH_O3WvUtg2kamHXrrVpQhr8PQCxc9u0UGbFw@mail.gmail.com \
    --to=pogonyshev@gmail.com \
    --cc=56614@debbugs.gnu.org \
    /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.