Commit graph

126 commits

Author SHA1 Message Date
Glenn Morris
a215930cfe Some package doc updates
* doc/emacs/help.texi (Package Keywords): Mention describe-package buttons.

* doc/emacs/package.texi (Package Menu): Mention package-menu-filter.

* lisp/emacs-lisp/package.el (package-menu-mode-map): Tweak menu.
(package-menu-filter): Rename from package-menu-filter-interactive.
Doc fix.

* etc/NEWS: Related edits.  Copyedit.
2014-02-11 20:20:34 -05:00
Stefan Monnier
29afcbab15 * lisp/emacs-lisp/package.el: Write files silently.
(package-autoload-ensure-default-file)
(package-generate-description-file, package--write-file-no-coding)
(package-install-from-archive, package--download-one-archive):
Tell `write-region' to stay quiet.
(package-menu-mode, package-menu--print-info): Omit the Archive column
if there's only one archive.
(package-all-keywords, package--has-keyword-p): Remove dead code.
2014-01-22 14:22:45 -05:00
Glenn Morris
cc0f2ece47 Fix some function declarations
* lisp/calc/calc-embed.el (thing-at-point-looking-at):
* lisp/emacs-lisp/map-ynp.el (x-popup-dialog):
* lisp/obsolete/lmenu.el (x-popup-dialog):
* lisp/emacs-lisp/package.el (url-recreate-url):
* lisp/mail/mailclient.el (clipboard-kill-ring-save):
* lisp/subr.el (x-popup-dialog): Update declaration.

* lisp/mail/rmail.el (rmail-mime-message-p):
* lisp/window.el (tool-bar-lines-needed): Remove unnecessary declaration.
2014-01-21 20:50:40 -05:00
Dmitry Gutov
39903fd1fc Finally make package-desc--keywords work
* lisp/emacs-lisp/package.el (package-desc--keywords): Use `nth'
  instead of `cdr'.
2014-01-16 18:44:17 +02:00
Dmitry Gutov
2dbf4ffdda * lisp/emacs-lisp/package.el (package-desc--keywords): Use `cdr' with
`assoc'.  Make private.  Update all callers.
2014-01-16 14:23:14 +02:00
Dmitry Gutov
5c92e00da4 * lisp/emacs-lisp/package.el (package-desc-keywords): New function.
(describe-package-1, package-all-keywords)
(package--has-keyword-p): Use it.

Fixes: debbugs:16222
2014-01-15 06:58:06 +02:00
Bastien Guerry
2167f25d0f Fix 2014-01-08T11:19:30Z!bzg@gnu.org
* emacs-lisp/package.el (package-installed-p): Fix my previous
commit (2014-01-08T11:19:30Z!bzg@gnu.org).
2014-01-08 18:39:31 +01:00
Stefan Monnier
ec6c7de239 * lisp/emacs-lisp/package.el (package-delete): Only remove pkg-desc from
package-alist.
2014-01-08 09:19:27 -05:00
Bastien Guerry
d6262c7c39 package.el: various fixes.
* emacs-lisp/package.el (package-installed-p): First check if the
package name is in package-alist.
(package-delete): Correctly delete the package from package-alist.
2014-01-08 12:19:30 +01:00
Daiki Ueno
0a3eec3270 emacs-lisp/package.el (package--check-signature): Fix download error handling
* emacs-lisp/package.el (url-recreate-url): Declare.
(url-http-target-url): Declare.
(package-handle-response): Include requested URL in the error
message.
(package--check-signature): Don't re-signal errors from
package--with-work-buffer.  Suggested by Stefan Monnier.
2014-01-08 15:25:21 +09:00
Bastien Guerry
2b6b4f204c emacs-lisp/package.el (package-delete): Delete package completely
* emacs-lisp/package.el (package-delete): Also delete the package
name from `package-alist', not its description only.
2014-01-07 11:58:03 +01:00
Paul Eggert
ba3189039a Update copyright year to 2014 by running admin/update-copyright. 2014-01-01 07:43:34 +00:00
Ted Zlatanov
5ae811ddef Support filtering by keywords in package listings.
* emacs-lisp/package.el (package-built-in-p): Support both
built-in and the package.el converted package descriptions.
(package-show-package-list): Allow keywords.
(package-keyword-button-action): Use it instead of
`finder-list-matches'.
(package-menu-filter-interactive): Interactive filtering (by
keyword) function.
(package-menu--generate): Support keywords and change keymappings
and headers when they are given.
(package--has-keyword-p): Helper function.
(package-menu--refresh): Use it.
(package--mapc): Helper function.
(package-all-keywords): Use it.
(package-menu-mode-map): Set up menu items and keybindings to
provide a filtering UI.
2013-12-14 14:55:19 -05:00
Tom Willemse
f77d7d1773 * lisp/emacs-lisp/package.el (package--prepare-dependencies): New function.
(package-buffer-info): Use it.

Fixes: debbugs:15108
2013-12-14 11:02:39 -05:00
Glenn Morris
7b3f56792c * lisp/emacs-lisp/package.el (finder-list-matches): Autoload
rather than falsely declaring.
2013-12-11 16:15:12 -05:00
Ted Zlatanov
5a56578283 Remove finder.el require dependency in package.el
* emacs-lisp/package.el (package-keyword-button-action): Remove
finder.el require dependency.
2013-12-09 19:54:38 -05:00
Ted Zlatanov
a81fc7ba93 Add keyword buttons to package description.
* emacs-lisp/package.el: Require finder.el.
(describe-package-1): Add keyword buttons.
(package-make-button): New convenience function.
(package-keyword-button-action): Keyword button action using
`finder-list-matches'
2013-12-09 16:35:26 -05:00
Ted Zlatanov
86fd16b6b4 * emacs-lisp/package.el (describe-package-1): Add package archive. 2013-11-20 16:01:00 -05:00
Ted Zlatanov
7397c58760 Add Archive column to package list.
* emacs-lisp/package.el (package-menu-mode)
(package-menu--print-info, package-menu--archive-predicate): Add
Archive column to package list.
2013-11-04 11:04:09 -05:00
Bozhidar Batsov
d1c0ea6a18 * lisp/emacs-lisp/package.el (package-version-join): Recognize snapshot versions. 2013-11-02 12:55:22 +02:00
Glenn Morris
f53d3815ae * lisp/emacs-lisp/package.el (lm-homepage): Declare. 2013-10-29 23:29:51 -07:00
Stefan Monnier
7e3561eec6 * lisp/emacs-lisp/package.el (package--download-one-archive)
(describe-package-1): Don't query the user about final newline.
2013-10-29 10:48:08 -04:00
Daiki Ueno
acbadd0046 Add support for package signature checking.
* lisp/emacs-lisp/package.el (url-http-file-exists-p)
(epg-make-context, epg-context-set-home-directory)
(epg-verify-string, epg-context-result-for)
(epg-signature-status, epg-signature-to-string)
(epg-check-configuration, epg-configuration)
(epg-import-keys-from-file): Declare.
(package-check-signature): New user option.
(package-unsigned-archives): New user option.
(package-desc): Add `signed' field.
(package-load-descriptor): Set `signed' field if .signed file exists.
(package--archive-file-exists-p): New function.
(package--check-signature): New function.
(package-install-from-archive): Check package signature.
(package--download-one-archive): Check archive signature.
(package-delete): Remove .signed file.
(package-import-keyring): New command.
(package-refresh-contents): Import default keyring.
(package-desc-status): Add "unsigned" status.
(describe-package-1, package-menu--print-info)
(package-menu-mark-delete, package-menu--find-upgrades)
(package-menu--status-predicate): Support "unsigned" status.

* test/automated/data/package/signed/archive-contents:
* test/automated/data/package/signed/archive-contents.sig:
* test/automated/data/package/signed/signed-good-1.0.el:
* test/automated/data/package/signed/signed-good-1.0.el.sig:
* test/automated/data/package/signed/signed-bad-1.0.el:
* test/automated/data/package/signed/signed-bad-1.0.el.sig:
* test/automated/data/package/key.pub:
* test/automated/data/package/key.sec: New files.

* test/automated/package-test.el (package-test-update-listing)
(package-test-update-archives, package-test-describe-package):
Adjust to package.el change.
(package-test-signed): New test.
2013-10-03 16:11:27 +09:00
Stefan Monnier
abd1ae34a6 * lisp/emacs-lisp/package.el (package-desc): Simplify.
Fixes: debbugs:15495
2013-10-01 11:52:53 -04:00
Dmitry Gutov
494e898bc7 * lisp/emacs-lisp/package.el (package-buffer-info, describe-package-1):
Use :url instead of :homepage, as per
http://lists.gnu.org/archive/html/emacs-devel/2013-09/msg00622.html

* test/automated/package-test.el: Update all cases to use :url instead
of :homepage.

* test/automated/package-x-test.el
(package-x-test--single-archive-entry-1-3): Same.
2013-10-01 04:38:37 +03:00
Dmitry Gutov
056453c62e * lisp/emacs-lisp/package-x.el (package-upload-buffer-internal): Pass
`extras' slot from `package-desc' to `package-make-ac-desc'.

* lisp/emacs-lisp/package.el (package-desc-from-define): Accept
additional arguments as plist, convert it to an alist and store it
in the `extras' slot.
(package-generate-description-file): Convert extras alist back to
plist and append to the `define-package' form arguments.
(package--alist-to-plist): New function.
(package--ac-desc): Add `extras' slot.
(package--add-to-archive-contents): Check if the archive-contents
vector is long enough, and if it is, pass its `extras' slot value
to `package-desc-create'.
(package-buffer-info): Call `lm-homepage', pass the returned value
to `package-desc-from-define'.
(describe-package-1): Render the homepage button.

* test/automated/package-test.el (simple-single-desc-1-4): Remove, it
was unused.
(simple-single-desc): Expect :homepage property.
(multi-file-desc): Same.
(with-package-test): Do not save previous `default-directory'
value, let-bind the var instead.
(package-test-install-single): Expect :homepage property in the
generated pkg file.
(package-test-describe-package): Expect Homepage button.
(package-test-describe-non-installed-package)
(package-test-describe-non-installed-multi-file-package): Same.
(package-test-describe-not-installed-package): Remove, it was a
duplicate.

* test/automated/package-x-test.el
(package-x-test--single-archive-entry-1-3): Expect :homepage
property.
(package-x-test--single-archive-entry-1-4): Expect nil extras slot.

* test/automated/data/package/archive-contents: Add :homepage
properties to `simple-single' and `multi-file'.

* test/automated/data/package/simple-single-1.3.el: Add URL header.

Fixes: debbugs:13291
2013-09-29 22:41:00 +03:00
Stefan Monnier
96dbf5a8ae * lisp/emacs-lisp/package.el (package-generate-autoloads): Remove `require'
which should not be needed any more.
(package-menu-refresh, package-menu-describe-package): Use user-error.
2013-09-17 11:52:31 -04:00
Stefan Monnier
14b511d4e5 * lisp/emacs-lisp/package.el (package-activate-1): Don't let a missing
<pkg>-autoloads.el file stop us.
2013-09-03 14:21:41 -04:00
Stefan Monnier
2d69b99e59 * lisp/emacs-lisp/package.el (package-activate-1): Don't add unnecessarily
to load-path.
2013-08-28 13:57:12 -04:00
Glenn Morris
a0b5606ec7 Merge from emacs-24; up to 2013-01-03T01:56:56Z!rgm@gnu.org 2013-08-27 01:01:13 -07:00
Glenn Morris
d96ad42239 * lisp/emacs-lisp/package.el (package-buffer-info): Fix message typo. 2013-08-23 12:50:39 -04:00
Stefan Monnier
9c959872b5 * lisp/emacs-lisp/package.el (package-desc-from-define): Ignore unknown keys. 2013-08-02 22:34:22 -04:00
Ari Roponen
6874724a3d lisp/emacs-lisp/package.el (package-menu-mode): Fix bug#14930.
Don't modify the global value of tabulated-list-revert-hook.
2013-07-22 13:39:32 +02:00
Stefan Monnier
a49ff80c24 * lisp/emacs-lisp/package.el (package--add-to-archive-contents): Add missing
nil to terminate the loop.

Fixes: debbugs:14718
2013-06-25 20:44:35 -04:00
Stefan Monnier
120597093d * lisp/emacs-lisp/package.el: Include obsolete packages from archives.
Use lexical-binding.
(package-archive-contents): Change format; include obsolete packages.
(package-desc): Use `dir' to mark builtin packages.
(package--from-builtin): Set the `dir' field to `builtin'.
(generated-autoload-file, version-control): Declare.
(package-compute-transaction): Change first arg and return value to be
lists of package-descs.  Adjust to new package-archive-contents format.
(package--add-to-archive-contents): Adjust to new
package-archive-contents format.
(package-download-transaction): Arg is now a list of package-descs.
(package-install): If `pkg' is a package name, pass it as
a requirement, so it is subject to the usual (e.g. disabled) checks.
(describe-package): Accept package-desc as well.
(describe-package-1): Describe a specific package-desc.  Add links to
other package-descs for the same package name.
(package-menu-describe-package): Pass the actual package-desc.
(package-menu-mode): Add to tabulated-list-revert-hook so revert-buffer
works correctly.
(package-desc-status): New function.
(package-menu--refresh): New function, extracted
from package-menu--generate.
(package-menu--generate): Use it.
(package-delete): Update package-alist.
(package-menu-execute): Don't call package-initialize.

* lisp/progmodes/idlw-toolbar.el, lisp/progmodes/idlw-shell.el,
lisp/progmodes/idlw-help.el, lisp/progmodes/idlw-complete-structtag.el,
lisp/progmodes/ebnf-yac.el, lisp/progmodes/ebnf-otz.el,
lisp/progmodes/ebnf-iso.el, lisp/progmodes/ebnf-ebx.el,
lisp/progmodes/ebnf-dtd.el, lisp/progmodes/ebnf-bnf.el,
lisp/progmodes/ebnf-abn.el, lisp/emacs-lisp/package-x.el,
lisp/emacs-lisp/cl-seq.el, lisp/emacs-lisp/cl-macs.el
lisp/cedet/data-debug.el, lisp/cedet/cedet-idutils.el:
Neuter the "Version:" header.
2013-06-25 12:13:49 -04:00
Stefan Monnier
5b165ade1e * lisp/emacs-lisp/package.el (package-el-version): Remove.
(package-process-define-package): Fix inf-loop.
(package-install): Allow symbols as arguments again.
2013-06-22 16:09:19 -04:00
Juanma Barranquero
9e2773026a lisp/emacs-lisp/package.el (tar-get-file-descriptor, tar--extract): Declare. 2013-06-21 17:30:53 +02:00
Stefan Monnier
a7d2d4654e * lisp/emacs-lisp/package.el (package-alist): Include obsolete packages.
(package-obsolete-list): Remove.
(package-activate): Remove min-version argument.  Add `force' argument.
Adjust to new package-alist format.
(package-mark-obsolete): Remove.
(package-unpack): Force reload of the package's autoloads.
(package-installed-p): Check builtins if the installed package is not
recent enough.
(package-initialize): Don't reset package-obsolete-list.
Don't specify which package version to activate.
(package-process-define-package, describe-package-1)
(package-menu--generate): Adjust to new package-alist format.
2013-06-21 10:12:56 -04:00
Stefan Monnier
fd846ab406 * lisp/emacs-lisp/package.el: Use tar-mode rather than tar executable.
Consolidate the single-file vs tarball code.
(package-desc-suffix): New function.
(package-desc-full-name): Don't bother inlining it.
(package-load-descriptor): Return the new package-desc.
(package-mark-obsolete): Remove unused arg `package'.
(package-unpack): Make it work for single files as well.
Make it update package-alist.
(package--make-autoloads-and-stuff): Rename from
package--make-autoloads-and-compile.  Don't compile any more.
(package--compile): New function.
(package-generate-description-file): New function, extracted from
package-unpack-single.
(package-unpack-single): Remove.
(package--with-work-buffer): Add indentation and debugging info.
(package-download-single): Remove.
(package-install-from-archive): Rename from package-download-tar, make
it take a pkg-desc, and make it work for single files as well.
(package-download-transaction): Simplify.
(package-tar-file-info): Remove `file' arg.  Rewrite not to use an
external tar program.
(package-install-from-buffer): Remove `pkg-desc' argument.
Use package-tar-file-info for tar-mode buffers.
(package-install-file): Simplify accordingly.
(package-archive-base): Change to take a pkg-desc.
* lisp/tar-mode.el (tar--check-descriptor): New function, extracted from
tar-get-descriptor.
(tar-get-descriptor): Use it.
(tar-get-file-descriptor): New function.
(tar--extract): New function, extracted from tar-extract.
(tar--extract): Use it.
* lisp/emacs-lisp/package-x.el (package-upload-file): Decode the file, in
case the summary uses non-ascii.  Adjust to new calling convention of
package-tar-file-info.
2013-06-20 23:08:47 -04:00
Stefan Monnier
f7f9a720af * lisp/emacs-lisp/package.el: Update package-alist after install.
(package-unpack, package-unpack-single): Return the pkg-dir.
(package-download-transaction): Use it to update package-alist.

Fixes: debbugs:14632
2013-06-17 21:26:47 -04:00
Dmitry Gutov
b5bcaee503 * lisp/emacs-lisp/package.el (package-load-descriptor): Remove
`with-syntax-table' call, `read' doesn't need it.
http://lists.gnu.org/archive/html/emacs-devel/2013-06/msg00539.html
2013-06-17 21:36:21 +04:00
Dmitry Gutov
d363bffbed * lisp/emacs-lisp/package.el (package-load-descriptor): Do not call
`emacs-lisp-mode', just use its syntax table.
2013-06-17 10:24:08 +04:00
Stefan Monnier
66bd25ab33 * lisp/emacs-lisp/package.el: Don't activate packages older than builtin.
(package-obsolete-list): Rename from package-obsolete-alist, and make
it into a simple list of package-desc.
(package-strip-version): Remove.
(package-built-in-p): Use package--builtin-versions.
(package-mark-obsolete): Simplify.
(package-process-define-package): Mark it obsolete if older than the
builtin version.
(package-handle-response): Use line-end-position.
(package-read-archive-contents, package--download-one-archive):
Simplify.
(package--add-to-archive-contents): Skip if older than the builtin or
installed version.
(package-menu-describe-package): Fix last change.
(package-list-unversioned): New var.
(package-menu--generate): Use it.

* lisp/Makefile.in (autoloads): Set autoload-builtin-package-versions.

* lisp/startup.el (package--builtin-versions): New var.
(package-subdirectory-regexp): Remove.
(package--description-file): Hard code its value instead.

* lisp/emacs-lisp/autoload.el: Manage package--builtin-versions.
(autoload--insert-text, autoload--insert-cookie-text): New functions.
(autoload-builtin-package-versions): New variable.
(autoload-generate-file-autoloads): Use them.
Remove the list of autoloaded functions/macros from the
(autoload...) comments.
2013-06-15 11:36:11 -04:00
Stefan Monnier
1b8dff239b * 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.
2013-06-13 23:20:18 -04:00
Stefan Monnier
f56be016d5 First part of Daniel Hackney's patch to package.el.
* lisp/emacs-lisp/package.el: Use defstruct.
(package-desc): New, main struct.
(package--bi-desc, package--ac-desc): New structs, used to describe the
format in external files.
(package-desc-vers): Replace with package-desc-version accessor.
(package-desc-doc): Replace with package-desc-summary accessor.
(package-activate-1): Remove `package' arg since the pkg-vec now
includes the name.
(define-package): Use package-desc-from-define.
(package-unpack-single): Change file-name arg to be a symbol.
(package--add-to-archive-contents): Use package-desc-create and new
accessor functions to package--ac-desc.
(package-buffer-info, package-tar-file-info): Return a package-desc.
(package-install-from-buffer): Remove `type' argument.  Change pkg-info
arg to be a package-desc.
(package-install-file): Adjust accordingly.  Use \' to match EOS.
(package--from-builtin): New function.
(describe-package-1, package-menu--generate): Use it.
(package--make-autoloads-and-compile): Change name arg to be a symbol.
(package-generate-autoloads): Idem and return the name of the file.
* lisp/emacs-lisp/package-x.el (package-upload-buffer-internal):
Change pkg-info arg to be a package-desc.
Use package-make-ac-desc.
(package-upload-file): Use \' to match EOS.
* lisp/finder.el (finder-compile-keywords): Use package-make-builtin.
2013-06-11 20:49:33 -04:00
Yann Hodique
469bfed936 * lisp/emacs-lisp/tabulated-list.el: Set a version number.
* lisp/emacs-lisp/package.el: Explicitly depend on a tabulated-list version.

Fixes: debbugs:14137
2013-05-14 00:35:21 -07:00
Glenn Morris
f20def1f2e Fix some declarations
* lisp/faces.el (internal-face-x-get-resource):
* lisp/frame.el (ns-display-monitor-attributes-list):
* lisp/calc/calc-aent.el (math-to-radians-2):
* lisp/cedet/ede/locate.el (cedet-cscope-version-check)
(cedet-cscope-support-for-directory):
* lisp/cedet/semantic/grammar.el (semantic-grammar-wy--install-parser):
* lisp/emacs-lisp/package.el (tar-header-name, tar-header-link-type):
Fix declarations.
2013-05-10 19:27:28 -07:00
Stefan Monnier
4fac34cee9 * lisp/emacs-lisp/package.el (package-autoload-ensure-default-file):
Add current dir to the load-path.
(package-generate-autoloads): Don't rely on autoload-ensure-default-file.
2013-04-27 09:32:53 -04:00
Stefan Monnier
134abf1fae * lisp/emacs-lisp/package.el (package-compute-transaction): Fix last fix.
Suggested by Donald Curtis <dcurtis@coe.edu>.

Fixes: debbugs:14082
2013-04-05 14:46:59 -04:00
Stefan Monnier
b208ebc6e7 * lisp/emacs-lisp/package.el (package-compute-transaction): Fix ordering
when a package is required several times.

Fixes: debbugs:14082
2013-04-03 22:46:38 -04:00