diff options
| author | Stefan Monnier | 2013-08-28 13:57:12 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2013-08-28 13:57:12 -0400 |
| commit | 2d69b99e59e81113bf27faa209fb9b060f3244d4 (patch) | |
| tree | e339b5d66c408f9542695423163fa50828803d9c /lisp | |
| parent | 274919fde2998e88a7f52e8076f0e39322921f70 (diff) | |
| download | emacs-2d69b99e59e81113bf27faa209fb9b060f3244d4.tar.gz emacs-2d69b99e59e81113bf27faa209fb9b060f3244d4.zip | |
* lisp/emacs-lisp/package.el (package-activate-1): Don't add unnecessarily
to load-path.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/emacs-lisp/package.el | 15 |
2 files changed, 16 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0a07d90dd8f..712ec6c12b0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-08-28 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * emacs-lisp/package.el (package-activate-1): Don't add unnecessarily | ||
| 4 | to load-path. | ||
| 5 | |||
| 1 | 2013-08-28 Juri Linkov <juri@jurta.org> | 6 | 2013-08-28 Juri Linkov <juri@jurta.org> |
| 2 | 7 | ||
| 3 | * isearch.el (isearch-reread-key-sequence-naturally): Use non-nil | 8 | * isearch.el (isearch-reread-key-sequence-naturally): Use non-nil |
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 0085074e5be..d02bcef08c6 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el | |||
| @@ -457,19 +457,26 @@ Return the max version (as a string) if the package is held at a lower version." | |||
| 457 | 457 | ||
| 458 | (defun package-activate-1 (pkg-desc) | 458 | (defun package-activate-1 (pkg-desc) |
| 459 | (let* ((name (package-desc-name pkg-desc)) | 459 | (let* ((name (package-desc-name pkg-desc)) |
| 460 | (pkg-dir (package-desc-dir pkg-desc))) | 460 | (pkg-dir (package-desc-dir pkg-desc)) |
| 461 | (pkg-dir-dir (file-name-as-directory pkg-dir))) | ||
| 461 | (unless pkg-dir | 462 | (unless pkg-dir |
| 462 | (error "Internal error: unable to find directory for `%s'" | 463 | (error "Internal error: unable to find directory for `%s'" |
| 463 | (package-desc-full-name pkg-desc))) | 464 | (package-desc-full-name pkg-desc))) |
| 465 | ;; Add to load path, add autoloads, and activate the package. | ||
| 466 | (let ((old-lp load-path)) | ||
| 467 | (load (expand-file-name (format "%s-autoloads" name) pkg-dir) nil t) | ||
| 468 | (when (and (eq old-lp load-path) | ||
| 469 | (not (or (member pkg-dir load-path) | ||
| 470 | (member pkg-dir-dir load-path)))) | ||
| 471 | ;; Old packages don't add themselves to the `load-path', so we have to | ||
| 472 | ;; do it ourselves. | ||
| 473 | (push pkg-dir load-path))) | ||
| 464 | ;; Add info node. | 474 | ;; Add info node. |
| 465 | (when (file-exists-p (expand-file-name "dir" pkg-dir)) | 475 | (when (file-exists-p (expand-file-name "dir" pkg-dir)) |
| 466 | ;; FIXME: not the friendliest, but simple. | 476 | ;; FIXME: not the friendliest, but simple. |
| 467 | (require 'info) | 477 | (require 'info) |
| 468 | (info-initialize) | 478 | (info-initialize) |
| 469 | (push pkg-dir Info-directory-list)) | 479 | (push pkg-dir Info-directory-list)) |
| 470 | ;; Add to load path, add autoloads, and activate the package. | ||
| 471 | (push pkg-dir load-path) | ||
| 472 | (load (expand-file-name (format "%s-autoloads" name) pkg-dir) nil t) | ||
| 473 | (push name package-activated-list) | 480 | (push name package-activated-list) |
| 474 | ;; Don't return nil. | 481 | ;; Don't return nil. |
| 475 | t)) | 482 | t)) |