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.
* lisp/vc/vc-hooks.el (vc-call): Ensure second argument is evaluated
only once (bug#50690).
* etc/NEWS (Change Logs and VC): Announce this change in behavior.
João Távora [Sun, 19 Sep 2021 10:42:20 +0000 (11:42 +0100)]
Make syntax-ppss more accurate for Python triple quotes (bug#49518)
By putting delimiter syntax on the last character of Python
triple-quoted strings, this makes syntax-ppss be more accurate.
Previously:
emacs -Q something.py
type two single quotes
M-: (nth 3 (syntax-ppss))
notice how the return value says you're outside a string, correctly
type another quote
M-: (nth 3 (syntax-ppss))
notice how the return value says you're inside a string, correctly
backspace the quote just entered
M-: (nth 3 (syntax-ppss))
notice how the return value says you're inside a string, incorrectly
With this patch the last step is corrected. This helps things like
electric-pair-mode. Also, the test
python-syntax-after-python-backspace now passes, again.
* lisp/progmodes/python.el (python-syntax-stringify): Put
delimiter syntax in "inner" of the surrouding triple quotes.
João Távora [Sun, 19 Sep 2021 16:08:41 +0000 (17:08 +0100)]
Expand and improve electric-pair-mode and Python testing (bug#49518)
In python-tests.el, the triple-quote pairing tests are passing
incorrectly, i.e. the auto-pairing functionality they purport to guard
isn't really working for users trying it interactively. Added a new
failing test, soon to be fixed.
In electric-tests.el, added tests for Python, too.
* test/lisp/electric-tests.el (define-electric-pair-test): Also run
main tests for python-mode. (pair-some-quotes-skip-others): Test
another slightly different pairing.
* test/lisp/progmodes/python-tests.el
(python-triple-double-quote-pairing): Rename from
python-triple-quote-pairing.
(python-triple-single-quote-pairing): New test.
* lisp/gnus/mm-view.el (mm-inline-wash-with-file): This is only
called from the `links' handler, and it passes in `file' expecting
that to be dynamically bound. Which is a very, very confusing
interface, but make that work again, anyway.
Michalis V [Tue, 21 Sep 2021 04:30:58 +0000 (06:30 +0200)]
Make dired-compress-file query for a directory to uncompress to
* lisp/dired-aux.el (dired-compress-file-suffixes): Specify the
directory in the tar targets.
(dired-uncompress-file): New function (bug#47058). This asks what
directory to uncompress to.
(dired-compress-file): Use it.