diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2013-06-13 23:20:18 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2013-06-13 23:20:18 -0400 |
commit | 1b8dff239bf8091a75572064ff8fb085f3c073d6 (patch) | |
tree | d3f518d514fef3fc8eb54e36cccd25c083d32bd1 /lisp/startup.el | |
parent | 0b31660d3c10a0f8e243dd67bd0ecaf2c847d1e6 (diff) | |
download | emacs-1b8dff239bf8091a75572064ff8fb085f3c073d6.tar.gz |
* 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.
Diffstat (limited to 'lisp/startup.el')
-rw-r--r-- | lisp/startup.el | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lisp/startup.el b/lisp/startup.el index f21e8c4aa11..bd1e0db03e6 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -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)) |