From f0e9fdd1f9a9989b457cbc382e0cf12c161a8e6c Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Sun, 21 Jun 2020 20:52:52 +0200 Subject: [PATCH] Two `load-history' eln related fixes. * src/lread.c (Fload): Fix `load-history' filling for elns non in root lisp-dir. * lisp/startup.el (command-line): Fix `load-history' fixup algorith for eln files. --- lisp/startup.el | 7 ++++++- src/lread.c | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/startup.el b/lisp/startup.el index bff10003f84..e58f27e7ebc 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -1061,7 +1061,12 @@ please check its value") (unless (file-readable-p lispdir) (princ (format "Lisp directory %s not readable?" lispdir)) (terpri))) - (setq lisp-dir (file-truename (file-name-directory simple-file-name))) + (setq lisp-dir + (file-truename + (if (string-match "\\.eln\\'" simple-file-name) + (expand-file-name + (concat (file-name-directory simple-file-name) "../")) + (file-name-directory simple-file-name)))) (setq load-history (mapcar (lambda (elt) (if (and (stringp (car elt)) diff --git a/src/lread.c b/src/lread.c index 0530848c2b7..f5a7d44a1e0 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1506,7 +1506,8 @@ Return t if the file exists and loads successfully. */) specbind (Qcurrent_load_list, Qnil); if (!NILP (Vpurify_flag)) { - Lisp_Object base = parent_directory (Ffile_name_directory (found)); + Lisp_Object base = concat2 (parent_directory (Vinvocation_directory), + build_string ("lisp/")); Lisp_Object offset = Flength (base); hist_file_name = Fsubstring (found, offset, Qnil); } -- 2.39.5