* lisp/gnus/gnus-gravatar.el (gnus-gravatar-insert): Fix check for
repeated gravatars, which is now easier to trigger now that things
are more asynchronous.
* lisp/image/gravatar.el (gravatar--service-libravatar): Fetch the
data asynchronously (bug#40676).
(gravatar-service-alist): Adjust all providers so they are
asynchronous.
(gravatar-build-url): Adjust caller to be asynchronous.
(gravatar-retrieve): Ditto.
(gravatar-retrieve-synchronously): Ditto.
* lisp/net/dns.el (dns-query-asynchronous): New function.
(dns--lookup, dns--filter): New internal functions.
(dns-query): Reimplement on top of dns-query-asynchronous.
4b3085a7fe Fix last change efdd4632c9 Fix Arabic shaping when column-number-mode is in effect d5acc50941 Fix description of kmacro-* commands in the user manual
Use a new method to determine when to auto-stop image animations
* lisp/image.el (image-animate-timeout): Make the animation
auto-stop use a decaying average to determine when to stop
(bug#40685). The default stop condition will probably require
some tweaking -- the current default may be too aggressive.
* lisp/net/eww.el (erc--download-directory): New function (bug#41030).
(eww-download-directory): Use it.
(eww-download): Use it.
(eww-download-callback): Adjust parameters.
Philip K [Wed, 29 Jul 2020 04:54:05 +0000 (06:54 +0200)]
Make the erc-header-line default to header-line
* lisp/erc/erc.el (erc-header-line): Inherit from header-line (the
old values were very similar in light mode, but very different
in dark mode) (bug#41095).
Philip K [Tue, 28 Jul 2020 22:21:56 +0000 (01:21 +0300)]
Replace project-kill-buffers-ignores with project-kill-buffer-conditions
* lisp/progmodes/project.el (project-kill-buffer-conditions):
Replace the project-kill-buffers-ignores user option.
(project--kill-buffer-check): New function.
(project--buffers-to-kill): New function.
(project-kill-buffers): Use them. Add the NO-CONFIRM argument.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
Remove clause for 'with-output-to-temp-buffer', since it is a
macro and will have been expanded before reaching this point.
Move clauses for 'lambda' and 'closure' to avoid splitting
a cond jump table.
SELinux has used 'char *' in place of its typedef
'security_context_t' since 2014 (v2.3) because the latter was
inconvenient to use when paired with the 'const' qualifier. The
typedef has been kept around for compatibility with legacy callers,
but it is deprecated in SELinux v3.1. See the following URL for the
relevant announcement:
https://lore.kernel.org/selinux/20200710162034.GC1768200@localhost.localdomain/
* src/fileio.c (Fcopy_file, Ffile_selinux_context)
(Fset_file_selinux_context) [HAVE_LIBSELINUX]: Replace deprecated
'security_context_t' typedef with the equivalent 'char *'.
* lisp/gnus/nnimap.el (nnimap-update-info): Store Gnus group name.
* lisp/gnus/nnmail.el (nnmail-check-duplication): Store unique
Gnus names in the history instead of backend-specific (possibly
duplicated) group names (bug#41842).
João Távora [Mon, 27 Jul 2020 21:07:38 +0000 (22:07 +0100)]
Make newer ElDoc versions are compatible with Emacs < 28
Fixes: bug#42563
For some time, Eldoc has has some Elisp-specific code that shouldn't
live there, but in elisp-mode.el. This can be fixed in Emacs master,
but since ElDoc is distributed in GNU Elpa and is meant to work with
Emacs 26 and 27, this means that that elisp-specific code must still
be distributed with eldoc.el and kept up to date.
* lisp/emacs-lisp/eldoc.el (eldoc--eval-expression-setup): Ensure
implementation is compatible with Emacs < 28.
(Version): Bump to 1.8
João Távora [Mon, 27 Jul 2020 15:26:33 +0000 (16:26 +0100)]
Bring back ElDoc's eldoc-display-message-p, but obsolete it
Like others, this is an implementation detail that third parties could
be relying on. Better not remove it outright just now, since its
implementation is very simple anyway.
* lisp/emacs-lisp/eldoc.el (Version): Bump to 1.7.0
(eldoc-display-message-p): Bring back, but obsolete.
* lisp/progmodes/project.el (project--other-place-command):
Bind switch-to-buffer-obey-display-actions to t, so that
project-other-window-command and friends can affect
project-switch-to-buffer.
Sean Whitton [Fri, 24 Jul 2020 01:55:42 +0000 (18:55 -0700)]
Add project other place commands
* lisp/progmodes/project.el (project-other-window-map,
project-other-frame-map, project--other-place-command,
project-other-window-command, project-other-frame-command,
project-other-tab-command): Add these functions and maps.
* lisp/progmodes/project.el: Bind project-other-window-command to C-x
4 p, project-other-frame-command to C-x 5 p and
project-other-tab-command to C-x t p (bug#42210).
Sean Whitton [Fri, 24 Jul 2020 20:36:39 +0000 (13:36 -0700)]
Factor out project--read-project-buffer from project-switch-buffer
* lisp/progmodes/project.el (project--read-project-buffer): New
function extracted from project-switch-buffer.
* lisp/progmodes/project.el (project-switch-buffer): Instead of
unconditionally reading a project buffer from the user, add
buffer-or-name argument, and populate it using
project--read-project-buffer when called interactively. Update
docstring.
Philipp Stephani [Sat, 25 Jul 2020 21:04:05 +0000 (23:04 +0200)]
Fix subtle bug when checking liveness of module values.
We can't simply look up the Lisp object in the global reference table
because an invalid local and a valid global reference might refer to
the same object. Instead, we have to test the address of the global
reference against the stored references.
* src/emacs-module.c (module_global_reference_p): New helper function.
(value_to_lisp): Use it.
* test/data/emacs-module/mod-test.c
(Fmod_test_invalid_store_copy): New test module function.
(emacs_module_init): Export it.
* test/src/emacs-module-tests.el
(module--test-assertions--load-non-live-object-with-global-copy):
New unit test.
Turn (+ a b c) into (+ (+ a b) c), and do the same for - and *.
The 2-arg operations have their own bytecode which results in a 1.5×
speed-up. Furthermore, the transform enables other optimisations; for
example, (+ a 1 b) -> (+ (1+ a) b).
* lisp/emacs-lisp/byte-opt.el (byte-optimize-plus, byte-optimize-minus)
(byte-optimize-multiply): Transform (OP a b c) into (OP (OP a b) c).
Pip Cet [Fri, 5 Jun 2020 12:54:01 +0000 (12:54 +0000)]
Fix Arabic shaping when column-number-mode is in effect
* src/indent.c (scan_for_column, compute_motion): Pass -1,
instead of NEUTRAL_DIR, to 'composition_reseat_it'.
* src/composite.c (composition_reseat_it): Interpret negative
value of BIDI_LEVEL to mean the caller doesn't know what is the
bidi direction of the text. (Bug#41005)
Eli Zaretskii [Sat, 25 Jul 2020 09:28:05 +0000 (12:28 +0300)]
Update and improve documentation of project.el commands
* doc/emacs/custom.texi (Prefix Keymaps): Document
'project-prefix-map'.
* doc/emacs/maintaining.texi (Project File Commands)
(Switching Projects): Describe key bindings for the commands
described in the sections. Document 'project-list-file'.
(Project Buffer Commands): New section.
* doc/emacs/emacs.texi (Top): Add Project sections to the detailed
menu.
* etc/NEWS: Add entries for project.el, and mark documented entries as
appropriate.
Don't call undefined function elisp-eldoc-documentation-function (bug#42493)
* lisp/ielm.el (inferior-emacs-lisp-mode): Add
`elisp-eldoc-var-docstring' and `elisp-eldoc-funcall' as
`eldoc-documentation-functions' instead of the undefined
elisp-eldoc-documentation-function (bug#42493).
bug-reference auto-setup for IRC, implementation for ERC
* lisp/progmodes/bug-reference.el (bug-reference-setup-from-irc-alist):
Change SERVER-REGEXP to NETWORK-REGEXP in docstring.
* lisp/progmodes/bug-reference.el (bug-reference--maybe-setup-from-irc):
Change semantics from requiring a match of channel OR server to
requiring a match of both (if both are configured).
* lisp/progmodes/bug-reference.el (bug-reference-try-setup-from-erc):
New defun doing the auto-setup for ERC.
(bug-reference--run-auto-setup): Run bug-reference-try-setup-from-erc.
* etc/NEWS: Extend entry describing bug-reference auto-setup.
Philipp Stephani [Thu, 23 Jul 2020 11:48:43 +0000 (13:48 +0200)]
Fix memory leak for global module objects (Bug#42482).
Instead of storing the global values in a global 'emacs_value_storage'
object, store them as hash values alongside the reference counts.
That way the garbage collector takes care of cleaning them up.
* src/emacs-module.c (global_storage): Remove.
(struct module_global_reference): New pseudovector type.
(XMODULE_GLOBAL_REFERENCE): New helper function.
(module_make_global_ref, module_free_global_ref): Use
'module_global_reference' struct for global reference values.
(value_to_lisp, module_handle_nonlocal_exit): Adapt to deletion of
'global_storage'.
João Távora [Sat, 18 Jul 2020 23:48:43 +0000 (00:48 +0100)]
Don't needlessly request docs from ElDoc functions
Fixes: bug#42421
Do this conservatively for now: if the ElDoc helper buffer (as
returned by eldoc--doc-buffer) is visible and showing documentation
for the very same "situation" (as computed by the the new
eldoc--request-state helper), don't request that documentation from
sources again.
Before this change, not only was that request inefficient but if the
user invoked scroll-other-window to see more of the helper buffer,
that would eventually cause it to be reformatted and unexpectedly
recentered.
Later on, when a customizable list of documentation "sinks" is offered
to the user, say, something like eldoc-display-functions, this process
must be consolidated. In those circumstances, as soon as one of those
sinks signals that it doesn't have up-to-date documentation for the
state computed by eldoc--request-state, documentation will have to be
requested anew from eldoc-documentation-functions via
eldoc--invoke-strategy.
* lisp/emacs-lisp/eldoc.el (eldoc--request-docs-p): Rework from
eglot-display-message-p.
(eldoc--last-request-state): New variable.
(eldoc--request-state): New helper.
(eldoc--handle-docs): Memorize state of request in doc buffer.
(eldoc-print-current-symbol-info): Pass a token to
eldoc--request-docs-p.
(Version): Bump to 1.6.0
bc10e467f1 Backport: Rectify allout-widgets region undecoration so it... 82742e295d Backport: Resolve missing button-region keymap bindings. 2035ecca57 Backport: Provide missing let definition to prevent backgr... 3071cecda0 Backport: Don't let item decoration be disrupted by too-sh... 044960ead2 Backport: Fix allout-widgets-mode handling of edits to ite...
Robert Pluim [Tue, 21 Jul 2020 14:37:59 +0000 (16:37 +0200)]
Run custom-magic-reset in the customize buffer
If the user has navigated away from the customize buffer, then
clicking on a widget in the customize buffer applies changes in the
selected buffer rather than in the customize buffer. Pass the
customize buffer to 'custom-magic-reset' to avoid this.
* lisp/cus-edit.el (custom-magic-reset): Add optional buffer argument,
apply changes in that buffer.
(custom-notify): Pass the buffer containing the widget to
'custom-magic-reset'. (Bug#40788)
* lisp/allout-widgets.el (allout-item-icon-keymap,
allout-item-body-keymap, allout-cue-span-keymap, allout-widgets-mode):
Inherit from both (current-local-map) and (current-global-map). This
provides for missing global bindings when inheriting from
just (current-local-map), eg Esc-<.
Ken Manheimer [Mon, 6 Jul 2020 17:19:11 +0000 (13:19 -0400)]
Backport: Provide missing let definition to prevent background void-variable error.
* lisp/allout-widgets.el (allout-widgets-exposure-change-processor)
Let-declare handled-conceal, for reference through `(symbol-value)'
within the let body. (Because the error happens in an
after-change-functions hook, so it is caught and reported as a message
by allout-widgets-hook-error-handler.)
Ken Manheimer [Tue, 7 Jul 2020 14:32:03 +0000 (10:32 -0400)]
Resolve missing button-region keymap bindings.
* lisp/allout-widgets.el (allout-item-icon-keymap,
allout-item-body-keymap, allout-cue-span-keymap, allout-widgets-mode):
Inherit from both (current-local-map) and (current-global-map). This
provides for missing global bindings when inheriting from
just (current-local-map), eg Esc-<.
Ken Manheimer [Mon, 6 Jul 2020 17:19:11 +0000 (13:19 -0400)]
Provide missing let definition to prevent background void-variable error.
* lisp/allout-widgets.el (allout-widgets-exposure-change-processor)
Let-declare handled-conceal, for reference through `(symbol-value)'
within the let body. (Because the error happens in an
after-change-functions hook, so it is caught and reported as a message
by allout-widgets-hook-error-handler.)
* lisp/gnus/gnus-start.el (gnus-active-to-gnus-format):
Add suppressive comment. Prepending "^to\\.\\|" is redundant when
'gnus-ignored-newsgroups' already matches that pattern, but adding
logic here is not worth the trouble.
project.el: Add more docs and two new key bindings
* lisp/progmodes/project.el:
Add a longer description of the package and how to use it.
(project-prefix-map): Add entries for
'project-or-external-find-file' and
'project-or-external-find-regexp'.