diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2010-10-30 20:06:18 -0400 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2010-10-30 20:06:18 -0400 |
commit | 8a500a91a222c6c8e9ae6c72e233f1512520504a (patch) | |
tree | 961b0b9b802b5f0c5b42817fa013e6f34ca2e08e /lisp/emacs-lisp | |
parent | 837ba704f88ac7d2b1935d1810d1574ec811a94f (diff) | |
download | emacs-8a500a91a222c6c8e9ae6c72e233f1512520504a.tar.gz emacs-8a500a91a222c6c8e9ae6c72e233f1512520504a.tar.bz2 emacs-8a500a91a222c6c8e9ae6c72e233f1512520504a.zip |
Check more carefully for packages before loading package.el.
* startup.el (command-line): Search for package directories, and
don't load package.el if none are found.
* emacs-lisp/package.el (describe-package, list-packages): Call
package-initialize if it has not been called yet.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/package.el | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index ea4c14e7cda..454036018be 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1037,10 +1037,13 @@ The variable `package-load-list' controls which packages to load." (defun describe-package (package) "Display the full documentation of PACKAGE (a symbol)." (interactive - (let* ((packages (append (mapcar 'car package-alist) + (let* ((guess (function-called-at-point)) + packages val) + ;; Initialize the package system if it's not. + (unless package-alist + (package-initialize)) + (setq packages (append (mapcar 'car package-alist) (mapcar 'car package-archive-contents))) - (guess (function-called-at-point)) - val) (unless (memq guess packages) (setq guess nil)) (setq packages (mapcar 'symbol-name packages)) @@ -1617,6 +1620,9 @@ list; the default is to display everything in `package-alist'." Fetches the updated list of packages before displaying. The list is displayed in a buffer named `*Packages*'." (interactive) + ;; Initialize the package system if necessary. + (unless package-alist + (package-initialize)) (package-refresh-contents) (package--list-packages)) |