diff options
| author | Stefan Monnier | 2023-05-22 18:49:26 +0200 |
|---|---|---|
| committer | Robert Pluim | 2023-05-23 14:12:21 +0200 |
| commit | 0abb79ca09a9d0118e2bae7a4d00cd8f8a537795 (patch) | |
| tree | 29378d2f7c7d7d8fccc46e68ddec913f88927b22 | |
| parent | 6f6071c52616cc30bc28083688a3ad8d70ce713e (diff) | |
| download | emacs-0abb79ca09a9d0118e2bae7a4d00cd8f8a537795.tar.gz emacs-0abb79ca09a9d0118e2bae7a4d00cd8f8a537795.zip | |
Avoid duplicates when adding package dirs to load-path
Do not merge to master, we're going to delete this code there.
* lisp/emacs-lisp/package.el (package-activate-1): Check if the path
we're about to add is already in 'load-path', since package autoload
files have been updating 'load-path' for a decade.
| -rw-r--r-- | lisp/emacs-lisp/package.el | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 0d90e4a4059..340ca9400fa 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el | |||
| @@ -904,7 +904,12 @@ correspond to previously loaded files." | |||
| 904 | (package--reload-previously-loaded pkg-desc)) | 904 | (package--reload-previously-loaded pkg-desc)) |
| 905 | (with-demoted-errors "Error loading autoloads: %s" | 905 | (with-demoted-errors "Error loading autoloads: %s" |
| 906 | (load (package--autoloads-file-name pkg-desc) nil t)) | 906 | (load (package--autoloads-file-name pkg-desc) nil t)) |
| 907 | (add-to-list 'load-path (directory-file-name pkg-dir))) | 907 | ;; FIXME: Since 2013 (commit 4fac34cee97a), the autoload files take |
| 908 | ;; care of changing the `load-path', so maybe it's time to | ||
| 909 | ;; remove this fallback code? | ||
| 910 | (unless (or (member (file-name-as-directory pkg-dir) load-path) | ||
| 911 | (member (directory-file-name pkg-dir) load-path)) | ||
| 912 | (add-to-list 'load-path pkg-dir))) | ||
| 908 | ;; Add info node. | 913 | ;; Add info node. |
| 909 | (when (file-exists-p (expand-file-name "dir" pkg-dir)) | 914 | (when (file-exists-p (expand-file-name "dir" pkg-dir)) |
| 910 | ;; FIXME: not the friendliest, but simple. | 915 | ;; FIXME: not the friendliest, but simple. |