mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
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.
This commit is contained in:
parent
837ba704f8
commit
8a500a91a2
3 changed files with 41 additions and 5 deletions
|
|
@ -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))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue