emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/native-comp 8db8c85 2/3: Always set `load-true-file-name' where


From: Andrea Corallo
Subject: feature/native-comp 8db8c85 2/3: Always set `load-true-file-name' where `load-file-name' is set too.
Date: Tue, 14 Apr 2020 13:52:04 -0400 (EDT)

branch: feature/native-comp
commit 8db8c851ad1568d61ed50a4d087e6de2b475cf5f
Author: Andrea Corallo <address@hidden>
Commit: Andrea Corallo <address@hidden>

    Always set `load-true-file-name' where `load-file-name' is set too.
    
        Fix bug#40620.
    
        * lisp/cus-dep.el (custom-make-dependencies): Set
        load-true-file-name.
    
        * lisp/emacs-lisp/package.el (package-quickstart-refresh):
        Likewise.
    
        * lisp/international/mule.el (load-with-code-conversion):
        Likewise.
    
        * lisp/loadup.el (load-true-file-name): Likewise.
---
 lisp/cus-dep.el             | 1 +
 lisp/emacs-lisp/autoload.el | 4 +++-
 lisp/emacs-lisp/package.el  | 3 ++-
 lisp/international/mule.el  | 5 +++--
 lisp/loadup.el              | 1 +
 5 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/lisp/cus-dep.el b/lisp/cus-dep.el
index fd307a5..e2c2ebe 100644
--- a/lisp/cus-dep.el
+++ b/lisp/cus-dep.el
@@ -90,6 +90,7 @@ Usage: emacs -batch -l ./cus-dep.el -f 
custom-make-dependencies DIRS"
             (string-match "\\`\\(.*\\)\\.el\\'" file)
             (let ((name (or generated-autoload-load-name ; see bug#5277
                             (file-name-nondirectory (match-string 1 file))))
+                  (load-true-file-name file)
                   (load-file-name file))
               (if (save-excursion
                     (re-search-forward
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el
index 6180bee..d9a43c2 100644
--- a/lisp/emacs-lisp/autoload.el
+++ b/lisp/emacs-lisp/autoload.el
@@ -167,7 +167,9 @@ expression, in which case we want to handle forms 
differently."
                        define-inline cl-defun cl-defmacro cl-defgeneric
                        cl-defstruct pcase-defmacro))
            (macrop car)
-          (setq expand (let ((load-file-name file)) (macroexpand form)))
+          (setq expand (let ((load-true-file-name file)
+                              (load-file-name file))
+                          (macroexpand form)))
           (memq (car expand) '(progn prog1 defalias)))
       (make-autoload expand file 'expansion)) ;Recurse on the expansion.
 
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 4312ab9..b33e489 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -3965,7 +3965,8 @@ activations need to be changed, such as when 
`package-load-list' is modified."
                 (let ((load-suffixes '(".el" ".elc")))
                   (locate-library (package--autoloads-file-name pkg))))
                (pfile (prin1-to-string file)))
-          (insert "(let ((load-file-name " pfile "))\n")
+          (insert "(let ((load-true-file-name " pfile ")\
+(load-file-name " pfile "))\n")
           (insert-file-contents file)
           ;; Fixup the special #$ reader form and throw away comments.
           (while (re-search-forward "#\\$\\|^;\\(.*\n\\)" nil 'move)
diff --git a/lisp/international/mule.el b/lisp/international/mule.el
index 72e8cad..363df13 100644
--- a/lisp/international/mule.el
+++ b/lisp/international/mule.el
@@ -320,8 +320,9 @@ Return t if file exists."
       (when purify-flag
        (push (purecopy file) preloaded-file-list))
       (unwind-protect
-         (let ((load-file-name fullname)
-               (set-auto-coding-for-load t)
+         (let ((load-true-file-name fullname)
+                (load-file-name fullname)
+                (set-auto-coding-for-load t)
                (inhibit-file-name-operation nil))
            (with-current-buffer buffer
               ;; So that we don't get completely screwed if the
diff --git a/lisp/loadup.el b/lisp/loadup.el
index 3cc47bc..7cf2cb0 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -566,6 +566,7 @@ lost after dumping")))
 ;; Don't keep `load-file-name' set during the top-level session!
 ;; Otherwise, it breaks a lot of code which does things like
 ;; (or load-file-name byte-compile-current-file).
+(setq load-true-file-name nil)
 (setq load-file-name nil)
 (eval top-level)
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]