* 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.
* doc/emacs/maintaining.texi (Project File Commands):
Mention the new command and update the bindings information.
* lisp/progmodes/project.el (project-find-dir):
New command (bug#43153).
(project-prefix-map): Use 'd' as its binding.
Move 'project-dired' to 'D'.
(project-switch-commands):
Replace 'project-dired' with 'project-find-dir'.
Robert Pluim [Mon, 20 Sep 2021 10:41:15 +0000 (12:41 +0200)]
Support for Unicode emoji sequences
This covers both sequences using Zero-Width-Joiner codepoints and
those without. Bug#39799, I hope.
* .gitignore: Add emoji-zwj.el
* admin/notes/unicode: Add emoji-zwj-sequences.txt and
emoji-sequences.txt references. Describe how to test after updating
to a newer Unicode version.
* admin/unidata/Makefile.in (all): add emoji-zwj.el as a dependency.
(emoji-zwj.el): Add target plus rules for building.
(gen-clean): Add emoji-zwj.el.
* admin/unidata/README: Add emoji-zwj-sequences.txt and
emoji-sequences.txt references.
* admin/unidata/blocks.awk: Force emoji script to be used for certain
codepoints that are used by the Unicode sequences.
* admin/unidata/emoji-sequences.txt: New file.
* admin/unidata/emoji-zwj-sequences.txt: New file.
* admin/unidata/emoji-zwj.awk: New file. Derives
composition-function-table rules from emoji-zwj-sequences.txt, plus
hardcodes some derived manually from emoji-sequences.txt.
* etc/NEWS: Announce change.
* lisp/international/characters.el: Load the generated emoji-zwj.el
* src/Makefile.in (emoji-zwj): New target.
(temacs): Add emoji-zwj as a dependency.
Jonas Bernoulli [Thu, 16 Sep 2021 18:24:30 +0000 (20:24 +0200)]
No longer raise error when http authentication failed
* lisp/url/url-http.el (url-http-handle-authentication): Return t
instead of raising an error, instructing the caller to invoke the
request specific error handler (bug#50511).
Robert Pluim [Sun, 19 Sep 2021 19:07:36 +0000 (21:07 +0200)]
Base emoji script membership on Emoji_Presentation
The Emoji property describes which codepoints can be displayed as
emoji, but Emoji_Presentation governs which are displayed as emoji by
default.
* admin/notes/unicode: Adjust check-emoji-coverage to look in the
Emoji_Presentation sections of emoji-data.txt
* admin/unidata/blocks.awk: Assign emoji script using the
Emoji_Presentation section.
* lisp/progmodes/bug-reference.el (bug-reference-try-setup-from-vc):
Pass file or directory name in question as the first argument to the
backend's repository-url implementation (bug#50689). Use when-let
and seq-some to flatten nested conditionals.
* lisp/loadup.el (dump-mode): Temporarily bind `lexical-binding` to
nil while dumping. Otherwise, it will be t in Emacs by default
and that is not our intention (yet).
Juri Linkov [Mon, 20 Sep 2021 07:16:09 +0000 (10:16 +0300)]
Add support for url-retrieve-synchronously to eww-retrieve-command (bug#50680)
* doc/misc/eww.texi (Advanced): Mention url-retrieve-synchronously
for eww-retrieve-command.
* lisp/net/eww.el (eww-retrieve-command): Add choice 'sync' for
url-retrieve-synchronously.
(eww-retrieve): Use value 'sync' for url-retrieve-synchronously.
(eww-isearch-next-buffer): Let-bind eww-retrieve-command to 'sync'.