diff lisp/emacs-lisp/package.el @ 111244:6a10cca95d2b

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.
author Chong Yidong <cyd@stupidchicken.com>
date Sat, 30 Oct 2010 20:06:18 -0400
parents 947164fbfa46
children c133fe92297f
line wrap: on
line diff
--- a/lisp/emacs-lisp/package.el	Sat Oct 30 15:01:14 2010 +0000
+++ b/lisp/emacs-lisp/package.el	Sat Oct 30 20:06:18 2010 -0400
@@ -1037,10 +1037,13 @@
 (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 @@
 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))