GNU bug report logs - #49009
27.1.90; files loaded with -l flag does not use file-truename as required by eval-after-load

Previous Next

Package: emacs;

Reported by: ctarbide <at> tuta.io

Date: Sun, 13 Jun 2021 22:29:02 UTC

Severity: normal

Tags: patch

Found in version 27.1.90

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 49009 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: ctarbide <at> tuta.io
Cc: 49009 <at> debbugs.gnu.org
Subject: Re: bug#49009: 27.1.90; files loaded with -l flag does not use
 file-truename as required by eval-after-load
Date: Mon, 14 Jun 2021 15:38:12 +0200
ctarbide <at> tuta.io writes:

> if the test.el file above is in a non-true path, e.g. a parent dir is a
> symlink, and test.el has an eval-after-load for itself, the eval-after-load
> form will not be evaluated, the reason is that startup.el does not use
> file-truename while loading file, the change below solved the issue:
>
> -  (file-ex (expand-file-name file)))
> +  (file-ex (file-truename (expand-file-name file))))

There's two of these, so here's the proposed patch, I think.

This seems reasonable to me -- anybody else have any comments?  I was
wondering whether there may be edge cases where this may lead to
unintended consequences...

diff --git a/lisp/startup.el b/lisp/startup.el
index ac319612e8..456c01efd1 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -2500,7 +2500,7 @@ command-line-1
                                    (or argval (pop command-line-args-left))))
                             ;; Take file from default dir if it exists there;
                             ;; otherwise let `load' search for it.
-                            (file-ex (expand-file-name file)))
+                            (file-ex (file-truename (expand-file-name file))))
                        (when (file-regular-p file-ex)
                          (setq file file-ex))
                        (load file nil t)))
@@ -2511,7 +2511,7 @@ command-line-1
                      (let* ((file (command-line-normalize-file-name
                                    (or argval (pop command-line-args-left))))
                             ;; Take file from default dir.
-                            (file-ex (expand-file-name file)))
+                            (file-ex (file-truename (expand-file-name file))))
                        (load file-ex nil t t)))
 
                     ((equal argi "-insert")


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 3 years and 334 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.