Make `n'/`p' in image-mode also find externally converted images
* lisp/image-file.el (image-file-name-regexp): Use it to make
`n'/`p' in image mode work (bug#39994).
* lisp/image/image-converter.el
(image-converter-file-name-extensions): New variable to keep track
of all suffixes.
(image-convert-p): Update.
(image-converter--find-converter): Set.
Fix problem with viewing .webp files from .zip buffers
* lisp/image-mode.el (image-toggle-display-image): Make it
possible to view images (via external formatters, like webp) from
zip files (and other archive modes) (bug#39994).
* lisp/image-mode.el (image-mode): Even when
`image-user-external-converter' is on, we may get
`unknown-image-type' (bug#39994). Adjust the error message in
that case.
Derek Zhou [Mon, 3 Aug 2020 05:56:22 +0000 (07:56 +0200)]
Fix problem where TLS connections would sometimes hang
* src/process.c (wait_reading_process_output): Before the select,
check every interesting gnutls stream for available data in the
buffer. If some of them hit, and either there is no wait_proc or
the wait_proc is one of the gnutls streams with new data, set the
select timeout to 0 after the select, and merge the gnutls buffer
status into the select returns (bug#40665). This fixes a problem
where TLS connections would sometimes hang.
Eli Zaretskii [Sun, 2 Aug 2020 15:27:33 +0000 (18:27 +0300)]
Re-enable scroll-margin when cursor-motion optimization is disabled
* src/xdisp.c (try_window): Fix logic of disabling margins when
cursor is close to BOB or EOB. Account for header-line, if any,
when computing the scroll margin in pixels. (Bug#42653)
Make the "All" setting for large-newsgroup-initial in Gnus work
* lisp/gnus/gnus-sum.el (gnus-articles-to-read): Use it.
(gnus-summary-insert-old-articles): Ditto.
* lisp/gnus/gnus.el (large-newsgroup-initial): Make the "All"
setting work by using a special symbol, instead of nil which is
indistinguishable from not being present (bug#38466).
Michael Albinus [Sun, 2 Aug 2020 11:26:00 +0000 (13:26 +0200)]
Fix Tramp portability issues
* lisp/net/tramp-sh.el (tramp-set-remote-path): Replace "echo -n" by
"printf", it isn't portable.
* test/lisp/net/tramp-tests.el (tramp-test33-environment-variables)
(tramp-test33-environment-variables-and-port-numbers): Do not use
"echo -n", it isn't portable.
(tramp--test-utf8): Filter out not displayable characters.
Signal an error in the user clicks "cancel" when signing in epg
* lisp/epg.el (epg-sign-string): If the user clicks "cancel" on
the pinentry, then we don't have an error from gpg(sm), but
instead nothing (bug#39058). Signal an error in that case.
Try to fix mailcap parsing again to respect Emacs defaults
* lisp/net/mailcap.el (mailcap--computed-mime-data): New variable.
(mailcap-parse-mailcaps): Don't delete Emacs-distributed fallback
values (bug#40247).
(mailcap-add-mailcap-entry): Extend to allow working on different
variables.
(mailcap-add): Store data in mailcap-user-mime-data, since it
should be heeded first.
Fix race condition in erc-server-send-queue vs quitting erc
* lisp/erc/erc-backend.el (erc-server-send-queue): Check that the
buffer is live before using it (bug#40418). This fixes a rare
problem when the queue is non-empty when `erc-quit-server' is run.
Michael Albinus [Sat, 1 Aug 2020 18:08:44 +0000 (20:08 +0200)]
Implement alternative for Tramp's signal return string
* lisp/net/tramp-adb.el (process-file-return-signal-string): Declare.
(tramp-adb-get-signal-strings): New defun.
(tramp-adb-handle-process-file): Use it.
* lisp/net/tramp-sh.el (process-file-return-signal-string): Declare.
(tramp-sh-get-signal-strings): New defun.
(tramp-sh-handle-process-file): Use it.
Suppress sanitizer errors about pointer arithmetic in a few places
We perform weird pointer arithmetic due to the layout of Lisp_Objects
holding symbols. ASan/UBSan warns about that (Bug#42530). Suppress
the warnings by performing the arithmetic on integer types and casting
back to pointers.
* src/alloc.c (mark_maybe_object, mark_memory): Temporarily cast
pointer to 'intptr_t'.
Eli Zaretskii [Sat, 1 Aug 2020 12:55:01 +0000 (15:55 +0300)]
Fix last change
* src/emacs-module.c (initialize_environment): Call
__lsan_ignore_object only if HAVE_SANITIZER_LSAN_INTERFACE_H is
undefined. This fixes compilation on systems that don't have
__lsan_* functions.
We intentionally leak some objects. Prevent the ASan leak detector
from raising false alarms in these cases.
* configure.ac: Search for lsan_interface.h header.
* src/data.c (make_blv): Allow leaking of buffer-local values.
* src/buffer.c (enlarge_buffer_text): Allow leaking of buffer text.
* src/emacs-module.c (Fmodule_load, initialize_environment): Allow
intentional leak of runtime and environment objects if module
assertions are enabled.
Stefan Monnier [Fri, 31 Jul 2020 15:58:13 +0000 (11:58 -0400)]
* lisp/emacs-lisp/byte-opt.el: Minor simplifications
(byte-optimize-form-code-walker): Use `byte-optimize-form` after
inlining, so optimizations are also applied to the top level call.
Simplify the code for `pure` functions using `byte-optimize-constant-args`.
(byte-optimize-all-constp): Remove, not used any more.
(byte-optimize-1+, byte-optimize-1-): Remove, they are redundant
with the `pure` annotation.
Stefan Kangas [Fri, 31 Jul 2020 04:02:30 +0000 (06:02 +0200)]
Declare some ancient compat aliases obsolete (Bug#41328)
* lisp/comint.el (comint-read-noecho):
* lisp/emacs-lisp/edebug.el (edebug-all-defuns):
* lisp/man.el (manual-entry):
* lisp/vc/log-edit.el (vc-log-mode-map, vc-log-entry-mode): Declare
ancient backwards-compatibility aliases and functions obsolete. The
oldest in this list was added in 1992, and the most recent in 2004.
* lisp/net/telnet.el (telnet-initial-filter): Don't use
`comint-read-noecho'.
Make gravatar-build-url respect dynamically bound variables again
* lisp/image/gravatar.el (gravatar-build-url): Compute
query-string first, so that dynamically bound values of
`gravatar-rating' (etc.) are respected, instead of computing it
when the callback happens.
Paul Eggert [Thu, 30 Jul 2020 20:58:58 +0000 (13:58 -0700)]
Update from Gnulib
This incorporates:
2020-07-30 work around some Oracle Studio attribute bugs
2020-07-29 fsusage, regex, stat-size: remove Cray support
2020-07-26 inttypes: remove support for AIX 4
2020-07-26 gettimeofday: remove workaround for Mac OS X 10.0
2020-07-26 don't require gl_LOCALTIME_BUFFER_DEFAULTS
2020-07-26 alloca: remove Cray-2 and Cray Y-MP support
2020-07-26 libgmp: remove dependency on havelib
2020-07-26 libgmp: remove HAVE_GMP, LIB_GMP
2020-07-25 multiarch: prepare for x86_64+arm64 universal in macOS 11
2020-07-25 sigprocmask: small autoconf macro improvement
2020-07-25 small autoconf macro improvements
2020-07-24 timespec: remove dependence on ‘verify’
2020-07-24 optimize a few more three-valued comparisons
2020-07-24 fix _GL_CMP parenthesization typo
2020-07-23 optimize three-valued comparison between integers
2020-07-24 doc: update for Mac OS X 10.13
2020-07-23 fchmodat, lchmod: use /proc on Cygwin
2020-07-21 inttypes: fix PRI*PTR and SCN*PTR on 64-bit native Windows
2020-07-12 libgmp: avoid warning when --without-libgmp is used
2020-07-12 libgmp: link to the correct shared library
* lib/mini-gmp-gnulib.c: Ignore -Wsuggest-attribute=malloc only for
* build-aux/config.guess, build-aux/config.sub:
* build-aux/install-sh, doc/misc/texinfo.tex, lib/c-strcasecmp.c:
* lib/c-strncasecmp.c, lib/fchmodat.c, lib/fsusage.c:
* lib/gettimeofday.c, lib/inttypes.in.h, lib/lchmod.c:
* lib/mini-gmp-gnulib.c, lib/nstrftime.c, lib/regex.h, lib/timespec.h:
* m4/alloca.m4, m4/getgroups.m4, m4/gettimeofday.m4:
* m4/gnulib-common.m4, m4/inttypes.m4, m4/libgmp.m4, m4/mktime.m4:
* m4/multiarch.m4:
Copy from Gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* src/Makefile.in, test/Makefile.in (LIBGMP):
Rename from LIB_GMP for compatibility with Gnulib.
All uses changed.
Paul Eggert [Thu, 30 Jul 2020 16:22:01 +0000 (09:22 -0700)]
Port to Oracle Studio 12.6 (sparc)
* src/alloc.c (__builtin_unwind_init) [!HAVE___BUILTIN_UNWIND_INIT]:
Move from here ...
* src/lisp.h: ... to here, since flush_stack_call_func uses it.
* src/pdumper.c (dump_off_from_lisp): Avoid ‘return n;;’ to pacify
Oracle Studio.
Eli Zaretskii [Thu, 30 Jul 2020 13:56:36 +0000 (16:56 +0300)]
Fix face extension past EOL in overlay strings
* src/xdisp.c (face_at_pos): Pass ATTR_FILTER to
face_for_overlay_string.
* src/xfaces.c (face_for_overlay_string): Accept an additional
argument ATTR_INDEX and pass it to merge_face_ref for merging the
face at POS. This ensures a face from buffer text will not be
merged unless it specifies the :extend attribute. (Bug#42552)
* src/dispextern.h (face_for_overlay_string): Adjust prototype.
* 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.