Commit graph

295 commits

Author SHA1 Message Date
Paul Eggert
cc7acdbd0e Spelling fixes 2015-06-30 19:47:29 -07:00
Artur Malabarba
0dfea4562e * lisp/emacs-lisp/package.el (package--remove-hidden): Fix logic
(Bug#20930)
2015-06-30 19:20:12 +01:00
Artur Malabarba
8d3b910213 * lisp/emacs-lisp/package.el (package-compute-transaction):
Don't assume version sorting.
2015-06-30 10:47:25 +01:00
Artur Malabarba
d0a5162fd8 * lisp/emacs-lisp/package.el (package--save-selected-packages):
Don't save before init time, to avoid overwriting configurations.
(Bug#20855)
2015-06-30 10:19:15 +01:00
Nicolas Richard
6689b537c8 * package.el (describe-package): Use symbol-at-point as additional guess 2015-06-29 09:14:58 +02:00
Nicolas Richard
a4760a347e * package.el (describe-package): Convert the guess to a string 2015-06-29 09:14:47 +02:00
Artur Malabarba
567bf811dc * lisp/emacs-lisp/package.el: Exclude packages by name
(package-hidden-regexps): New variable.
(package-menu--refresh): Use it.
(package-menu-hide-package): New command.
2015-06-22 19:02:08 +01:00
Artur Malabarba
a9d9b66ebb * lisp/emacs-lisp/package.el: Rename hide-obsolete to toggle-hiding 2015-06-22 19:02:08 +01:00
Paul Eggert
c4151ebe15 Improve the optional translation of quotes
Fix several problems with the recently-added custom variable
help-quote-translation where the code would quote inconsistently
in help buffers.  Add support for quoting 'like this', which
is common in other GNU programs in ASCII environments.  Change
help-quote-translation to use more mnemonic values: values are now the
initial quoting char, e.g., (setq help-quote-translation ?`) gets the
traditional Emacs help-buffer quoting style `like this'.  Change the
default behavior of substitute-command-keys to match what's done in
set-locale-environment, i.e., quote ‘like this’ if displayable,
'like this' otherwise.
* doc/lispref/help.texi (Keys in Documentation): Document
new behavior of substitute-command-keys, and document
help-quote-translation.
* doc/lispref/tips.texi (Documentation Tips):
Mention the effect of help-quote-translation.
* etc/NEWS: Mention new behavior of substitute-command-keys,
and merge help-quote-translation news into it.
When talking about doc strings, mention new ways to type quotes.
* lisp/cedet/mode-local.el (overload-docstring-extension):
Revert my recent change to this function, which shouldn't be
needed as the result is a doc string.
* lisp/cedet/mode-local.el (mode-local-print-binding)
(mode-local-describe-bindings-2):
* lisp/cedet/srecode/srt-mode.el (srecode-macro-help):
* lisp/cus-theme.el (describe-theme-1):
* lisp/descr-text.el (describe-text-properties-1, describe-char):
* lisp/emacs-lisp/cl-generic.el (cl--generic-describe):
* lisp/emacs-lisp/eieio-opt.el (eieio-help-class)
(eieio-help-constructor):
* lisp/emacs-lisp/package.el (describe-package-1):
* lisp/faces.el (describe-face):
* lisp/help-fns.el (help-fns--key-bindings)
(help-fns--compiler-macro, help-fns--parent-mode)
(help-fns--obsolete, help-fns--interactive-only)
(describe-function-1, describe-variable):
* lisp/help.el (describe-mode):
Use substitute-command-keys to ensure a more-consistent quoting
style in help buffers.
* lisp/cus-start.el (standard):
Document new help-quote-translation behavior.
* lisp/emacs-lisp/lisp-mode.el (lisp-fdefs):
* lisp/help-mode.el (help-xref-symbol-regexp, help-xref-info-regexp)
(help-xref-url-regexp):
* lisp/international/mule-cmds.el (help-xref-mule-regexp-template):
* lisp/wid-edit.el (widget-documentation-link-regexp):
Also match 'foo', in case we're in a help buffer generated when
help-quote-translation is ?'.
* src/doc.c: Include disptab.h, for DISP_CHAR_VECTOR.
(LEFT_SINGLE_QUOTATION_MARK, uLSQM0, uLSQM1, uLSQM2, uRSQM0)
(uRSQM1, uRSQM2, LSQM, RSQM): New constants.
(Fsubstitute_command_keys): Document and implement new behavior.
(Vhelp_quote_translation): Document new behavior.
2015-06-19 00:38:45 -07:00
Artur Malabarba
711e14ddad * lisp/emacs-lisp/package.el: Don't always propagate async errors
(package--with-work-buffer-async): Only propagate the error if the
callback returns non-nil.
(package--download-one-archive): Return nil on the signature
checking callback if we accept unsigned.
(package--download-and-read-archives): Return non-nil on the
archive download callback.
2015-06-18 14:28:03 +01:00
Artur Malabarba
517ab6238a * lisp/emacs-lisp/package.el (package-menu--perform-transaction):
Properly delete packages.  (Bug#20836)
2015-06-18 09:24:36 +01:00
Artur Malabarba
5dc72bc4ba * lisp/emacs-lisp/package.el: Slightly better error reporting. 2015-06-17 20:33:38 +01:00
Artur Malabarba
d6dd70b064 * lisp/emacs-lisp/package.el (package--with-work-buffer-async):
Fix error reporting.
2015-06-17 16:59:55 +01:00
Artur Malabarba
a142b77028 * lisp/emacs-lisp/package.el: Revert buffer after any operation
Call `package-menu--post-refresh' after any operation that changes
the package database (`package-install' and `package-delete').  To
avoid performance issues in large transactions, these functions
add `post-refresh' to `post-command-hook' instead of calling it
immediately.
(package-menu--mark-or-notify-upgrades): New function.
(list-packages): Add it to `package--post-download-archives-hook'.
(package-menu--post-refresh): Lose the upgrade-checking code, add
code to remove itself from `post-command-hook'.
(package-install, package-delete): Add it to `post-command-hook'.
(package-menu-execute): Don't call `package-menu--post-refresh'.
2015-06-17 15:40:58 +01:00
Artur Malabarba
3881af45bf * lisp/emacs-lisp/package.el (package--with-work-buffer-async):
Catch errors that happen before going async.  (Bug#20809)
2015-06-14 22:48:18 +01:00
Artur Malabarba
f1aa40f47d * lisp/emacs-lisp/package.el (package-delete): Make interactive 2015-06-08 10:50:43 +01:00
Artur Malabarba
56af96e54e * lisp/emacs-lisp/package.el: Don't load from parent dir
(package-load-all-descriptors): Don't load descriptors from
directories above the package directories.
2015-05-29 21:41:53 +01:00
Paul Eggert
0fd5e6593a Support curved quotes in doc strings
Emacs's traditional doc string style has been to quote symbols
`like this'.  This worked well on now-obsolete terminals where
` and ' were symmetric quotes, but nowadays curved quotes
‘like this’ look better.  Support quoting the new way too.
(Bug#20385)
* doc/lispref/tips.texi (Documentation Tips): Symbols can be quoted
‘like-this’ as well as `like-this'.
* etc/NEWS: Mention this.
* lisp/cedet/mode-local.el (overload-docstring-extension)
(mode-local-print-binding, mode-local-describe-bindings-2):
* lisp/cus-theme.el (describe-theme-1):
* lisp/descr-text.el (describe-text-properties-1, describe-char):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
* lisp/emacs-lisp/cl-generic.el (cl--generic-describe):
* lisp/emacs-lisp/eieio-opt.el (eieio-help-class)
(eieio-help-constructor):
* lisp/emacs-lisp/package.el (describe-package-1):
* lisp/faces.el (describe-face):
* lisp/help-fns.el (help-fns--key-bindings)
(help-fns--compiler-macro, help-fns--parent-mode, help-fns--obsolete):
(help-fns--interactive-only, describe-function-1):
(describe-variable):
* lisp/help.el (describe-mode):
* lisp/international/mule-cmds.el (describe-input-method)
(describe-language-environment):
* lisp/international/mule-diag.el (describe-character-set)
(print-coding-system-briefly, list-input-methods)
(list-input-methods-1):
Insert curved quotes rather than grave accent and apostrophe.
* lisp/cedet/srecode/texi.el (srecode-texi-texify-docstring):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine)
(checkdoc-proper-noun-region-engine):
* lisp/emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-2)
(lisp-cl-font-lock-keywords-2):
* lisp/finder.el (finder-font-lock-keywords):
* lisp/gnus/gnus-art.el (gnus-button-alist):
* lisp/help-fns.el (help-do-arg-highlight)
(describe-function-1, describe-variable):
* lisp/help-mode.el (help-xref-symbol-regexp)
(help-xref-info-regexp, help-xref-url-regexp):
* lisp/help.el (describe-mode):
* lisp/international/mule-cmds.el (help-xref-mule-regexp-template):
* lisp/wid-edit.el (widget-documentation-link-regexp):
Parse symbols quoted ‘like-this’ as well as `like-this'.
* lisp/progmodes/elisp-mode.el (emacs-lisp-mode):
Add "‘" and "’" to electric-pair-text-pairs.
(elisp--form-quoted-p): Also allow "‘" as a quoting char.
(elisp-completion-at-point, elisp--preceding-sexp):
Also treat "‘" and "’" as quoting chars.
2015-05-28 00:22:02 -07:00
Artur Malabarba
1f7abd04bc * lisp/emacs-lisp/package.el: Don't erase tags on refresh
(package-menu--post-refresh): Call `tabulated-list-print' with the
UPDATE argument.  This only affects the refresh action, the revert
action still erases tags.
(package-menu-get-status): Change `assq' to `assoc'.
(package-menu--mark-upgrades-1): New function.
(package-menu--mark-upgrades-pending): New variable.
(package-menu-mark-upgrades): Use them to delay marking until
after refresh is done.
(package-menu--post-refresh): Call mark-upgrades-1 if
mark-upgrades-pending is non-nil.
2015-05-27 20:42:29 +01:00
Artur Malabarba
7ac84a2570 * lisp/emacs-lisp/package.el: Always update selected-packages
(package--update-selected-packages): New function.
(package-menu-execute): Use it before starting the transaction,
this way the list of selected packages is updated even when the
transaction fails.
(package-menu--perform-transaction): Don't edit selected-packages.
2015-05-23 10:21:27 +01:00
Artur Malabarba
c2ef2adff1 * lisp/emacs-lisp/package.el (package-selected-packages): Fix doc 2015-05-22 11:00:28 +01:00
Artur Malabarba
f590fc2760 (package-menu-execute): Remove reference to remove-dups 2015-05-21 21:27:22 +01:00
Artur Malabarba
a31ca4ef50 * lisp/emacs-lisp/package.el: Fix selected-package logic
(package-menu-execute): Mark as selected all non-upgrade packages
being installed.
(package-menu--perform-transaction): Don't mark anything.
2015-05-21 17:10:40 +01:00
Artur Malabarba
60c1ea3d20 * lisp/emacs-lisp/package.el: Mode-line progress report
(package-menu--transaction-status): New variable.
(package-menu-mode, package-menu--perform-transaction): Use it.
2015-05-21 09:59:45 +01:00
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