Eric Abrahamsen [Sun, 17 Jan 2021 02:37:57 +0000 (18:37 -0800)]
Fixes to gnus-agent-retrieve-headers
* lisp/gnus/gnus-agent.el (gnus-agent-retrieve-headers): The
sort->append call was altering fetched-headers in-place. Also, we
should explicitly sort-numeric-fields in this
function. gnus-agent-check-overview-buffer will do this, but treats it
as a failure mode and will make a backup of the overview file.
Eric Abrahamsen [Sun, 3 Jan 2021 23:57:34 +0000 (15:57 -0800)]
Remove writing of headers into Gnus' cache files
* lisp/gnus/gnus-cache.el (gnus-cache-retrieve-headers): This function
should not be responsible for caching new headers, only returning
existing ones.
Mauro Aranda [Sat, 2 Jan 2021 14:59:36 +0000 (11:59 -0300)]
Fix Quit button in dictionary buffer
* lisp/net/dictionary.el (dictionay-close): Changing the arity of the
function in cc5f2803785c5dc785f09a292313cf799e8d29bb was a mistake.
Restore it, but mark the argument as unused to avoid a
wrong-number-of-arguments error when using the Quit button.
Avoid printing stacktraces when it probably wouldn't work anyway.
* src/eval.c (signal_or_quit): Don't try to call the debugger if it's
inhibited or we are about to dump or bootstrap. In those cases the
debugger probably wouldn't work anyway.
The test 'process-tests/fd-setsize-no-crash/make-process' used to call
'sleep' to ensure that enough processes are live to trigger a
FD_SETSIZE overflow. However, we can just call 'cat' instead and
close standard input when done. That way, we only wait as long as
needed.
* process-tests.el
(process-tests/fd-setsize-no-crash/make-process): Invoke 'cat' instead
of 'sleep'. Close standard input to exit the 'cat' processes.
The 'process-tty-name' already provides the TTY name, we don't have
interrogate the TTY host.
* test/src/process-tests.el
(process-tests/fd-setsize-no-crash/make-serial-process): Use
'process-tty-name' instead of having the TTY host print its TTY
name. Check whether TTY names are unique.
(process-tests--new-pty, process-tests--with-temp-file): Remove;
no longer used.
Alan Third [Wed, 16 Dec 2020 21:12:04 +0000 (21:12 +0000)]
Improve drawing performance on macOS
* configure.ac: Require IOSurface framework.
* src/nsterm.h: New EmacsSurface class and update EmacsView
definitions.
* src/nsterm.m (ns_update_end):
(ns_unfocus): Use new unfocusDrawingBuffer method.
(ns_draw_window_cursor): Move ns_focus to before we set colors.
([EmacsView dealloc]):
([EmacsView viewDidResize:]): Handle new EmacsSurface class.
([EmacsView initFrameFromEmacs:]): Remove reference to old method.
([EmacsView createDrawingBuffer]): Remove method.
([EmacsView focusOnDrawingBuffer]):
([EmacsView windowDidChangeBackingProperties:]): Use new EmacsSurface
class.
([EmacsView unfocusDrawingBuffer]): New method.
([EmacsView copyRect:to:]): Get information from the context instead
of direct from the IOSurface.
([EmacsView updateLayer]): Use new EmacsSurface class.
([EmacsView copyRect:to:]): Use memcpy to copy bits around instead of
using NS image functions.
([EmacsSurface initWithSize:ColorSpace:]):
([EmacsSurface dealloc]):
([EmacsSurface getSize]):
([EmacsSurface getContext]):
([EmacsSurface releaseContext]):
([EmacsSurface getSurface]):
([EmacsSurface copyContentsTo:]): New class and methods.
Roland Winkler [Fri, 1 Jan 2021 22:35:15 +0000 (16:35 -0600)]
bibtex-mode: Handle biblatex field aliases (bug#44976)
* lisp/textmodes/bibtex.el (bibtex-biblatex-entry-alist): Define
field aliases.
(bibtex-vec-incr): Remove.
(bibtex-format-entry, bibtex-validate): Check for field aliases.
(bibtex--skip-field-aliases): New function.
(bibtex-field-list): Use it.
Paul Eggert [Fri, 1 Jan 2021 20:55:35 +0000 (12:55 -0800)]
Add overflow check for INPUT_EVENT_POS_MIN
* src/keyboard.c (INPUT_EVENT_POS_MIN): Don’t assume (-1 -
INPUT_EVENT_POS_MAX) fits into ptrdiff_t. This fixes a
purely-theoretical problem that cannot occur on two’s-complement
arithmetic. The Solaris 10 compiler still complains incorrectly,
but oh well.
Paul Eggert [Fri, 1 Jan 2021 20:52:55 +0000 (12:52 -0800)]
Port to Solaris 10
* configure.ac: Instead of AC_CHECK_HEADER, use AC_COMPILE_IFELSE
with X11/Intrinsic.h when checking for X11/extensions/Xrender.h.
This suppresses a bogus "report a bug to bug-gnu-emacs" diagnostic
from 'configure' in Solaris 10.
(SETUP_SLAVE_PTY): Adjust to recent renaming of forkin to
std_in in callproc.c. Needed on Solaris and Unixware.
* lib-src/Makefile.in (LIB_GETRANDOM, LIBS_ETAGS): New vars,
needed because on Solaris 10 the Gnulib tempname module now needs
the -lrt library for clock_gettime. Throw in the LIB_GETRANDOM
stuff too while we’re at it; from getrandom.m4 it seems to be
needed for MingW.
(LIBS_MOVE, etags_libs): Use them.
* src/callproc.c [SETUP_SLAVE_PTY]: Include sys/stream.h
and sys/stropts.h, for SETUP_SLAVE_PTY’s definiens.
* src/process.c [NEED_BSDTTY]: Don’t include bsdtty.h; hasn’t been
needed in years.
[USG5_4]: Don’t include sys/stream.h or sys/stropts.h; these
directives havbe been moved to callproc.c because the only use of
SETUP_SLAVE_PTY is there now.
Paul Eggert [Fri, 1 Jan 2021 16:45:41 +0000 (08:45 -0800)]
New file scratch_buffer_dupfree.c
* lib/malloc/scratch_buffer_dupfree.c: New file, from Gnulib
(originally from glibc 2.33 code).
This is needed on macOS and some other platforms;
I forgot to commit it in the most recent Gnulib update.
Paul Eggert [Fri, 1 Jan 2021 09:14:58 +0000 (01:14 -0800)]
Merge from origin/emacs-27
74a77ef299 Improve documentation of 'network-lookup-address-info' c6d5555646 Display messages sent using ERC's /say c156723769 Fix Rmail summary display when From: header is malformed
Eli Zaretskii [Thu, 31 Dec 2020 20:27:30 +0000 (22:27 +0200)]
Improve documentation of 'network-lookup-address-info'
* src/process.c (Fnetwork_lookup_address_info):
* doc/lispref/processes.texi (Misc Network): Document the error
message emitted by 'network-lookup-address-info' when it fails.
Dmitry Gutov [Thu, 31 Dec 2020 16:39:22 +0000 (18:39 +0200)]
ruby-mode: Recognize setter symbols
* lisp/progmodes/ruby-mode.el (ruby-syntax-propertize):
Add a rule for setter symbols (bug#42846).
(ruby-font-lock-keywords): Remove dead code, left over from before
commit 26f9c507.
* lisp/progmodes/ruby-mode.el (ruby-smie--bosp):
Handle '=' being part of a symbol (bug#42846).
Daniel Martín [Thu, 31 Dec 2020 05:00:24 +0000 (06:00 +0100)]
Fix duplicated entry in gnus-mime-action-alist
* lisp/gnus/gnus-art.el (gnus-mime-action-alist): Remove duplicated
"toggle display" entry and call the appropriate function for the "view
as charset" action (bug#45561).
Philipp Stephani [Wed, 30 Dec 2020 23:05:14 +0000 (00:05 +0100)]
Fix a potential unit test breakage on GNU/Linux.
* test/src/process-tests.el
(process-tests/fd-setsize-no-crash/make-process): Allow special exit
codes that can happen if terminal setup fails in the child process.
Philipp Stephani [Wed, 30 Dec 2020 21:33:22 +0000 (22:33 +0100)]
Consistently check for FD_SETSIZE overflow.
Previously this was only checked in a few places. Now assert that
file descriptors are within the expected range whenever we'd otherwise
introduce undefined behavior.
* src/process.c (add_read_fd, add_process_read_fd, delete_read_fd)
(recompute_max_desc, delete_write_fd, compute_input_wait_mask)
(compute_non_process_wait_mask, compute_non_keyboard_wait_mask)
(compute_write_mask, clear_waiting_thread_info)
(update_processes_for_thread_death, Fset_process_thread)
(create_process, create_pty, Fmake_pipe_process)
(Fprocess_datagram_address, Fset_process_datagram_address)
(Fmake_serial_process, finish_after_tls_connection)
(connect_network_socket, deactivate_process)
(server_accept_connection, wait_reading_process_output)
(read_process_output, read_and_dispose_of_process_output)
(send_process, Fcontinue_process, Fprocess_send_eof)
(Fprocess_filter_multibyte_p, keyboard_bit_set)
(add_timer_wait_descriptor, setup_process_coding_systems): Add
assertions to document and check that file descriptors are within the
expected range when used as file descriptor set elements or array
subscripts.
Philipp Stephani [Wed, 30 Dec 2020 21:28:06 +0000 (22:28 +0100)]
Extend and overhaul FD_SETSIZE overflow tests.
Instead of trying to generate the right number of processes,
pre-create lots of unused pipe processes until creation fails. Extend
the tests to the 'pty' connection type and other kinds of process
objects.
* test/src/process-tests.el (process-tests--ignore-EMFILE)
(process-tests--with-buffers, process-tests--with-processes)
(process-tests--with-many-pipes, process-tests--with-temp-file)
(process-tests--with-temp-directory): New helper macros.
(process-tests/fd-setsize-no-crash/make-process): Renamed from
'process-tests/fd-setsize-no-crash'. Fail on timeout. Also test the
'pty' connection type. Pre-create lots of pipe processes so we reach
the FD_SETSIZE limit faster. Ignore EMFILE more precisely, if
possible.
(process-tests/fd-setsize-no-crash/make-pipe-process)
(process-tests/fd-setsize-no-crash/make-network-process)
(process-tests/fd-setsize-no-crash/make-serial-process): New tests
that test FD_SETSIZE limits for other kinds of processes.
(process-tests--EMFILE-message): New helper function and cache
variable.
(process-tests--new-pty): New helper function.
Dmitry Gutov [Wed, 30 Dec 2020 11:48:45 +0000 (13:48 +0200)]
Add 'project-relative' as value for 'xref-file-name-display'
* lisp/progmodes/xref.el (xref-file-name-display): Document new value.
(xref-location-group ((l xref-file-location))): Handle the new value.
(xref--project-root): Extract from the default method of
'xref-backend-references' so it can be used in above's new code.
Also fix an old bug in the "backward compat" branch.
* lisp/progmodes/xref.el (xref--project-root-memo): New variable.
* test/lisp/progmodes/xref-tests.el: Add test cases for the three
possible settings of 'xref-file-name-display'.
Juri Linkov [Wed, 30 Dec 2020 09:54:01 +0000 (11:54 +0200)]
Add variables read-char-choice-use-read-key and y-or-n-p-use-read-key
* lisp/subr.el (read-char-choice-use-read-key): New variable.
(read-char-choice): Use read-char-from-minibuffer when
read-char-choice-use-read-key is nil.
(y-or-n-p-use-read-key): New variable.
(y-or-n-p): Restore old code that calls read-key to use it when
y-or-n-p-use-read-key is non-nil.
* lisp/dired-aux.el (dired--no-subst-ask, dired-query):
* lisp/files.el (files--ask-user-about-large-file)
(hack-local-variables-confirm):
* lisp/userlock.el (ask-user-about-supersession-threat):
* lisp/wid-edit.el (widget-choose): Revert to use read-char-choice
instead of read-char-from-minibuffer.
Juri Linkov [Wed, 30 Dec 2020 09:30:57 +0000 (11:30 +0200)]
In Isearch bind 'C-s M-y' to isearch-yank-pop-only with old code (bug#45483)
* lisp/isearch.el (isearch-menu-bar-yank-map, isearch-mode-map):
(isearch-forward): Use isearch-yank-pop-only instead of isearch-yank-pop.
(isearch-yank-pop): Mention isearch-yank-pop-only.
(isearch-yank-pop-only): New command with old body from Emacs 27.
* test/lisp/progmodes/xref-tests.el (xref-tests-data-dir):
Rename to 'xref-tests--data-dir'.
(xref-tests--matches-in-data-dir, xref-tests--locations-in-data-dir):
New functions. Factored out from test cases and updated usage sites
to use them.
Eli Zaretskii [Tue, 29 Dec 2020 19:30:59 +0000 (21:30 +0200)]
A better fix for process-tests on MS-Windows
* src/w32.c (pipe2): When forcibly closing pipe handles due to
overflow of FD_SETSIZE, set the handles to -1, to avoid assertion
violations in emacs_close.
* test/src/process-tests.el (process-tests/fd-setsize-no-crash):
No need to skip this test anymore.
Eli Zaretskii [Tue, 29 Dec 2020 18:41:46 +0000 (20:41 +0200)]
Fix process-tests on MS-Windows
* test/src/process-tests.el (process-tests/fd-setsize-no-crash):
Skip this test on windows-nt systems, as we cannot use more than
FD_SETSIZE file descriptors there: if we try, we crash.
Each menu entry now has the key binding in a right-aligned column, as
an attempt to improve readability. Previously the keys were given in
brackets immediately following the menu string.
* src/nsmenu.m ([EmacsMenu parseKeyEquiv:]): Remove.
(skipspc): New helper function.
([EmacsMenu addItemWithWidgetValue:]): Add attributes argument.
Use attributed title string. Don't special-case Super bindings.
([EmacsMenu fillWithWidgetValue:]): Compute maximum width. Prepare
attributes for title.
Michael Albinus [Tue, 29 Dec 2020 14:36:38 +0000 (15:36 +0100)]
Sync with Tramp 2.5.0
* doc/misc/trampver.texi:
* lisp/net/trampver.el: Change version to "2.5.0".
* test/lisp/net/tramp-tests.el
(tramp--test--deftest-direct-async-process): Check, that
`make-process' supports file name handlers. Suppress
`internal-default-process-sentinel'.
(tramp--test-async-shell-command): Set `proc' proper.
(tramp-test32-shell-command-direct-async): Tag it :unstable.
* src/xdisp.c (display_string): Revert adding the additional
ignore_text_properties parameter -- it was already covered by the
other mix of parameters.