* lisp/progmodes/sh-script.el (sh-shell-process): If a *shell* buffer
doesn't exist, 'C-c C-n' creates one and displays it. This patch
prevents it from being displayed in the selected window.
Additionally, it ensures that the local `sh-shell-process' variable is
set in the correct buffer (bug#50765).
Stefan Kangas [Thu, 23 Sep 2021 19:10:08 +0000 (21:10 +0200)]
Avoid jumping too far in checkdoc-in-abbreviation-p
* lisp/emacs-lisp/checkdoc.el (checkdoc-in-abbreviation-p): Use
'forward-ward' instead of 'forward-sexp' to avoid jumping too far in
some situations. (Bug#50731)
* test/lisp/emacs-lisp/checkdoc-tests.el
(checkdoc-tests--abbrev-test): New helper function.
(checkdoc-tests-in-abbrevation-p/basic-case): Rename from
'checkdoc-tests-in-abbrevation-p'.
(checkdoc-tests-in-abbrevation-p/with-parens)
(checkdoc-tests-in-abbrevation-p/with-escaped-parens): Use above new
helper function.
(checkdoc-tests-in-abbrevation-p/single-char)
(checkdoc-tests-in-abbrevation-p/with-em-dash)
(checkdoc-tests-in-abbrevation-p/incorrect-abbreviation): New tests.
* lisp/progmodes/xref.el (xref--collect-matches):
Move 'remote-id' and 'syntax-needed' definitions to the caller
function. Bind 'inhibit-modification-hooks' to t (bug#50733).
xref-matches-in-files: Decrease per match and per group overhead
* lisp/progmodes/xref.el (xref-search-program-alist):
Add '--null' argument for slightly faster parsing and probably
better behavior with weirder file names.
(xref--alistify): Don't accept TEST argument, use 'assoc' instead
of 'cl-assoc', use a tash table during sorting (bug#50733).
Juri Linkov [Thu, 23 Sep 2021 16:32:36 +0000 (19:32 +0300)]
New thing-at-point target 'list-or-string' used in context-menu-region
* lisp/mouse.el (context-menu-region): Rearrange the order to
All>Defun>List>Line>Symbol. Show title either "List" or "String"
depending on syntax-ppss, then use thing 'list-or-string' (bug#9054).
* lisp/thingatpt.el (thing-at-point-bounds-of-list-at-point): Add optional
args 'escape-strings' and 'no-syntax-crossing' like in 'up-list'.
(list-or-string): New target 'list-or-string'.
(thing-at-point-bounds-of-list-or-string-at-point): New function.
Juri Linkov [Thu, 23 Sep 2021 16:14:56 +0000 (19:14 +0300)]
* lisp/outline.el (outline-minor-mode-cycle-filter): New defcustom (bug#50679)
(outline-minor-mode-cycle--bind): New helper function.
(outline-minor-mode-cycle-map): Rename from outline-mode-cycle-map.
(outline-mode-map): Revert part of 6458e16f33 to disassociate
keymaps outline-mode-map and outline-minor-mode-cycle-map.
(outline-font-lock-keywords, outline-minor-mode-highlight-buffer):
Use outline-minor-mode-cycle-map instead of outline-mode-cycle-map.
* lisp/help.el (describe-bindings): Rename outline-mode-cycle-map
to outline-minor-mode-cycle-map.
* lisp/mouse.el (context-menu-undo): Add "in Region" to the titles
when the region is active.
(context-menu-region): Use 'mouse-yank-from-menu' in menu items
created from 'yank-menu' for submenu "Paste from Kill Menu".
(context-menu-region): Add submenu "Select" with things to mark.
(mark-thing-at-mouse, mouse-yank-from-menu): New functions.
* lisp/thingatpt.el (bounds-of-thing-at-mouse): New function.
* lisp/progmodes/elisp-mode.el (elisp-context-menu):
* lisp/progmodes/prog-mode.el (prog-context-menu):
Use full symbol/identifier names in :help strings.
Wilson Snyder [Wed, 22 Sep 2021 14:19:57 +0000 (10:19 -0400)]
verilog-mode.el: Enable lexical binding, and merge from upstream.
* lisp/progmodes/verilog-mode.el: Enable lexical binding. Templates that
used the never-documented `inst' or `submod' variables may need to change
to use vl-... variables.
(verilog-at-constraint-p): Fix indentation on double curly brackets
(#1719) (#1744). Reported by Nikolay Puzanov.
* test/lisp/button-tests.el (button--help-echo-form):
* test/lisp/files-tests.el (files-tests-permanent-local-variables):
Remove assumption that `with-temp-buffer` creates a buffer
where `lexical-binding` is nil.
Eli Zaretskii [Wed, 22 Sep 2021 07:07:25 +0000 (10:07 +0300)]
Update comments warning about GC-resistant C programming
* src/eval.c: Remove an outdated comment about protection from GC.
* src/buffer.h:
* src/lisp.h: Add warnings about using 'char *' pointers to text
of Lisp strings and buffer text in code that could GC. Reported by
Po Lu <luangruo@yahoo.com>
Stephen Gildea [Wed, 22 Sep 2021 05:01:03 +0000 (22:01 -0700)]
Migrate MH-E functional tests from SourceForge
* test/lisp/mh-e/mh-limit-tests.el:
* test/lisp/mh-e/mh-utils-tests.el:
* test/lisp/mh-e/mh-xface-tests.el:
Import the functional tests from src/mh-unit.el.
mh-unit.el is from the old SourceForge mh-e repository, last changed
in 2017. To this are applied unmerged patches Mike Kupfer wrote in
2018 ("Refactor mh-unit into functional and release tests" and
"Fix the functional tests").
All tests have been converted to run under Emacs's ERT framework.
Some tests for mh-utils use MH programs to examine mail folders.
These tests require an MH variant to be installed on the system; for
these, added both a mock harness that pretends the needed files and MH
programs do exist, and a wrapper that creates the necessary mail files.
New function 'mh-test-utils-setup-with-variant' bears some resemblance
to 'mh-test-folders-set-up' from the original tests. New function
'mh-test-utils-setup-with-mocks' is new functionality for these tests.
Make global-auto-revert-non-file-buffers work better
* lisp/autorevert.el (global-auto-revert-mode): Always switch on
the non-file tracking.
(auto-revert--global-possibly-adopt-current-buffer): New function
to respect dynamically changing `global-auto-revert-non-file-buffers'.
Stefan Kangas [Sun, 19 Sep 2021 13:46:44 +0000 (15:46 +0200)]
New major mode with font-locking for etc/AUTHORS
* lisp/textmodes/etc-authors-mode.el: New file. (Bug#50674)
* etc/AUTHORS (mode): Add "mode: etc-authors" to local variables.
* admin/authors.el (authors): Add "mode: etc-authors" to local
variables of the generated AUTHORS file.
Stefan Kangas [Tue, 21 Sep 2021 17:23:17 +0000 (19:23 +0200)]
Minor clean-up and fixes in checkdoc
* lisp/emacs-lisp/checkdoc.el: Minor doc fixes. Remove unnecessary
space at the end of 'y-or-n-p' prompts. Move obsolete definitions to
the end of the file.
(checkdoc-symbol-words, checkdoc-common-verbs-wrong-voice): Add
some more common words.
Stefan Kangas [Tue, 21 Sep 2021 17:20:48 +0000 (19:20 +0200)]
checkdoc: New defvars to disable some warnings
* lisp/emacs-lisp/checkdoc.el (checkdoc--argument-missing-flag)
(checkdoc--disambiguate-symbol-flag)
(checkdoc--interactive-docstring-flag): New defvars to disable some
warnings. These are intended for use with Emacs itself rather than
with third-party libraries.
(checkdoc-this-string-valid, checkdoc-this-string-valid-engine):
Respect above new variables.
Juri Linkov [Tue, 21 Sep 2021 17:45:38 +0000 (20:45 +0300)]
* lisp/tab-bar.el: Preserve all existing tab parameters when switching tabs.
* lisp/tab-bar.el (tab-bar--tab, tab-bar--current-tab-make):
Copy other possible tab parameters.
https://lists.gnu.org/archive/html/emacs-devel/2021-09/msg01544.html
Fix PGP verification buttons (which would have cached results)
* lisp/gnus/mm-uu.el (mm-uu-pgp-signed-extract): `format' was used
here to guarantee a new, fresh string (since it's destructively
modified), but that's apparently not the case any more. Use
`substring' instead, which is documented to do this.
* lisp/gnus/mml2015.el (inhibit-redisplay): Removed
(mml2015-epg-decrypt):
(mml2015-epg-clear-decrypt):
(mml2015-epg-verify):
(mml2015-epg-clear-verify):
(mml2015-epg-sign):
(mml2015-epg-encrypt): Don't bind `inhibit-redisplay', because it
makes debugging very odd, and doesn't seem to help much with anything.
* lisp/progmodes/project.el (project-forget-project):
Rename from 'project-remove-known-project', for consistency with
'project-remember-project' (discussed in bug#50297).
* etc/NEWS: Announce new default behavior of map-elt and map-delete
on alists.
* lisp/emacs-lisp/map.el: Bump to version 3.2.
(map-elt): Test alist keys with equal by default. Betray a little
bit more information in the docstring on which functions are used
for which map types. (Bug#47368)
(map-put): Update docstring accordingly.
(map--plist-delete): Consistently test plist keys with eq.
(map-delete): Consistently test alist keys with equal.
* test/lisp/emacs-lisp/map-tests.el (test-map-elt-testfn): Update
for new map-elt behavior.
(test-map-put!-alist, test-map-delete-alist): New tests.
Robert Pluim [Tue, 21 Sep 2021 08:20:10 +0000 (10:20 +0200)]
Silence byte-compiler warning for network-stream-tests.el
The api specifically requires a symbol here, so we can't just replace
nowait with nil.
* test/lisp/net/network-stream-tests.el
(open-gnutls-stream-old-api-wait): Add explicit value for nowait
to silence byte-compiler warning due to Bug#47080.