[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#49009: 27.1.90; files loaded with -l flag does not use file-truename
From: |
Lars Ingebrigtsen |
Subject: |
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 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
ctarbide@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