]> git.eshelyaron.com Git - emacs.git/commitdiff
Two `load-history' eln related fixes.
authorAndrea Corallo <akrl@sdf.org>
Sun, 21 Jun 2020 18:52:52 +0000 (20:52 +0200)
committerAndrea Corallo <akrl@sdf.org>
Sun, 21 Jun 2020 22:15:36 +0000 (00:15 +0200)
* 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
src/lread.c

index bff10003f848a106507d016348870ad3548c5d99..e58f27e7ebc6c1b42d5d25809cc30c3462583f06 100644 (file)
@@ -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))
index 0530848c2b7e27a9740f52228aceeed36a7c32d5..f5a7d44a1e07c9cce7e08ae37f6035156d102527 100644 (file)
@@ -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);
        }