From 8a500a91a222c6c8e9ae6c72e233f1512520504a Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sat, 30 Oct 2010 20:06:18 -0400 Subject: 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. --- lisp/emacs-lisp/package.el | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'lisp/emacs-lisp') 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)) -- cgit v1.2.3