Hi all,
I find package.el will add duplicate package path to load-path.
One is (push pkg-dir load-path) in package-activate-1,
another is
(add-to-list 'load-path (or (file-name-directory #$) (car load-path)))
in the generated PACKAGE-autoloads.el which will be also loaded in package-activate-1.
The following patch provides one way of fixing this:
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index add73fd..c5706bf 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -468,8 +468,8 @@ Return the max version (as a string) if the package is held at a lower version."
(info-initialize)
(push pkg-dir Info-directory-list))
;; Add to load path, add autoloads, and activate the package.
- (push pkg-dir load-path)
- (load (expand-file-name (format "%s-autoloads" name) pkg-dir) nil t)
+ (unless (load (expand-file-name (format "%s-autoloads" name) pkg-dir) nil t)
+ (push pkg-dir load-path))
(push name package-activated-list)
;; Don't return nil.
t))
Hope it helps.
Regards,
Levin Du