[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] package.el: remove duplicated package path in load-path

From: Levin Du
Subject: [PATCH] package.el: remove duplicated package path in load-path
Date: Wed, 28 Aug 2013 15:11:25 +0800

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."
       (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.

Hope it helps.

Levin Du

reply via email to

[Prev in Thread] Current Thread [Next in Thread]