* 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.
By default, entering view-mode echoes a usage message. This is
particularly helpful with non-nil view-read-only, to notify the user
that view-mode has been enabled. It is less useful and more spammy,
however, if view-mode is (possibly inadvertently) entered from some
non-interactive code running in the background, such as when a major
mode is enabled in a temporary buffer for text formatting
purposes (bug#44629).
* lisp/jsonrpc.el (jsonrpc-events-buffer, initialize-instance): Use
buffer-read-only in place of read-only-mode for non-interactive use.
* lisp/view.el (view-mode-enter): Inhibit help message if either
view-inhibit-help-message is non-nil, or view-mode-enter was called
from an interactive command. Suggested by João Távora
<joaotavora@gmail.com>.
Stefan Kangas [Wed, 2 Dec 2020 14:56:54 +0000 (15:56 +0100)]
Remove redundant requires of 'help'
* lisp/emacs-lisp/advice.el (ad-read-advised-function):
* lisp/emacs-lisp/ert.el:
* lisp/facemenu.el: Don't require 'help'; it is preloaded since
version 18.59.
Roland Winkler [Wed, 2 Dec 2020 21:08:25 +0000 (15:08 -0600)]
bibtex-autokey-get-year: Allow both a year or date field.
* lisp/textmodes/bibtex.el (bibtex-text-in-field): Allow arg field
to be a list of fields.
(bibtex-autokey-get-year): Look for year and date field. Allow
the extended date format used by biblatex.
Stefan Kangas [Wed, 2 Dec 2020 14:43:26 +0000 (15:43 +0100)]
Remove redundant requires of faces
* lisp/htmlfontify.el:
* lisp/term/ns-win.el:
* lisp/term/w32-win.el:
* lisp/term/x-win.el:
* test/lisp/faces-tests.el: Don't require 'faces'; it is preloaded
since version 19.34.
Michael Albinus [Wed, 2 Dec 2020 15:09:20 +0000 (16:09 +0100)]
Add test to autorevert-tests.el
* test/lisp/autorevert-tests.el (auto-revert--wait-for-revert):
Handle `auto-revert--messages' being nil.
(auto-revert-test07-auto-revert-several-buffers): New test.
Stefan Kangas [Wed, 2 Dec 2020 11:50:05 +0000 (12:50 +0100)]
Remove some references to fast-lock and lazy-lock
* lisp/htmlfontify.el (hfy-copy-and-fontify-file):
* lisp/progmodes/antlr-mode.el: Remove some references to obsolete
libraries fast-lock and lazy-lock.
Fix xsdre-range-list-to-char-alternative problem with {P}
* lisp/nxml/xsd-regexp.el (xsdre-range-list-to-char-alternative):
Make (string-match (xsdre-translate "\\p{P}") "a-b") work
(bug#24093) -- the "forbidden" characters don't have to be the
first elements in a range.
Stefan Kangas [Wed, 2 Dec 2020 09:19:16 +0000 (10:19 +0100)]
Remove specific byte-compiler warnings for cl.el
* lisp/emacs-lisp/bytecomp.el (byte-compile-warning-types)
(byte-compile-warnings, byte-compile-cl-file-p)
(byte-compile-eval, byte-compile-eval-before-compile)
(byte-compile-arglist-warn, byte-compile-find-cl-functions)
(byte-compile-cl-warn, displaying-byte-compile-warnings)
(byte-compile-file-form-require, byte-compile-form): Remove all
specific cl.el warnings, as that library is now obsolete. The
regular obsoletion warnings are sufficiently discouraging.
* lisp/emacs-lisp/advice.el (ad-compile-function): Don't try to
silence the now removed warning.
* doc/lispref/tips.texi (Coding Conventions):
* doc/misc/cl.texi (Organization): Make recommendation to not use
cl.el and cl-compat.el stronger.
* lisp/obsolete/cl.el: Make alias help say that they are obsolete.
* lisp/obsolete/cl-compat.el (build-klist, safe-idiv)
(pair-with-newsyms): Silence byte-compiler.
Dmitry Gutov [Wed, 2 Dec 2020 02:28:35 +0000 (04:28 +0200)]
Improve .gitignore and project-vc-ignores handling
* lisp/progmodes/project.el (project-ignores):
Convert .gitignore entries more faithfully.
(project--vc-list-files): Convert "our" ignore entries to
"proper" globs, which is what Git pathspec requires.