Make whitespace-mode highlight missing newlines at the end of buffers
* lisp/whitespace.el (whitespace-missing-newline-at-eof): New face
(bug#34952).
(whitespace-report-region): Add a test for
end-of-buffer-without-newline.
(whitespace-color-on): Ditto.
* doc/emacs/display.texi (Useless Whitespace): Document it.
Paul Eggert [Thu, 6 Aug 2020 22:24:47 +0000 (15:24 -0700)]
Update from Gnulib
This incorporates:
2020-08-06 libgmp: add <gmp/gmp.h> support
2020-08-06 Consider that clang defines __OPTIMIZE__ like GCC does
2020-08-06 Use __builtin_expect with clang everywhere
2020-08-05 Use __builtin_clz{,l,ll} with clang, also on Windows
2020-08-05 Use __builtin_ctz{,l,ll} and __builtin_ffs{,l,ll} with clang
2020-07-31 _GL_CMP: Improve documentation
2020-07-30 alloca, largefile: sync with Autoconf master
* lib/c++defs.h, lib/cdefs.h, lib/count-leading-zeros.h:
* lib/count-trailing-zeros.h, m4/alloca.m4, m4/gnulib-common.m4:
* m4/largefile.m4, m4/libgmp.m4:
Copy from Gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
Change how Mail-Copies-To: never is handled in Message
* lisp/gnus/message.el (message-get-reply-headers): Change how Mail-Copies-To: never is handled (bug#37591). When that header is
present, put all the remaining recipients in the To header,
instead of picking an arbitrary recipient to have in the To
header, and the rest in the Cc header.
Make it possible to use Message as a mailto: desktop handler
* doc/misc/message.texi (System Mailer Setup): Document the usage.
* lisp/gnus/gnus-art.el (gnus-url-mailto): Move most of the code
here to 'message-mailto-1' (bug#38314).
* lisp/gnus/message.el (message-parse-mailto-url): Mark as obsolete.
(message-parse-mailto-url): Rewritten slightly from the above.
(message-mailto): New command.
(message-mailto-1): New function.
Make 'n'/'p' in image mode buffers respect dired sorting
The commands now also now work on archive and tar mode parent buffers.
* doc/emacs/files.texi (Image Mode): Document it.
* lisp/arc-mode.el (archive-goto-file): New function (bug#38647).
(archive-next-file-displayer): Ditto.
* lisp/image-mode.el (image-next-file): Reimplement to work on
displayed dired buffers and the like. This means that `n' and `p'
now works on the displayed ordering in the dired buffer, so if
you've reversed the sorting, `n' picks the right "next" file.
(image-mode--directory-buffers): New function.
(image-mode--next-file): Ditto.
* lisp/tar-mode.el (tar-goto-file): New function.
(tar-next-file-displayer): Ditto.
* test/lisp/emacs-lisp/cconv-tests.el
(cconv-tests-cl-iter-defun-:documentation): Mark as unstable
(bug#42723).
(cconv-tests-iter-defun-:documentation): Ditto.
* lisp/emacs-lisp/autoload.el (batch-update-autoloads--summary):
Output " ..." at the end of the non-concluding lines to signify
that the output continues.
Make the loaddefs scraping compilation output look more regular
* lisp/Makefile.in ($(lisp)/loaddefs.el): Don't output the
directories here.
* lisp/emacs-lisp/autoload.el (batch-update-autoloads--summary):
New function.
(batch-update-autoloads): Use it to output the directories we're
scraping.
Compilation output with very long lines can be mistaken for errors
when they scroll by fast in the compilation output. Making it look
more like normal informational output avoids this confusion.
* lisp/emacs-lisp/byte-run.el (byte-compile-info): New function
that's more flexible that replaces 'byte-compile-info-string' and
'byte-compile-info-message'.
(byte-compile-info-string): Make obsolete.
(byte-compile-info-message): Ditto.
* lisp/international/ja-dic-cnv.el (skkdic-convert-okuri-ari)
(skkdic-convert-postfix, skkdic-convert-prefix)
(skkdic-collect-okuri-nasi, skkdic-set-okuri-nasi):
* lisp/finder.el (finder-compile-keywords):
* lisp/cus-dep.el (custom-make-dependencies): Adjust callers to
use the new function.
Paul Eggert [Thu, 6 Aug 2020 00:36:50 +0000 (17:36 -0700)]
Simplify Solaris port
This should avoid some configuration confusion as exemplified
by Jeffrey Walton’s recent bug report (Bug#42675).
* configure.ac (opsys): Simplify Solaris configuration by
not worrying about Solaris 9 and earlier, as they are no
longer supported by the Solaris developers. This should
support Walton’s ‘./configure --build=x86_64-sun-solaris’.
Instead of bothering with ‘opsys=sol2-6’ and ‘opsys=sol2-10’,
just use ‘opsys=solaris’. All uses changed.
(emacs_check_sunpro_c): Remove unused var.
* doc/misc/tramp.texi (Remote programs):
* etc/MACHINES, etc/PROBLEMS:
Modernize PATH for Oracle Developer Studio.
* etc/PROBLEMS: Move Solaris-related problems to legacy area,
except those that are still relevant.
Enable replying to an ical event even when not an attendee
* lisp/gnus/gnus-icalendar.el
(gnus-icalendar-event--build-reply-event-body): Display a warning
instead of barfing when user is missing from attendee list.
When the user identity is not present in the attendee list, an error
is triggered making replying to such an event impossible (the reply
message not being even composed). This replaces it with a warning.
This is necessary because one may receive events that the organizer
did not set up well and it is up to the user to decide whether or not
to reply to them (bug#41723).
Copyright-paperwork-exempt: yes
Harald Jörg [Wed, 5 Aug 2020 15:19:06 +0000 (17:19 +0200)]
cperl-mode.el: Correctly terminate HERE-docs
* lisp/progmodes/cperl-mode.el (cperl-find-pods-heres): cperl-mode
in the master branch wrongly uses the first occurrence of "HERE"
to terminate the string, resulting in badly fontified / indented
code which follows (bug#42251).
Philip K [Wed, 5 Aug 2020 14:07:41 +0000 (16:07 +0200)]
Wrap skeleton logic in atomic-change-group
* lisp/skeleton.el (define-skeleton): Use an atomic change group
so that if the user `C-g's in the middle of it, we're not left
with half a skeleton in the buffer (bug#42311).
Harald Jörg [Wed, 5 Aug 2020 13:55:00 +0000 (15:55 +0200)]
cperl-mode: Fix bad parameter construction in cperl-etags
* lisp/progmodes/cperl-mode.el (cperl-etags): This fails with
(wrong-type-argument stringp cperl-sub-regexp). The error came
with incorporating Jonathan Rockway's work (bug#42355).
* lisp/gnus/message.el (message-insert-screenshot): Force scaling
to 1, since the screenshot image will already be suitable for
displaying directly (it's the same resolution).
* lisp/gnus/message.el (message-screenshot-command): New variable.
(message-mode-map): New keystroke and menu item. Also add
mml-attach-file to the menu.
(message-insert-screenshot): New command.
* lisp/gnus/mml.el (mml-parse-1): Allow having
content-transfer-encoding already in the part, so that we can have
inline base64-encoded binaries in the Message buffers.
* lisp/progmodes/sh-script.el (sh-font-lock-keywords-var): Fontize
$(...) slightly better (bug#42417). Instead of just fontizing the
first word in the expression, fontize until the closing
parenthesis. This doesn't work well if you have nested $(...)
expressions.
* lisp/erc/erc.el (erc--unignore-user): Separate into own function
(bug#40137).
(erc-cmd-IGNORE): Ask if the user wants a timeout.
(erc--read-time-period): New function.
Alan Third [Sun, 2 Aug 2020 19:43:56 +0000 (20:43 +0100)]
Don't smooth images when scaling up (bug#38394)
* src/image.c (image_set_transform [HAVE_XRENDER]): Use different filter
when scaling up vs scaling down.
* src/nsimage.m (ns_image_set_smoothing):
([EmacsImage setSmoothing:]): New functions.
* src/nsterm.h: Add definitions.
* src/nsterm.m (ns_dumpglyphs_image): Disable smoothing if requested.
Paul Eggert [Tue, 4 Aug 2020 18:09:55 +0000 (11:09 -0700)]
Drop support for -fcheck-pointer-bounds
GCC has removed the -fcheck-pointer bounds option, and the Linux
kernel has also removed support for Intel MPX, so there’s no point
to keeping this debugging option within Emacs.
* src/bytecode.c (BYTE_CODE_THREADED):
* src/lisp.h (DEFINE_LISP_SYMBOL, XSYMBOL, make_lisp_symbol):
Assume __CHKP__ is not defined.
* src/ptr-bounds.h: Remove. All uses of ptr_bounds_clip,
ptr_bounds_copy, ptr_bounds_init, ptr_bounds_set removed.
* test/lisp/gnus/mml-sec-tests.el
(mml-first-secure-en-decrypt-sign-1): mml-secure-en-decrypt-sign-1
fail sometimes, on some machines, unless it's the first test. I'm
guessing there's a race condition somewhere in the test, but put
it first now to avoid build reports.
Fix two mml-sec minor bugs revealed by new test harness
* lisp/gnus/mml-sec.el
(mml-secure-allow-signing-with-unknown-recipient): New variable
(bug#18393) (but this should probably be fixed in a different way).
(mml-secure-epg-sign): Use it.
(mml-secure-check-user-id): Protect against recipients that aren't
email addresses, like "No recipient".
* test/lisp/net/network-stream-tests.el
(network-test--resolve-system-name): New function.
(echo-server-with-dns): Skip test if (system-name) doesn't look
like it's going to resolve (bug#42535).
* test/lisp/vc/vc-tests.el (vc-test--svn-enabled): Macos machines
may have a dummy svn program that helpfully just outputs "There's
no svn program here", so also test for the svnadmin program
(bug#42536).
Michael Albinus [Tue, 4 Aug 2020 12:19:51 +0000 (14:19 +0200)]
Add Tramp support of direct asynchronous process invocation
* doc/misc/tramp.texi (Predefined connection information):
Add "direct-async-process".
(Remote processes): New subsection "Improving performance of
asynchronous remote processes".
* lisp/net/tramp-adb.el (tramp-methods) <adb>: Add `tramp-login-program'
and `tramp-login-args'.
(tramp-adb-handle-make-process): Use `tramp-handle-make-process'.
(tramp-adb-maybe-open-connection): Add "set +o vi +o emacs" command.
* lisp/net/tramp-sh.el (tramp-sh-handle-make-process):
Use `tramp-handle-make-process'.
(tramp-sh-file-name-handler-p, tramp-multi-hop-p): New defuns.
(tramp-compute-multi-hops): Use `tramp-multi-hop-p'.
* lisp/net/tramp.el (tramp-dissect-file-name, tramp-dissect-hop-name):
Use `tramp-multi-hop-p'.
(tramp-handle-insert-file-contents, tramp-local-host-p):
Use `tramp-sh-file-name-handler-p'.
(tramp-handle-make-process): New defun.
* test/README: Add another example how to use SELECTOR.
* test/lisp/net/tramp-tests.el (tramp-test03-file-name-method-rules):
Adapt test.
(tramp--test-sh-p): Use `tramp-sh-file-name-handler-p'.
Paul Eggert [Mon, 3 Aug 2020 22:21:59 +0000 (15:21 -0700)]
Use void * for pointers in with_echo_area_buffer
* src/xdisp.c (with_echo_area_buffer): Pass void * instead of
ptrdiff_t, since the values are typically pointers and this ports
better to (mostly-theoretical) hosts where ptrdiff_t is narrower
than intptr_t. All uses changed.
Paul Eggert [Mon, 3 Aug 2020 22:21:59 +0000 (15:21 -0700)]
Simplify use of __lsan_ignore_object
* configure.ac: Use AC_CHECK_FUNCS_ONCE for __lsan_ignore_object.
* src/buffer.c, src/data.c, src/emacs-module.c, src/regex-emacs.c:
* src/search.c: Use __lsan_ignore_object unconditionally, and don’t
include sanitizer/lsan_interface.h.
* src/lisp.h (__lsan_ignore_object): Provide a dummy in the
typical case where leak sanitization is not available.
Paul Eggert [Mon, 3 Aug 2020 22:21:58 +0000 (15:21 -0700)]
Simplify pointer computation in mark_maybe_object
* src/alloc.c (mark_maybe_object):
Use simpler way to avoid -fsanitize=undefined false alarms,
by converting the word tag to intptr_t first.
Omit now-unnecessary runtime overflow check.
(mark_memory): Work even if UINTPTR_MAX <= INT_MAX (!).
Avoid duplicate Edebug symbols when backtracking (Bug#42701)
When Edebug backtracks, it nevertheless generates definitions for the
non-matching branches, see Bug#41988 and Bug#42701. This should be
fixed eventually (probably by deferring the definition until a branch
is known to match), but for now add a band-aid to avoid these
duplicate symbols, at least for anonymous forms.
Glenn Morris [Mon, 3 Aug 2020 15:31:15 +0000 (08:31 -0700)]
; Merge from origin/emacs-27
The following commits were skipped:
d767418b76 Backport: Make checking for liveness of global values more... 8c94ca94dc Backport: Fix subtle bug when checking liveness of module ... 8ecca2f09f Backport: Fix memory leak for global module objects (Bug#4...
Phil Sainty [Sat, 11 Jul 2020 07:40:27 +0000 (19:40 +1200)]
; lisp/so-long.el: Prevent potential error if comment-use-syntax is nil
* lisp/so-long.el (so-long-detected-long-line-p): Ensure that
`comment-start-skip' and `comment-end-skip' are both set if
`comment-use-syntax' is nil, as `comment-forward' requires them
to be bound in this scenario.
Phil Sainty [Fri, 3 Jul 2020 13:43:08 +0000 (01:43 +1200)]
; * lisp/so-long.el: Byte-compilation bug fix
As this `require' is not at the top-level (it is only conditionally
evaluated, when loading the library over the top of an earlier
version), we need `eval-and-compile' to ensure that both macros and
functions from advice.el are accounted for.
Please refer to the comments on spelling at the end of the library.
M-x ispell-buffer should find no misspellings in the documentation.
See also test/lisp/so-long-tests/spelling-tests.el
(The current spelling will persist while so-long.el is maintained in
its own Savannah repository, to avoid unnecessary conflicts between
the two versions. If in the future it is maintained solely in the
Emacs repository, changing the spelling would become an option.)
Note that "mitigations" (plural) is intentional -- this library
identifies a collection of different performance mitigations,
multiple of which will typically be in effect together.
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.
Grégory Mounié [Sun, 2 Aug 2020 13:56:33 +0000 (15:56 +0200)]
Avoid segfaults if XIM is set but not xim_styles
Emacs segfaults at the X11 initialization if XIM is set
and xim_styles is NULL. This patch avoids the crash.
* src/xfns.c: Check also if FRAME_X_XIM_STYLES(f) is NULL.
(Bug#42676) (Bug#42673) (Bug#42677)
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.