Commit 2d69b99e authored by Stefan Monnier's avatar Stefan Monnier

* lisp/emacs-lisp/package.el (package-activate-1): Don't add unnecessarily

to load-path.
parent 274919fd
2013-08-28 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/package.el (package-activate-1): Don't add unnecessarily
to load-path.
2013-08-28 Juri Linkov <juri@jurta.org> 2013-08-28 Juri Linkov <juri@jurta.org>
* isearch.el (isearch-reread-key-sequence-naturally): Use non-nil * isearch.el (isearch-reread-key-sequence-naturally): Use non-nil
......
...@@ -457,19 +457,26 @@ Return the max version (as a string) if the package is held at a lower version." ...@@ -457,19 +457,26 @@ Return the max version (as a string) if the package is held at a lower version."
(defun package-activate-1 (pkg-desc) (defun package-activate-1 (pkg-desc)
(let* ((name (package-desc-name pkg-desc)) (let* ((name (package-desc-name pkg-desc))
(pkg-dir (package-desc-dir pkg-desc))) (pkg-dir (package-desc-dir pkg-desc))
(pkg-dir-dir (file-name-as-directory pkg-dir)))
(unless pkg-dir (unless pkg-dir
(error "Internal error: unable to find directory for `%s'" (error "Internal error: unable to find directory for `%s'"
(package-desc-full-name pkg-desc))) (package-desc-full-name pkg-desc)))
;; Add to load path, add autoloads, and activate the package.
(let ((old-lp load-path))
(load (expand-file-name (format "%s-autoloads" name) pkg-dir) nil t)
(when (and (eq old-lp load-path)
(not (or (member pkg-dir load-path)
(member pkg-dir-dir load-path))))
;; Old packages don't add themselves to the `load-path', so we have to
;; do it ourselves.
(push pkg-dir load-path)))
;; Add info node. ;; Add info node.
(when (file-exists-p (expand-file-name "dir" pkg-dir)) (when (file-exists-p (expand-file-name "dir" pkg-dir))
;; FIXME: not the friendliest, but simple. ;; FIXME: not the friendliest, but simple.
(require 'info) (require 'info)
(info-initialize) (info-initialize)
(push pkg-dir Info-directory-list)) (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)
(push name package-activated-list) (push name package-activated-list)
;; Don't return nil. ;; Don't return nil.
t)) t))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment