mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
* lisp/emacs-lisp/package.el: Don't recompute dir. Use pkg-descs more.
(package-desc): Add `dir' field. (package-desc-full-name): New function. (package-load-descriptor): Combine the two arguments. Don't use `load'. (package-maybe-load-descriptor): Remove. (package-load-all-descriptors): Just call package-load-descriptor. (package--disabled-p): New function. (package-desc-vers, package-desc-doc): Remove aliases. (package--dir): Remove function. (package-activate): Check if a package is disabled. (package-process-define-package): New function, extracted from define-package. (define-package): Turn into a place holder. (package-unpack-single, package-tar-file-info): Use package--description-file. (package-compute-transaction): Use package--disabled-p. (package-download-transaction): Don't call package-maybe-load-descriptor since they're all loaded anyway. (package-install): Change argument to be a pkg-desc. (package-delete): Use a single pkg-desc argument. (describe-package-1): Use package-desc-dir instead of package--dir. Use package-desc property instead of package-symbol. (package-install-button-action): Adjust accordingly. (package--push): Rewrite. (package-menu--print-info): Adjust accordingly. Change the ID format to be a pkg-desc. (package-menu-describe-package, package-menu-get-status) (package-menu--find-upgrades, package-menu-mark-upgrades) (package-menu-execute, package-menu--name-predicate): Adjust accordingly. * lisp/startup.el (package--description-file): New function. (command-line): Use it. * lisp/emacs-lisp/package-x.el (package-upload-buffer-internal): Use package-desc-version.
This commit is contained in:
parent
0b31660d3c
commit
1b8dff239b
4 changed files with 242 additions and 225 deletions
|
|
@ -422,6 +422,13 @@ The second subexpression is the version string.
|
|||
The regexp should not contain a starting \"\\`\" or a trailing
|
||||
\"\\'\"; those are added automatically by callers.")
|
||||
|
||||
(defun package--description-file (dir)
|
||||
(concat (let ((subdir (file-name-nondirectory
|
||||
(directory-file-name dir))))
|
||||
(if (string-match package-subdirectory-regexp subdir)
|
||||
(match-string 1 subdir) subdir))
|
||||
"-pkg.el"))
|
||||
|
||||
(defun normal-top-level-add-subdirs-to-load-path ()
|
||||
"Add all subdirectories of `default-directory' to `load-path'.
|
||||
More precisely, this uses only the subdirectories whose names
|
||||
|
|
@ -1194,10 +1201,10 @@ the `--debug-init' option to view a complete error backtrace."
|
|||
(dolist (dir dirs)
|
||||
(when (file-directory-p dir)
|
||||
(dolist (subdir (directory-files dir))
|
||||
(when (and (file-directory-p (expand-file-name subdir dir))
|
||||
(string-match
|
||||
(concat "\\`" package-subdirectory-regexp "\\'")
|
||||
subdir))
|
||||
(when (let ((subdir (expand-file-name subdir dir)))
|
||||
(and (file-directory-p subdir)
|
||||
(file-exists-p
|
||||
(package--description-file subdir))))
|
||||
(throw 'package-dir-found t)))))))
|
||||
(package-initialize))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue