* src/image.c (equal_lists): Remove.
(search_image_cache): Use Fequal instead of equal_lists.
Benchmarking shows no measurable time difference, and this
restores the cache semantics from Emacs 27 (where file names
didn't have to be EQ for the cache to be used).
Serge Tupchii [Tue, 8 Dec 2020 20:22:34 +0000 (21:22 +0100)]
Fix crash (segfault) in etags on generating tags for Erlang files
* lib-src/etags.c: Set allocated and lastlen to zero, after
freeing last ptr in Erlang_functions to prevent dereferencing NULL
pointer (bug#45122).
Copyright-paperwork-exempt: yes
Make rcirc nick renaming heed nickname max lengths
* lisp/net/rcirc.el (rcirc-server-parameters): New variable (bug#6795).
(rcirc-connect): Set it.
(rcirc-handler-433): Use the length from the server.
(rcirc-handler-005): Collect server data.
(rcirc-server-parameter-value): New utility function.
(rcirc--make-new-nick): New function.
* lisp/hexl.el (hexl-scroll-down):
(hexl-scroll-up): Take ruler-mode into account when computing the
number of lines (bug#7031). These commands would previously jump
one line too many by default, skipping one line.
Make the history traversal functions in coming more regular
* lisp/comint.el (comint-previous-matching-input): Allow restoring
the input on wraps (bug#7885).
(comint-previous-matching-input-from-input): Restore input on wraps.
The debugger needs to receive a list of the error symbol and data;
cf. the documentation of the `debugger' variable. This bug manifested
itself in ERT forms such as (should (integerp (ert-fail "Boo"))),
which resulted in an incorrect condition object. Note that forms such
as (should (ert-fail "Boo")) weren't affected because they wouldn't
use the `ert--should-signal-hook'.
* test/emacs-lisp/ert.el (ert--should-signal-hook): Call debugger with
the right arguments.
* test/lisp/emacs-lisp/ert-tests.el (ert-test-fail-inside-should): Add
unit test.
* lisp/desktop.el (desktop-read): Don't reload the desktop file if
it's already been loaded, because the later query may lead to
desktop-dirname being set to nil (bug#9765).
Daniel Martín [Mon, 7 Dec 2020 16:01:35 +0000 (17:01 +0100)]
Add commands xref-next-group and xref-prev-group
* lisp/progmodes/xref.el (xref-next-group): New command that navigates
to the first item of the next xref group (typically a file).
(xref-prev-group): New command that navigates
to the first item of the next xref group (typically a file).
(xref--xref-buffer-mode-map): Bound the new commands to 'N' and 'P',
respectively.
* doc/emacs/maintaining.texi (Xref Commands): Document the new
commands in the Emacs manual.
* etc/NEWS: Announce them (bug#45089).
* lisp/server.el (server-execute): Focus the frame here...
(server-switch-buffer): Instead of here (bug#15469). This ensures
that the frame has focus if Emacs is querying the user about
something when opening a file (for instance "Revert from file?").
Allow using newer versions of Gnuplot from calc again
* lisp/calc/calc-graph.el (calc-graph-plot): Don't use the "time"
abbreviation for "timestamp" (bug#39232) -- it's no longer valid
after
https://github.com/gnuplot/gnuplot/commit/b979b5371bc1c18bf8f5bd756e7c1fb54dafd8cc
* lisp/textmodes/tex-mode.el (tex--quote-spec): New function
(bug#14286).
(tex-format-cmd): Use it.
(tex-compile): Don't quote the file names, because we're using
`file-exists-p' and friends on the results later, and that fails
on systems where everything is quoted, and on file names that need
quoting.
Add new variable to selectively suppress backtraces in batch mode.
* src/eval.c (syms_of_eval): Define new variable
'backtrace-on-error-noninteractive' to selectively enable backtrace
printing in batch mode.
(signal_or_quit): Use it.
* etc/NEWS: Document new variable.
* test/src/eval-tests.el (eval-tests/backtrace-in-batch-mode/inhibit):
New unit test.
Stefan Monnier [Mon, 7 Dec 2020 03:18:48 +0000 (22:18 -0500)]
* lisp/emacs-lisp/lisp-mode.el: Give paren syntax to [...] in lisp-data-mode
(lisp-data-mode-syntax-table): Rename from lisp--mode-syntax-table.
Adjust all users. Set [...] to have paren syntax.
(lisp-data-mode): Don't set `lisp-syntax` arg any more
* lisp/progmodes/elisp-mode.el (emacs-lisp-mode-syntax-table):
Don't bother setting [...] to have paren syntax any more.
* lisp/progmodes/inf-lisp.el (inferior-lisp-mode): Don't use
`lisp-syntax` arg of lisp-mode-variables any more.
* lisp/calc/calccomp.el (math-compose-integ): Use Unicode integral
signs when available instead of a crude ASCII approximation, with a
shorter stem to save space.
* lisp/gnus/nnimap.el (nnimap--split-download-body): New variable.
(nnimap-fetch-inbox): Use it in conjunction with
nnimap-split-download-body.
* lisp/gnus/spam.el: Don't load nnimap.el at compile time for a
dynamic variable.
(spam-setup-widening): Rather than unconditionally set user option
nnimap-split-download-body, set nnimap--split-download-body to a
unique non-nil value only if the variable was nil (bug#44981).
(spam-teardown-widening): New function that undoes this if
nnimap--split-download-body still holds the unique value.
(spam-unload-hook): Call spam-teardown-widening to revert any change
to the value of nnimap--split-download-body.
Stefan Monnier [Sat, 5 Dec 2020 15:41:03 +0000 (10:41 -0500)]
* lisp/progmodes/perl-mode.el: Fix handling of s'foo'bar'
(perl-syntax-propertize-function): Don't put a syntax-property
on regexp-op delimiters if they're already handled correctly
by the normal syntax tables.
(perl-syntax-propertize-special-constructs): Mark the middle
quote of s'foo'bar' as punctuation.
* test/manual/indent/perl.perl: Add new test cases.
* lisp/simple.el: Specify comint-term-environment arglist in
function declaration.
(shell-command): Load shell.el before calling
comint-term-environment; otherwise it is undefined. Allow
async-shell-command-width to take precedence over the COLUMNS value
returned by comint-term-environment. (Bug#45034)
William Xu [Sat, 5 Dec 2020 00:14:32 +0000 (02:14 +0200)]
xref--show-defs-minibuffer: new "show definitions" UI
* lisp/progmodes/xref.el (xref--show-defs-minibuffer):
New function to use as xref-show-definitions-function
(https://lists.gnu.org/archive/html/emacs-devel/2020-11/msg00824.html).
Eli Zaretskii [Fri, 4 Dec 2020 14:47:49 +0000 (16:47 +0200)]
Don't abort when terminated by SIGINT in -batch
* src/xdisp.c (clear_message_stack): New function.
* src/emacs.c (terminate_due_to_signal): Call clear_message_stack
when we are being shut down by SIGINT under -batch.
* src/lisp.h (clear_message_stack): Add prototype.
* lisp/cus-edit.el (custom-save-all): Do the custom saves as an
atomic change group, to avoid writing invalid data if something
goes wrong (or the user hits `C-g') in the middle (bug#18633).
Alyssa Ross [Fri, 4 Dec 2020 10:06:48 +0000 (11:06 +0100)]
Make shell-command use comint settings
* lisp/simple.el (shell-command): Use the term environment from
comint, so that comint settings are used for commands like
`async-shell-command', too (bug#45034).
Dmitry Gutov [Fri, 4 Dec 2020 01:37:10 +0000 (03:37 +0200)]
Support using ripgrep in project-find-regexp and friends
Performance results vary here. Some projects and search terms
don't see much of a change, but for some (including Emacs sources
checkout and case-insensitive search) the switch to ripgrep shows
~2-3x speed improvement. Another piece of anecdata here:
https://lists.gnu.org/archive/html/emacs-devel/2020-06/msg00802.html
* lisp/progmodes/xref.el (xref-search-program-alist)
(xref-search-program): New user options.
(xref-matches-in-files): Use them.
Eric Abrahamsen [Wed, 2 Dec 2020 23:52:25 +0000 (15:52 -0800)]
Restore nnimap-split-download-body as a customization option
* lisp/gnus/nnimap.el (nnimap-split-download-body): And add an
obsolete alias for `nnimap-split-download-body-default'.
(nnimap-fetch-inbox): Check the value of the option, not the variable.
* doc/misc/gnus.texi (Client-Side IMAP Splitting): Move the primary
documentation of this option to this section.
For discussion, see the following thread:
https://lists.gnu.org/r/emacs-devel/2020-04/msg00880.html
* doc/emacs/cmdargs.texi (General Variables): Mention
shell-file-name in relation to SHELL.
* doc/emacs/misc.texi (Interactive Shell): Move index entry for
SHELL environment variable from here, where it is not mentioned...
(Single Shell): ...to here, where it is discussed along with
shell-file-name.
* lisp/dired.el (dired-insert-directory): Use shell-file-name
instead of explicit-shell-file-name when a shell is implicitly
requested.
* lisp/obsolete/terminal.el (explicit-shell-file-name):
* lisp/term.el (explicit-shell-file-name): Remove duplicate
defcustoms and load lisp/shell.el instead. (Bug#40679)
* lisp/shell.el (explicit-shell-file-name): Clarify docstring.
(shell): Simplify.