Mercurial > emacs
comparison 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 |
comparison
equal
deleted
inserted
replaced
111243:0989a3a741bd | 111244:6a10cca95d2b |
---|---|
1035 | 1035 |
1036 ;;;###autoload | 1036 ;;;###autoload |
1037 (defun describe-package (package) | 1037 (defun describe-package (package) |
1038 "Display the full documentation of PACKAGE (a symbol)." | 1038 "Display the full documentation of PACKAGE (a symbol)." |
1039 (interactive | 1039 (interactive |
1040 (let* ((packages (append (mapcar 'car package-alist) | 1040 (let* ((guess (function-called-at-point)) |
1041 packages val) | |
1042 ;; Initialize the package system if it's not. | |
1043 (unless package-alist | |
1044 (package-initialize)) | |
1045 (setq packages (append (mapcar 'car package-alist) | |
1041 (mapcar 'car package-archive-contents))) | 1046 (mapcar 'car package-archive-contents))) |
1042 (guess (function-called-at-point)) | |
1043 val) | |
1044 (unless (memq guess packages) | 1047 (unless (memq guess packages) |
1045 (setq guess nil)) | 1048 (setq guess nil)) |
1046 (setq packages (mapcar 'symbol-name packages)) | 1049 (setq packages (mapcar 'symbol-name packages)) |
1047 (setq val | 1050 (setq val |
1048 (completing-read (if guess | 1051 (completing-read (if guess |
1615 (defun list-packages () | 1618 (defun list-packages () |
1616 "Display a list of packages. | 1619 "Display a list of packages. |
1617 Fetches the updated list of packages before displaying. | 1620 Fetches the updated list of packages before displaying. |
1618 The list is displayed in a buffer named `*Packages*'." | 1621 The list is displayed in a buffer named `*Packages*'." |
1619 (interactive) | 1622 (interactive) |
1623 ;; Initialize the package system if necessary. | |
1624 (unless package-alist | |
1625 (package-initialize)) | |
1620 (package-refresh-contents) | 1626 (package-refresh-contents) |
1621 (package--list-packages)) | 1627 (package--list-packages)) |
1622 | 1628 |
1623 ;;;###autoload | 1629 ;;;###autoload |
1624 (defalias 'package-list-packages 'list-packages) | 1630 (defalias 'package-list-packages 'list-packages) |