1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-18 18:05:07 +00:00

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.
This commit is contained in:
Andrea Corallo 2020-04-14 19:58:41 +01:00
parent 8decfbe4d7
commit 8db8c851ad
5 changed files with 10 additions and 4 deletions

View File

@ -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

View File

@ -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.

View File

@ -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)

View File

@ -320,7 +320,8 @@ Return t if file exists."
(when purify-flag
(push (purecopy file) preloaded-file-list))
(unwind-protect
(let ((load-file-name fullname)
(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

View File

@ -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)