--- ../emacs/lisp/emacs-lisp/package.el 2021-07-11 12:20:59.257657537 +0200 +++ ./package.el 2021-07-20 02:01:38.050169037 +0200 @@ -4137,7 +4137,8 @@ (package-activated-list ()) ;; Make sure we can load this file without load-source-file-function. (coding-system-for-write 'emacs-internal) - (Info-directory-list '(""))) + (Info-directory-list '("")) + paths) (dolist (elt package-alist) (condition-case err (package-activate (car elt)) @@ -4155,6 +4156,7 @@ (let ((load-suffixes '(".el" ".elc"))) (locate-library (package--autoloads-file-name pkg)))) (pfile (prin1-to-string file))) + (push (package-desc-dir pkg) paths) (insert "(let ((load-true-file-name " pfile ")\ (load-file-name " pfile "))\n") (insert-file-contents file) @@ -4164,6 +4166,10 @@ (replace-match (if (match-end 1) "" pfile) t t))) (unless (bolp) (insert "\n")) (insert ")\n"))) + (goto-char (point-min)) + (while (re-search-forward "^(add-to-list.*load-path" nil t) + (goto-char (line-beginning-position)) + (kill-sexp)) (pp `(setq package-activated-list (append ',(mapcar #'package-desc-name package--quickstart-pkgs) package-activated-list)) @@ -4175,6 +4181,10 @@ (setq Info-directory-list (append ',info-dirs Info-directory-list))) (current-buffer)))) + (goto-char (point-min)) + (forward-line 3) + (insert (concat "\n(nconc load-path '" (prin1-to-string paths) ")\n")) + (goto-char (point-max)) ;; Use `\s' instead of a space character, so this code chunk is not ;; mistaken for an actual file-local section of package.el. (insert "