all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] package.el: remove duplicated package path in load-path
@ 2013-08-28  7:11 Levin Du
  2013-08-28 17:57 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Levin Du @ 2013-08-28  7:11 UTC (permalink / raw)
  To: emacs-devel@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1090 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1600 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-08-28 17:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-28  7:11 [PATCH] package.el: remove duplicated package path in load-path Levin Du
2013-08-28 17:57 ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.