all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Levin Du <zslevin@gmail.com>
To: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: [PATCH] package.el: remove duplicated package path in load-path
Date: Wed, 28 Aug 2013 15:11:25 +0800	[thread overview]
Message-ID: <CAN6cQGPuNb9y9ieqkZbrziHdvvMa-Z2Eikf1yR=HpiwtbvoZtw@mail.gmail.com> (raw)

[-- 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 --]

             reply	other threads:[~2013-08-28  7:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-28  7:11 Levin Du [this message]
2013-08-28 17:57 ` [PATCH] package.el: remove duplicated package path in load-path Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAN6cQGPuNb9y9ieqkZbrziHdvvMa-Z2Eikf1yR=HpiwtbvoZtw@mail.gmail.com' \
    --to=zslevin@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.