Commit graph

271 commits

Author SHA1 Message Date
Artur Malabarba
35514815fa * lisp/emacs-lisp/package.el: Better transaction messages
(package-menu--partition-transaction): New function.
(package-menu--prompt-transaction-p, package-menu-execute): Use
it.
(package-menu--perform-transaction): Don't do any messaging.
2015-05-21 09:59:45 +01:00
Artur Malabarba
0060c0d7b1 * lisp/emacs-lisp/package.el: Revert async package transactions
(package-menu-async): Update doc.
(package-install-from-archive, package-download-transaction)
(package-install, package-menu--perform-transaction)
(package-menu-execute): Remove asynchronous functionality.
2015-05-21 09:59:45 +01:00
Artur Malabarba
1972e49f92 * lisp/emacs-lisp/package.el: "Delete" button in Help buffer
(package-delete-button-action): New function.
(describe-package-1): Add Delete button.
2015-05-20 14:14:52 +01:00
Artur Malabarba
578f0067b7 * lisp/emacs-lisp/package.el: Better dependency description
(package--used-elsewhere-p): New optional arg, ALL, and return
package-desc objects instead of names.
(package-delete): Update accordingly.
(describe-package-1): Describe which packages require the package.
2015-05-20 14:14:52 +01:00
Artur Malabarba
2abfe21de9 * lisp/emacs-lisp/package.el: Don't ensure-init during startup
(package--init-file-ensured): New variable.
(package-initialize, package--ensure-init-file): Use it.
2015-05-15 11:18:53 +01:00
Artur Malabarba
b1c23fb940 * lisp/emacs-lisp/package.el: Be more careful with the init file
(package--ensure-init-file): Check that user-init-file is set,
exists, is readable, and is writable.  (Bug#20584)
Also expand the docstring.
2015-05-15 10:17:48 +01:00
Artur Malabarba
14bb519f10 * lisp/emacs-lisp/package.el: New "external" package status
An external package is any installed package that's not built-in
and not from `package-user-dir', which usually means it's from an
entry in `package-directory-list'.  They are treated much like
built-in packages, in that they cannot be through the Package Menu
deleted and are not considered for upgrades.

(package-desc-status): Identify if a package is installed outside
`package-user-dir'.
(package-menu--print-info-simple)
(package-menu--status-predicate): Add support for it.

* etc/NEWS: Document it.
2015-05-07 16:13:45 +01:00
Glenn Morris
7ccf25770a * lisp/allout.el (epg-user-id-string, epg-key-user-id-list):
* lisp/emacs-lisp/package.el (epg-signature-status):
Fix declarations.
2015-05-04 20:21:47 -04:00
Artur Malabarba
5d3940a3b9 * lisp/emacs-lisp/package.el: Remove `package--silence' variable
(package-import-keyring, package-refresh-contents)
(package-compute-transaction, package--save-selected-packages)
(package-install-from-archive, package-delete)
(package-menu--perform-transaction): Use `inhibit-message'
instead.
(package--compile): Set `warning-minimum-level' to :error.
2015-05-04 14:14:09 +01:00
Glenn Morris
ce7ff436ff Function declaration updates prompted by 'make check-declare'
* lisp/emacs-lisp/package.el (lm-homepage):
* lisp/gnus/gnus-util.el (iswitchb-read-buffer):
* lisp/gnus/mm-decode.el (libxml-parse-html-region):
* lisp/gnus/mml.el (libxml-parse-html-region):
* lisp/gnus/nnrss.el (libxml-parse-html-region):
* lisp/net/eww.el (libxml-parse-html-region):
* lisp/net/shr.el (libxml-parse-html-region):
* lisp/vc/vc-bzr.el (vc-annotate-convert-time):
* lisp/vc/vc-cvs.el (vc-annotate-convert-time):
* lisp/vc/vc-git.el (vc-annotate-convert-time):
* lisp/vc/vc-hg.el (vc-annotate-convert-time):
* lisp/vc/vc-mtn.el (vc-annotate-convert-time):
* lisp/vc/vc-rcs.el (vc-annotate-convert-time):
Update declaration.
2015-04-30 20:06:15 -04:00
Artur Malabarba
f4ad42936e * lisp/emacs-lisp/package.el: Some speed optimizations on menu refresh
(package-menu--print-info): Obsolete.
(package-menu--print-info-simple): New function.
(package-menu--refresh): Use it, simplify code, and improve
performance.

* lisp/emacs-lisp/tabulated-list.el (tabulated-list-print-entry):
Tiny performance improvement.
2015-04-30 09:35:20 +01:00
Artur Malabarba
5b6c58395d * lisp/emacs-lisp/package.el (package--message): inhibit-message 2015-04-30 09:35:20 +01:00
Artur Malabarba
c1d30c4b13 * lisp/emacs-lisp/package.el: Use pushnew for downloads in progress
(package--download-and-read-archives): Use pushnew instead of
append.  If something terrible happened during a previous
download, simply refreshing should now make things work again.
2015-04-30 00:59:26 +01:00
Artur Malabarba
301514f2bf * lisp/emacs-lisp/package.el: Fix priority-hiding corner case
(package-menu--refresh): Delegate obsolete-hiding to
`package--remove-hidden'.
(package--remove-hidden): Disregard high-priority package if it is
older than the installed one.
2015-04-28 22:29:50 +01:00
Artur Malabarba
fecd155703 * lisp/emacs-lisp/package.el: Skip space and comments in init file
(package--ensure-init-file): Insert snippet at first
non-whitespace non-comments line.  Respects local-vars at the top
of the file.
2015-04-28 11:08:40 +01:00
Artur Malabarba
f3b43fca47 * lisp/emacs-lisp/package.el: Small improvements
(package--with-work-buffer-async): More informative error.
(package-install-user-selected-packages): Rename to
`package-install-selected-packages'.
2015-04-27 22:06:32 +01:00
Stefan Monnier
0b72388293 lisp/emacs-lisp/package.el: Move variables to silence byte-compiler
Remove redundant ":group 'package".
2015-04-26 17:03:21 -04:00
Artur Malabarba
864573cafe * lisp/emacs-lisp/package.el (package-all-keywords): Don't cache
(package--all-keywords): Deleted variable.
2015-04-25 17:04:02 +01:00
Paul Eggert
2f5da6d45a Spelling fixes 2015-04-24 23:19:59 -07:00
Artur Malabarba
8991937a74 * lisp/emacs-lisp/package.el: Hide lower-priority packages in menu
(package-menu-hide-low-priority): New variable, see its doc.
(package-archive-priorities): Update doc.
(package-desc-priority): New function.
(package-desc-priority-version): Use it.
(package--remove-hidden): New function.
(package-menu--refresh): Use it.
2015-04-22 11:27:47 +01:00
Artur Malabarba
c3b41c6448 * lisp/emacs-lisp/package.el: Implement displaying obsolete packages
(package-menu--hide-obsolete): New variable.
(package--remove-hidden): Use it.
(package-menu-hide-obsolete): New interactive function to toggle
the variable.
(package--quick-help-keys): Document it.
(package-menu-async): Add :version tag.
(package-menu-mode-map): Bind package-menu-hide-obsolete.
(package-desc-status): Indicate non-installed obsolete packages as
avail-obso.
(package-menu-mark-install): Allow installation of avail-obso.
(package-menu--status-predicate): Sort avail-obso with available.
2015-04-22 11:27:47 +01:00
Artur Malabarba
b7a015f5e0 * lisp/emacs-lisp/package.el: Filter by multiple keywords and cache keywords
(package-menu-filter): Accept a list of keywords.

(package--all-keywords): New variable to cache known keywords.
(package-all-keywords): Populate it if necessary.
(package-refresh-contents): Reset it.
2015-04-20 20:47:18 +01:00
Artur Malabarba
fad6b8a093 * lisp/emacs-lisp/package.el: Make archive and status pseudo-keywords
(package--has-keyword-p): Understand "arc:xxxx" and "status:xxxx"
as special keywords which match agains package archive and status
respectively.

* etc/NEWS: Document it.
2015-04-20 20:47:18 +01:00
Steve Purcell
4155619aac Assume package archive-contents are UTF8-encoded
* lisp/emacs-lisp/package.el (package--read-archive-file):
Set `coding-system-for-read' explicitly to 'utf-8 when reading the
downloaded and cached archive-contents files, so that non-ASCII
characters in package descriptions are displayed correctly in the
`list-packages' menu. (Bug#20231)

Co-authored-by: Steve Purcell <steve@sanityinc.com>
2015-04-19 17:56:46 +01:00
Sam Steingold
e45dbdc386 package--ensure-init-file: widen requires save-restriction 2015-04-14 15:14:20 -04:00
Sam Steingold
845cb4a2ce package--ensure-init-file: widen before looking for "(package-initialize)" 2015-04-13 23:27:02 -04:00
Artur Malabarba
2bad549b95 * lisp/emacs-lisp/package.el: Fix package--ensure-init-file 2015-04-13 20:51:14 +01:00
Artur Malabarba
e99d8cb25d * lisp/emacs-lisp/package.el: Improve transaction y-or-n prompt
(package-menu--prompt-transaction-p): Prompt for "Delete" first,
"Upgrade" last, and use capitalized instead of all-caps.
2015-04-12 16:16:06 +01:00
Artur Malabarba
5aa0dfe4b7 * lisp/emacs-lisp/package.el: Completely silence async operations
(package--make-autoloads-and-stuff): Silence autoloads.

(package--save-selected-packages): New function, silences
`customize-save-variable'.
(package--user-selected-p, package-install-from-buffer)
(package-delete, package-install): Use it.

(package-install-from-archive)
(package-menu--perform-transaction): Silence.

(package-menu-execute): Feedback when operation starts.
2015-04-12 16:16:06 +01:00
Artur Malabarba
dfdd7e1944 Use delay-mode-hooks when visiting the init-file
* lisp/emacs-lisp/package.el (package--ensure-init-file):
delay-mode-hooks

* lisp/cus-edit.el (custom-save-all): delay-mode-hooks
2015-04-12 16:16:06 +01:00
Artur Malabarba
d0fcb21254 * lisp/emacs-lisp/package.el (list-packages): Avoid redundant generate 2015-04-12 13:47:58 +01:00
Artur Malabarba
d06eeb85e0 * lisp/emacs-lisp/package.el (list-packages): Call refresh in right buffer 2015-04-12 13:45:30 +01:00
Artur Malabarba
50ddc67739 * lisp/emacs-lisp/package.el: Improve `package-menu-refresh'
(package-menu-refresh): Respect async and do new package checking.
(list-packages): Use `package-menu-refresh' instead of repeating code.
2015-04-12 03:57:58 +01:00
Artur Malabarba
6f87b180dd * lisp/emacs-lisp/package.el: Improve package-menu-quick-help
(package--quick-help-keys): New variable.
(package--prettify-quick-help-key): New function.
(package-menu-quick-help): Use it.
2015-04-12 03:09:50 +01:00
Artur Malabarba
357edb4e89 * lisp/emacs-lisp/package.el: Fix initially wrong compat table
(package--build-compatibility-table): require finder
2015-04-12 02:33:29 +01:00
Artur Malabarba
ba273b6185 * lisp/emacs-lisp/package.el: Silence async operations
(package--silence): New variable.
(package--message): New function.

(package-import-keyring, package-refresh-contents)
(package-compute-transaction, package-install, package-delete)
(package-menu--perform-transaction, package-menu-execute): Use it.
2015-04-12 01:52:43 +01:00
Artur Malabarba
c1daad42c6 * lisp/emacs-lisp/package.el: Use mode-line-process for notification 2015-04-10 00:47:05 +01:00
Artur Malabarba
a480a51f24 * lisp/emacs-lisp/package.el (package-menu-mode): Mode-line notification
while dowloading information.
2015-04-08 19:27:45 +01:00
Artur Malabarba
0465c9dd42 * lisp/emacs-lisp/package.el: More conservative `ensure-init-file'
(package--ensure-init-file): Check file contents before visiting.
(package-initialize): Call it.
(package-install-from-buffer, package-install): Don't call it.
2015-04-08 19:18:30 +01:00
Artur Malabarba
c91fd97dfb * emacs-lisp/package.el: Make the execute prompt less verbose.
(package-menu--list-to-prompt): New function.
(package-menu--prompt-transaction-p): Use "Upgrade" to make the
package-menu-execute prompt less verbose.
2015-04-06 17:09:43 +01:00
Artur Malabarba
67c152efc3 * emacs-lisp/package.el: Fix lack of "new" packages.
(package-menu--new-package-list)
(package-menu--old-archive-contents): No longer local.
2015-04-06 16:22:07 +01:00
Artur Malabarba
7471fc47b4 emacs-lisp/package.el (package-menu-execute): Add async support
Most install/delete logic is now in
`package-menu--perform-transaction', and this function is called
asynchronously if `package-menu-async' is non-nil.
2015-04-06 11:19:04 +01:00
Artur Malabarba
6701726b98 emacs-lisp/package.el (package-install): Add ASYNC and CALLBACK 2015-04-06 11:19:04 +01:00
Artur Malabarba
b6610d5547 emacs-lisp/package.el: Refactor pre-execute prompt 2015-04-06 11:19:04 +01:00
Artur Malabarba
7436b68132 emacs-lisp/package.el: Async support in download-transaction 2015-04-06 11:19:04 +01:00
Artur Malabarba
fdc521952e emacs-lisp/package.el: Add package-initialize to user-init-file. 2015-04-05 11:06:20 +01:00
Artur Malabarba
b47fe819f7 emacs-lisp/package.el: Prevent outdated downloads-in-progress. 2015-04-05 10:59:18 +01:00
Artur Malabarba
b32bb3f2f6 (package--with-work-buffer-async): Protect macro arguments. 2015-04-04 20:44:59 +01:00
Artur Malabarba
f674de6f08 emacs-lisp/package.el: Don't overwrite downloads-in-progress. 2015-04-04 20:22:26 +01:00
Paul Eggert
bd55cd4d24 * emacs-lisp/package.el: Spelling fixes and use active voice. 2015-04-01 10:22:20 -07:00