Paul Eggert [Tue, 26 Nov 2019 21:14:42 +0000 (13:14 -0800)]
Update from Gnulib
This incorporates:
2019-11-24 Fix errors in C++ mode on mingw
2019-11-24 time_r: Fix for mingw (regression from 2019-11-16)
2019-11-24 sys_time: Fix errors in C++ mode on mingw
2019-11-22 intprops: INT_MULTIPLY_WRAPV speedup for GCC 8.4+
2019-11-21 Disable many _GL_CXXALIASWARN on non-glibc
2019-11-21 Fix various errors in _GL_CXXALIAS_SYS invocations
2019-11-19 intprops: INT_MULTIPLY_WRAPV speedup for GCC 9.3+
2019-11-18 stdint: Define [u]intptr_t correctly on 64-bit native Windows
2019-11-18 stdint: Fix value of WINT_MAX when we override wint_t
2019-11-18 stdint: Avoid "conflicting types" error on mingw 5.22
2019-11-16 time_r: Fix for mingw
2019-11-06 regex: now back in sync with glibc
* lib/intprops.h, lib/regexec.c, lib/signal.in.h:
* lib/stdint.in.h, lib/stdio.in.h, lib/stdlib.in.h:
* lib/string.in.h, lib/sys_select.in.h, lib/sys_time.in.h:
* lib/time.in.h, lib/unistd.in.h, m4/time_r.m4:
Copy from Gnulib.
Eli Zaretskii [Tue, 26 Nov 2019 17:29:45 +0000 (19:29 +0200)]
Support ':extend' in faces defined by list of key/value pairs
* src/xfaces.c: Update and improve commentary at the beginning
of the file.
(face_attr_sym): New static array.
(init_xfaces): Initialize 'face_attr_sym'.
(merge_face_ref): Handle the :extend attribute in faces
specified as lists of key/value pairs. (Bug#37774)
Eli Zaretskii [Tue, 26 Nov 2019 17:13:12 +0000 (19:13 +0200)]
Fix MS-Windows build with mingw.org's MinGW
mingw.org's MinGW by default targets Windows 9X, so
_WIN32_WINNT is set to a value that bypasses declarations
in system headers we need to compile network_interface_list.
Also, the code needed a workaround for Windows XP, where
some functionality is missing from the GetAdaptersAddresses
API.
* src/w32.c (_WIN32_WINNT): Define to 0x0501, if the value is
lower, temporarily while processing iphlpapi.h.
(address_prefix_match): New helper function.
(network_interface_list): Work around the fact that the
OnLinkPrefixLength member of IP_ADAPTER_UNICAST_ADDRESS is not
available when _WIN32_WINNT < 0x0600. On Windows XP use
special code that calls address_prefix_match to compute the
network prefix length.
Robert Pluim [Fri, 15 Nov 2019 10:11:30 +0000 (11:11 +0100)]
Extend network-interface-list to return IPv6 and network info
Bug#38218
* src/process.c (Fnetwork_interface_list): Extend argument list to
allow requesting full network info and/or IPv4/IPv6 info.
(network_interface_list) [HAVE_GETIFADDRS]: Use getifaddrs to retrieve
interface IP addresses.
* src/process.h: Update prototype of network_interface_list.
* src/w32.c (g_b_init_get_adapters_addresses): New init flag.
(globals_of_w32): Initialize it.
(GetAdaptersAddresses_Proc): New function typedef.
(get_adapters_addresses): New wrapper function.
(init_winsock): Load htonl and ntohl.
(sys_htonl, sys_ntohl): New wrapper functions.
(network_interface_list): Implement in terms of
get_adapters_addresses.
* nt/inc/sys/socket.h: Add sys_htonl and sys_ntohl prototypes.
* etc/NEWS: Announce IPv4/IPv6 changes in network-interface-list.
* doc/lispref/processes.texi (Misc Network): Document updated arglist
and return values for network-interface-list.
Eli Zaretskii [Mon, 25 Nov 2019 15:52:24 +0000 (17:52 +0200)]
Fix face merging when some have :extend non-nil and some are inherited
* src/xfaces.c (face_inherited_attr): New function.
(merge_named_face): Call 'face_inherited_attr' when testing
whether a face that inherits from another fits the filtering
criteria specified by ATTR_FILTER.
(merge_face_vectors): Revert the changes made in this function
for filtering by ATTR_FILTER, and remove that argument as
well. These tests are now completely done by the caller, see
'merge_named_face'. (Bug#37774)
Robert Pluim [Sun, 17 Nov 2019 20:21:48 +0000 (21:21 +0100)]
Handle auth-source-search failures in open-network-stream
If the user cancels the gpg decryption pop-up, auth-source-search
fails *and* epa pops up an error buffer. Fix epa to allow suppressing
that, and ignore errors returned from auth-source-search.
* lisp/epa.el (epa-suppress-error-buffer): New defvar. Bind non-nil
to stop epa popping up an error buffer.
* lisp/net/network-stream.el: require epa when byte-compiling.
(network-stream-certificate): ignore errors when calling
auth-source-search, and suppress the epa error buffer.
Paul Eggert [Sat, 23 Nov 2019 23:47:28 +0000 (15:47 -0800)]
Add eassert check for bad default face
* src/xdisp.c (append_space_for_newline): Add an eassert check
that default_face is not null, by calling FACE_FROM_ID instead of
FACE_FROM_ID_OR_NULL. Initialize a local only if needed.
Paul Eggert [Sat, 23 Nov 2019 23:28:45 +0000 (15:28 -0800)]
Port gnutls.c to --enable-gcc-warnings --without-gnutls
* src/gnutls.c: Move the "#ifdef HAVE_GNUTLS" earlier, so
that "./configure --enable-gcc-warnings --without-gnutls"
does not complain about macros being defined but never used.
Indent "#" directives more consistently.
Juri Linkov [Sat, 23 Nov 2019 22:22:46 +0000 (00:22 +0200)]
Use new macro debounce-reduce to make mouse scaling of images more responsive
* lisp/emacs-lisp/timer.el (debounce, debounce-reduce): New macros.
* lisp/image.el (image-increase-size, image-decrease-size):
Use funcall to call image--change-size-function.
(image--change-size-function): Move code from defun of
image--change-size to defvar that has the value of lambda
returned from debounce-reduce. (Bug#38187)
Robert Pluim [Mon, 18 Nov 2019 09:48:29 +0000 (10:48 +0100)]
Default network-stream-use-client-certificates to nil
* lisp/net/network-stream.el (network-stream-use-client-certificates):
Default to nil.
(open-network-stream): Adapt description to new default of
network-stream-use-client-certificates.
* etc/NEWS: network-stream-use-client-certificates defaults to nil
now.
Robert Pluim [Tue, 19 Nov 2019 10:33:10 +0000 (11:33 +0100)]
Have what-cursor-position optionally show character name
* lisp/simple.el (what-cursor-show-names): New defcustom, default nil.
(what-cursor-position): Show character names if what-cursor-show-names
is non-nil.
* lisp/files.el (insert-directory): Always replace "total" with
"total used in directory", even when we don't have free disk space
(bug#13191). This makes the display more consistent.
Eli Zaretskii [Sat, 23 Nov 2019 11:37:28 +0000 (13:37 +0200)]
Improve indexing of modifier keys
* doc/emacs/commands.texi (User Input): Add index entry for
the Alt key serving as Meta.
* doc/emacs/custom.texi (Modifier Keys): Add index entries for
Alt, Super, and Hyper modifier keys. (Bug#38315)
Eli Zaretskii [Sat, 23 Nov 2019 10:43:49 +0000 (12:43 +0200)]
Fix cursor display at EOL before extended face
* src/xdisp.c (extend_face_to_end_of_line): Make sure the
character position of the stretch glyph inserted to extend the
face is zero, as various other parts of the display code rely
on that. (Bug#38330)
Eli Zaretskii [Sat, 23 Nov 2019 09:27:43 +0000 (11:27 +0200)]
Fix and speed up en/decoding of UTF-8 strings
* src/coding.c (get_char_bytes, encode_string_utf_8)
(decode_string_utf_8): Fix commentary.
(encode_string_utf_8): Return the original ASCII string only
if NOCOPY is non-zero.
(decode_string_utf_8): Accept 2 additional arguments STR and
STR_LEN, which allow to pass the input text as a C string.
(make_string_from_utf8): Delegate the job to decode_string_utf_8.
* src/coding.h: Update the prototype of decode_string_utf_8.
* src/json.c (json_encode): Call encode_string_utf_8.
Eli Zaretskii [Fri, 22 Nov 2019 14:36:25 +0000 (16:36 +0200)]
Fix uses of inhibit-message in package.el
* lisp/emacs-lisp/package.el (package-generate-autoloads)
(package--compile, package--save-selected-packages): Don't use
'inhibit-message' to bind 'noninteractive' and 'save-silently',
since 'inhibit-message' already disables all messages.
(Bug#38264)
João Távora [Wed, 20 Nov 2019 00:11:00 +0000 (00:11 +0000)]
Make auth-source-pass-search understand port lists
For cases such as a typical IMAP Gnus setup, auto-source-pass-search
is passed a list of "port aliases" like (993 "imaps" "imap" "993"
"143") in hopes of finding a matching ~/.password-store entry.
This modification makes this library understand and unroll the port
list so that, i.e. "domain:993", "domain:imaps"", "domain:imap",
etc. are computed as potential suffixes. Previously a nonsensical
string "domain:(993 imaps imap ...)" was returned.
* lisp/auth-source-pass.el
(auth-source-pass--generate-entry-suffixes): Allow PORT to be a list
of ports.
Handle the case where the token is not in `smie-grammar`, either because
the caller is making an error, or because it's a paren-like token that's
not handled in the grammar but directly via the syntax tables.
Eric Abrahamsen [Thu, 21 Nov 2019 18:08:41 +0000 (10:08 -0800)]
Fix Gnus summary backtab keybindings to use button-based functions
* lisp/gnus/gnus-sum.el (gnus-summary-mode-map,
gnus-summary-article-map): Backtab should call
gnus-summary-button-backward, not gnus-summary-widget-backward.
Eli Zaretskii [Thu, 21 Nov 2019 14:07:19 +0000 (16:07 +0200)]
Support 'vc-region-history' for Mercurial
* lisp/vc/vc-hg.el (vc-hg-region-history)
(vc-hg-region-history-font-lock, vc-hg-region-history-mode):
New functions.
(vc-hg-region-history-mode-map)
(vc-hg--log-view-long-font-lock-keywords)
(vc-hg-region-history-font-lock-keywords): New variables.
* lisp/vc/vc-git.el (vc-git-region-history): Update commentary.
* doc/emacs/maintaining.texi (VC Change Log): Add
'vc-region-history' to the table at beginning of node. Update
the VCSes that support 'vc-region-history'.
* lisp/auth-source.el (auth-source-netrc-looking-at-one): New
function, extracted from auth-source-netrc-parse-one.
(auth-source-netrc-parse-one, authinfo--hide-passwords): Use
auth-source-netrc-looking-at-one (bug#38311).
Juri Linkov [Wed, 20 Nov 2019 22:59:49 +0000 (00:59 +0200)]
* lisp/image.el: Mouse-wheel scaling on images (bug#38187)
* lisp/image.el (image-mouse-increase-size)
(image-mouse-decrease-size): New commands.
(image-map): Bind C-wheel-down and C-mouse-5 to
image-mouse-decrease-size, C-wheel-up and C-mouse-4 to
image-mouse-increase-size.
Michael Albinus [Wed, 20 Nov 2019 12:45:30 +0000 (13:45 +0100)]
Add renaming of remote buffer file names to Tramp
* doc/misc/tramp.texi (Default User): Fix typo.
(Cleanup remote connections): Adapt arguments of
`tramp-cleanup-connection'.
(Renaming remote files): New node.
(Frequently Asked Questions): New item "How to save files when a
remote host isn't reachable anymore?".
* etc/NEWS: Add `tramp-rename-files' and `tramp-rename-these-files'.
* lisp/net/tramp-cmds.el (tramp-default-rename-alist)
(tramp-confirm-rename-file-names): New defcustoms.
(tramp-rename-read-file-name-dir)
(tramp-rename-read-file-name-init): New defsubsts.
(tramp-default-rename-file, tramp-rename-files)
(tramp-rename-these-files): New defuns.
* lisp/net/tramp-integration.el (ido, ivy): Integrate with them.
Make with-suppressed-warnings work for macros, too
* lisp/emacs-lisp/macroexp.el (macroexp-macroexpand): Pass the
macro/alias symbol on to byte-compile-warning-enabled-p so that
with-suppressed-warnings works for macros, too.
Robert Pluim [Wed, 20 Nov 2019 10:55:42 +0000 (11:55 +0100)]
Remove info references to gmane web search
* doc/misc/gnus.texi (Foreign Groups, Web Searches, What is nnir?):
(Setting up nnir, Associating Engines, The imap Engine):
(Customizations): Remove references to gmane web search.
Stephen Gildea [Wed, 20 Nov 2019 05:26:09 +0000 (21:26 -0800)]
Expand coverage of unit tests for time-stamp
* test/lisp/time-stamp-tests.el: Remove redundant word "test"
from the names of all the tests.
(time-stamp-custom-time-zone, time-stamp-custom-pattern,
time-stamp-custom-inserts-lines, time-stamp-custom-count,
time-stamp-helper-safe-locals): New tests
Paul Eggert [Wed, 20 Nov 2019 02:23:01 +0000 (18:23 -0800)]
Make .pdmp file more reproducible
Problem reported by Ulrich Müller
<https://lists.gnu.org/r/emacs-devel/2019-11/msg00757.html>
and diagnosed by Andreas Schwab
<https://lists.gnu.org/r/emacs-devel/2019-11/msg00774.html>.
* src/sysdep.c (maybe_disable_address_randomization):
Disable ASLR if any kind of dumping, instead of merely if
unexec dumping. Omit first arg for simplicity; all uses changed.
Eli Zaretskii [Tue, 19 Nov 2019 15:48:55 +0000 (17:48 +0200)]
Fix updating members of zip archives
* lisp/arc-mode.el (archive-zip-case-fiddle): Change the
default to nil except on MS-DOS. Update the doc string to
make clear that a non-nil value also affects updating the
archive. (Bug#38260)
Robert Pluim [Mon, 18 Nov 2019 09:57:55 +0000 (10:57 +0100)]
Don't error when comparing IPv4 and IPv6 addresses
* lisp/net/nsm.el (nsm-network-same-subnet): Compare lengths of
local-ip and ip; different lengths can never match.
(nsm-should-check): Chop port off end of address.
* lisp/image.el (image-type): Allow passing in the image type.
(create-image): Make conversion work with data in addition to files.
* lisp/image/image-converter.el (image-convert-p): Allow taking
working on data in addition to files (bug#38036).
(image-convert): Ditto.
(image-converter--convert): Extend signature to say whether we're
getting a file or data.
(image-converter--convert-magick): Convert data.
(image-converter--convert): Ditto.
Juri Linkov [Mon, 18 Nov 2019 21:53:11 +0000 (23:53 +0200)]
* lisp/vc/ediff-util.el: Set this-command to ediff-quit (bug#38219)
* lisp/vc/ediff-util.el (ediff-toggle-read-only, ediff-quit):
Set this-command to the same command after using y-or-n-p
that doesn't guarantee to keep this-command unchanged
to check it later for some contrived logic.
* lisp/emacs-lisp/cl-extra.el (cl-prettyexpand): This function has
apparently not worked for at least a couple of decades
(bug#38206) unless supplied with a FULL parameter. Make the FULL
parameter obsolete and make the function always work as it did
with a non-nil FULL.
Phil Sainty [Sat, 16 Nov 2019 02:48:44 +0000 (15:48 +1300)]
lisp/so-long.el: Refactor menu action commands
* lisp/so-long.el (so-long-menu): Call `so-long' with an ACTION
argument instead of using `so-long-menu-item-replace-action'.
(so-long-menu-item-replace-action): Remove the deprecated function.
* test/lisp/so-long-tests/so-long-tests.el
(so-long-tests-so-long-menu-item-replace-action): Update the test.
Phil Sainty [Sat, 16 Nov 2019 13:11:20 +0000 (02:11 +1300)]
* lisp/so-long.el (so-long): Firstly revert the existing action, if any
This makes `so-long' consistent with the action commands in the menu.
If multiple actions were to be layered on top of one another, we would
lose the ability to revert to the normal state. Custom actions
combining multiple other actions can be defined if necessary.
Stefan Monnier [Sat, 16 Nov 2019 01:39:00 +0000 (14:39 +1300)]
lisp/so-long.el: Use (interactive "@") for menu commands
* lisp/so-long.el (so-long-menu, so-long-menu-item-replace-action)
(so-long-revert): Use interactive code "@", replacing all uses of
`so-long-menu-click-window'. This approach leaves the window selected
afterwards, whereas the old code did not; but that is not a problem.
(so-long-menu-click-window, so-long-menu-item-revert): Remove the
deprecated functions.
* test/lisp/so-long-tests/so-long-tests.el
(so-long-tests-so-long-menu-item-replace-action): Update the test.
Co-authored-by: Phil Sainty <psainty@orcon.net.nz>
* configure.ac (HAVE_HARFBUZZ): Remove the check for explicit
harfbuzz -- have_harfbuzz defaults to "yes", so we have no way of
checking whether the user really asked for it, apparently.
(do-after-load-evaluation): Replace run-with-timer with run-with-idle-timer
to give a chance for the minibuffer to handle initial events before sit-for.
https://lists.gnu.org/archive/html/emacs-devel/2019-11/msg00581.html
* src/xftfont.c (xftfont_open): FC_CHARCELL is apparently an alias
for FC_DUAL used in some east Asian fonts (bug#35079). Modelled
after a patch suggested by Kenichi Handa.
Eli Zaretskii [Sun, 17 Nov 2019 16:19:18 +0000 (18:19 +0200)]
Support more font weight values on MS-Windows
* src/w32font.c (w32_to_fc_weight): Support a few more weight
values, for compatibility with the GTK font selection widget
(see gtkutil.c:XG_WEIGHT_TO_SYMBOL). (Bug#24226)