Some AWK implementations have a fixed buffer for sprintf; for mawk the
default size is 8192 bytes. Hoist a string concatenation from
a sprintf call to avoid running into that limit. See discussion at
https://lists.gnu.org/archive/html/emacs-devel/2023-06/msg00090.html .
Eli Zaretskii [Sat, 3 Jun 2023 09:50:58 +0000 (05:50 -0400)]
Merge from origin/emacs-29
ede3535051a ; Fix last change 8ec786349e1 Fix apostrophe handling in rust-ts-mode and go-ts-mode (B... 0eba9cf6511 * test/infra/Dockerfile.emba (emacs-base): Install also g... 4897c98b6c4 Fix 'python-util-clone-local-variables' 6b2c8dc9050 Revert "Enhance Python font-lock to support multilines" 348e4504c6d Fix typo in calc.texi 03663b8798a Update to Transient v0.4.1 dc7acb1aafe Avoid errors in 'delete-forward-char' deleting static com... 2f94f6de9d6 Make VS-15 and VS-16 compositions work correctly 753f8aa1f14 Fix project-name for vc-aware backend in non-file buffers 17c7915ab94 ; Fix 'package-install-upgrade-built-in' check for packag... e252ce26eab Add type_predicate 'is' as keyword in typescript-ts-mode ... 0a354d65784 Fix infloop in info-look.el 83b22139e4c Fix several todo-mode.el item editing bugs (bug#63811) ed4cd3eddf7 dockerfile-ts-mode: Prevent empty categories in imenu (Bu... 2e20e318da2 Brush up doc strings and terminology in plstore.el 372bc1278c2 Add internal documentation on plstore.el 23a14e7b902 Add compact_constructor_declaration font-locking to java-... 500abc4dc37 * lisp/tmm.el (tmm-completion-delete-prompt): Add more ch... afc1f329356 Allow to disable the DWIMish behavior of 'x' in package menu 08104c01504 Allow dired to invoke secondary browser a3063f0bc87 Add a binding for enriched-toggle-markup d8ba28fa394 Fix order of tmm-menubar when 'tmm-mid-prompt' is nil
Eli Zaretskii [Sat, 3 Jun 2023 09:50:49 +0000 (05:50 -0400)]
Merge from origin/emacs-29
3f441525679 Save the tree-sitter grammar recipe when installing a gra... c0c7b947baf Add instructions and test file for VS-15/VS-16 3be33aff963 A better fix for "Fix cancellation of Wdired" 756244c6963 ; * lisp/minibuffer.el (completions-header-format): Doc fix. 5d844e129ad Fix tmm-menubar when 'tmm-completion-prompt' is nil
Йордан Миладинов [Fri, 26 May 2023 14:23:26 +0000 (17:23 +0300)]
Fix apostrophe handling in rust-ts-mode and go-ts-mode (Bug#63708)
* lisp/progmodes/rust-ts-mode.el (rust-ts-mode--syntax-propertize):
Treat apostrophes as strings if used to define character literals.
Treat LT and GT as pairs if used to define type parameters (formerly
they were treated as pairs only for type arguments).
* lisp/progmodes/go-ts-mode.el (go-ts-mode--syntax-table): Treat
apostrophes as strings if used to define rune literals.
Michael Albinus [Sat, 3 Jun 2023 08:19:02 +0000 (10:19 +0200)]
Adapt emba integration
* admin/notes/emba: Improve docker call.
* test/infra/Dockerfile.emba (emacs-eglot, emacs-tree-sitter):
Install also gawk.
* test/infra/Makefile.in (TREE-SITTER-FILES): New variable.
(tree-sitter-files-template): New rule.
(.PHONY, generate-test-jobs): Add it to dependencies.
* test/infra/gitlab-ci.yml (variables): Disable CI_DEBUG_TRACE.
(test-tree-sitter): Extends also .tree-sitter-files-template. Use
$tree_sitter_files.
Steven Allen [Tue, 16 May 2023 23:07:36 +0000 (16:07 -0700)]
Fix use-package :vc keyword when byte-compiled
* lisp/use-package/use-package-core.el (use-package-handler/:vc):
Return the new 'body'. Otherwise, the entire package declaration gets
dropped when byte-compiling.
* test/lisp/use-package/use-package-tests.el
(use-package-test-handler/:vc-6): test it.
Eli Zaretskii [Sat, 3 Jun 2023 07:20:08 +0000 (10:20 +0300)]
Fix 'python-util-clone-local-variables'
* lisp/progmodes/python.el (python-util-clone-local-variables):
Avoid signaling an error when a local variable is unbound.
Patch by Ernesto Alfonso <erjoalgo@gmail.com>. (Bug#63818)
We have found that there are performance issues when editing a large
file. The issue can be reproduced as follows:
1. emacs -Q
2. Open large Python file (e.g. turtle.py in Python)
3. Near the top of the buffer, enter open paren and some characters.
The above commit extends the region to be font-locked using
`python-nav-end-of-statement'. However, if there are unbalanced
parens, it may move point to the end of the buffer. This causes
almost the entire buffer to be font-locked, which is not acceptable
for large files.
Robert Pluim [Fri, 2 Jun 2023 11:54:56 +0000 (13:54 +0200)]
Make VS-15 and VS-16 compositions work correctly
There is a conflict between forward matching and backward matching
composition rules involving the same codepoint, which can cause the
backward matching ones not to be invoked. Ensure that VS-15 (U+FE0E)
and VS-16 (U+FE0F) are composed by forward matching rules instead in
order to avoid this issue.
* admin/unidata/emoji-zwj.awk: Add rules for CHAR+VS-15 and CHAR+VS-16.
* lisp/composite.el: remove backward matching rule for VS-15. (Bug#63731)
Dmitry Gutov [Fri, 2 Jun 2023 02:10:15 +0000 (05:10 +0300)]
Fix project-name for vc-aware backend in non-file buffers
* lisp/progmodes/project.el (project-name): Make sure
project-vc-name is picked up from dir-locals in all
non-file-visiting buffers too (mentioned in bug#63469).
; Fix 'package-install-upgrade-built-in' check for package menu
* lisp/emacs-lisp/package.el (package-menu--find-upgrades): Use
correct check to verify if a built-in packages in the package menu can
be upgraded or not.
* lisp/composite.el (compose-gstring-for-terminal): Fix omitted var.
It may not make much of a difference since the code path is probably
only taken once for i=0 with no more glyphs in the input, but this
change avoids depending on such external invariants and makes
the code less mystifying to the reader (bug#63807).
Disable unused-return-value warning for delq and delete, again
* lisp/emacs-lisp/bytecomp.el (important-return-value-fns):
Remove `delq` and `delete` since they resulted in false
positives that nobody was interested in silencing (bug#61730).
Stephen Berman [Wed, 31 May 2023 14:15:48 +0000 (16:15 +0200)]
Fix several todo-mode.el item editing bugs (bug#63811)
* lisp/calendar/todo-mode.el (todo-insert-item--basic): With
insertion type 'here', ensure item is inserted on the todo-mode
line where the command was invoked.
(todo-edit-item--cat, todo-edit-item--pos): New variables.
(todo-edit-item--text): Restrict the scope of nil-valued
buffer-read-only to the functions that change buffer text. If
user moved point while editing a single-line todo item or a done
item comment, or while inserting a done item comment, restore
point, and for comments, make sure the done items section is
displayed. For multiline items, set the new variables so
todo-edit-quit can use them.
(todo-edit-quit): Use the values of the new variables to restore
point in the todo-mode buffer if it had been moved while editing.
(todo-edit-item--header): Avoid clobbering match data when editing
a todo item header.
Michael Albinus [Wed, 31 May 2023 06:44:44 +0000 (08:44 +0200)]
Improve tree-sitter tests on emba
* test/infra/Dockerfile.emba (emacs-tree-sitter): Install only
grammars which are needed.
* test/infra/Makefile.in (subdir_template): Special handling of
progmodes.
(TREE-SITTER-FILES): New variable.
(tree-sitter-files-template): New rule.
(.PHONY, generate-test-jobs): Add it to dependencies.
* test/infra/gitlab-ci.yml (.tree-sitter-template):
Add test/lisp/progmodes/*-ts-mode-resources/**.
(test-tree-sitter): Extends also .tree-sitter-files-template. Use
$tree-sitter-files.
The call to `format-message` had no effect in itself, but it turns out
that actually emitting the result just results in useless warnings so
we remove it entirely.
xml.el: remove incorrect and botched attribute whitespace collapse
* lisp/xml.el (xml-parse-attlist): Don't attempt to collapse multiple
consecutive whitespace characters into a single space, which is wrong
to do a this point when attributes must be assumed to be CDATA.
The code was actually unintentionally correct since it forgot to use
the return value of `replace-regexp-in-string` (bug#63740).
Despite its name, `any` does not match any character (use `anychar`
for that) but is an old synonym for `not-newline` and `nonl`,
retained for compatibility with the obsolete `sregex` package.
(In SRE as defined by SRFI-115, `any` does match any character.)
There is also a mild but unnecessary confusion with the more
frequently used `any` construct for character alternatives.
* lisp/emacs-lisp/bytecomp.el
(byte-compile--suspicious-defcustom-choice): Rename to...
(byte-compile--defcustom-type-quoted): ...this and rewrite to make
more sense. All callers updated.
(byte-compile-nogroup-warn): Better warning message.
* test/lisp/emacs-lisp/bytecomp-tests.el
(test-bytecomp-defgroup-choice): This never failed because it wasn't
actually a test. Turn it into...
(bytecomp-test-defcustom-type-quoted): ...this, which is.
* etc/themes/modus-operandi-tritanopia-theme.el:
* etc/themes/modus-vivendi-tritanopia-theme.el: Add new themes
optimized for users with blue-yellow color deficiency (tritanopia).
F. Jason Park [Mon, 29 May 2023 04:16:39 +0000 (21:16 -0700)]
Preserve prompt in erc-cmd-CLEAR
* etc/ERC-NEWS: Mention behavioral changes to functionality provided
by the `truncate' and `log' modules and also the "/CLEAR" command.
* lisp/erc/erc-log.el (erc-truncate-buffer-on-save): Deprecate option
because three's a crowd, and ERC already has a dedicated module as
well as a slash command for this purpose. And although this commit
restores functionality, this option has been unusable since at least
the release of ERC 5.5, with no known complaints received thus far.
Also, the doc string of `erc-save-buffer-in-logs' makes no mention of
this feature WRT interactive invocations or otherwise.
(erc-log-mode, erc-log-enable, erc-log-disable): Subscribe to
new internal hook `erc--pre-clear-functions'.
(erc-log--save-in-progress-p): New variable to help restore
`erc-truncate-buffer-on-save' and promote code reuse.
(erc-logging-enabled): Guard with `erc-log--saved-in-progress-p'.
(erc-save-buffer-in-logs): Overload `buffer' parameter to allow
various hooks to supply a non-buffer as well. Warn when people use
`erc-truncate-buffer-on-save', which is now deprecated.
* lisp/erc/erc-stamp.el (erc-stamp-mode, erc-stamp-enable,
erc-stamp-disable): Subscribe to `erc--pre-clear-functions'.
(erc-stamp--update-saved-position): New function for updating
last-logged marker on `erc-stamp--insert-date-function'.
(erc-stamp--reset-on-clear): New function to forget last inserted
stamps when truncating.
* lisp/erc/erc-truncate.el (erc-truncate-mode, erc-truncate-enable,
erc-truncate-disable): Use `erc-insert-done-hook' instead of
`erc-insert-post-hook', as implicitly suggested by an ancient comment,
which ponders whether truncating the buffer at the insertion phase may
be harmful to other hook members.
(erc-truncate-buffer-to-size): Set truncation boundary at message
break instead of line break. Run `erc--pre-clear-functions'.
(erc-truncate-buffer): Save excursion. This should probably be
handled by `erc-truncate-buffer-to-size' instead, but that's
likelier to cause breakage in third-party code.
* lisp/erc/erc.el (erc--pre-clear-functions): New internal hook.
(erc-cmd-CLEAR): Run `erc--pre-clear-functions' before clearing, and
don't blow away prompt. The latter was a regression caused by 05f6fdb9e78 "Preserve ERC prompt and its bounding markers".
* test/lisp/erc/erc-scenarios-log.el: New file. (Bug#60936)
F. Jason Park [Fri, 19 May 2023 06:47:27 +0000 (23:47 -0700)]
Recompute erc-prompt when inserting messages
* lisp/erc/erc.el (erc--refresh-prompt): New function for redrawing
the prompt in a couple select places.
(erc-display-line-1, erc-display-msg): Replace the prompt after
inserting messages.
* test/lisp/erc/erc-tests.el (erc--refresh-prompt): New
test. (Bug#60936)
F. Jason Park [Tue, 23 May 2023 06:42:11 +0000 (23:42 -0700)]
Simplify erc-tab interface
* etc/ERC-NEWS: Improve section mentioning `erc-tab'.
* lisp/erc/erc-button.el (erc-button-alist): Restore a commented out
version of the "<URL ...>" entry, which was dropped in 5adda2f4683
"Revise FORM-as-function interface in erc-button-alist" for being
redundant. This may help unlikely objectors better adapt to the
churn.
(erc-button-next, erc-button-previous): Don't bother accommodating raw
prefix arguments; expect numeric arguments only.
* lisp/erc/erc.el (erc-tab): Change interactive spec to lowercase
"p". (Bug#60933)
F. Jason Park [Tue, 23 May 2023 04:43:29 +0000 (21:43 -0700)]
Document recommended way to use ERC over Tor
* doc/misc/erc.texi: Add new SOCKS section to the chapter on
Integrations. Also bump version in front matter.
* lisp/erc/erc.el (erc-open-socks-tls-stream): New convenience
function to connect over Tor via SOCKS proxy.
Juri Linkov [Mon, 29 May 2023 17:34:53 +0000 (20:34 +0300)]
* lisp/tmm.el (tmm-completion-delete-prompt): Add more checks (bug#63754).
In case when 'completions-header-format' is nil, the first 'mouse-face'
property is at the beginning of the buffer. So first use 'get-text-property'
at point-min.
Andrea Corallo [Sun, 28 May 2023 12:49:19 +0000 (14:49 +0200)]
comp: Recompute type slots after byte compilation for user types
* lisp/emacs-lisp/comp-cstr.el (comp--compute-typeof-types)
(comp--compute--pred-type-h): New functions.
(comp-cstr-ctxt): Make use of.
(comp-cstr-ctxt-update-type-slots): New function.
* lisp/emacs-lisp/comp.el (comp-spill-lap): Use
`comp-cstr-ctxt-update-type-slots'.
Robert Pluim [Tue, 25 Apr 2023 10:28:47 +0000 (12:28 +0200)]
Allow dired to invoke secondary browser
'browse-url-of-dired-file' always invokes the primary browser, but
sometimes it's handy to call a different browser, which is why
'browse-url-secondary-browser-function' exists.
* lisp/net/browse-url.el (browse-url-of-dired-file): Call
'browse-url-secondary-browser-function' when invoked with a prefix
argument.
* etc/NEWS: Announce the change.
Eli Zaretskii [Mon, 29 May 2023 12:32:51 +0000 (15:32 +0300)]
Fix order of tmm-menubar when 'tmm-mid-prompt' is nil
* lisp/tmm.el (tmm-prompt): Reverse 'tmm-km-list' when
'tmm-mid-prompt' is nil, to present the menu in the correct order.
Suggested by Thiago Melo <tmdmelo@gmail.com>.
Robert Pluim [Sun, 28 May 2023 14:36:44 +0000 (16:36 +0200)]
Add instructions and test file for VS-15/VS-16
* admin/notes/unicode: Add instructions for emoji-variation-sequences.txt
* admin/unidata/emoji-variation-sequences.txt: New file, imported from
Unicode 15.
Laurence Warne [Sun, 21 May 2023 17:59:43 +0000 (18:59 +0100)]
Fix unstable proced test
Fix unstable proced test by omitting the revert parameter in
'proced-update'. This was caused by the process being refined on
exiting between the initial 'proced' call and the successive
'proced-update' call. This resulted in proced skipping the refinement
in 'proced-update', causing all processes to be shown again and the
test to fail.
* test/lisp/proced-tests.el (proced-refine-with-update-test): Do not
use revert parameter when calling 'proced-update'.
Eli Zaretskii [Sat, 27 May 2023 17:09:40 +0000 (20:09 +0300)]
Fix tmm-menubar when 'tmm-completion-prompt' is nil
* lisp/tmm.el (tmm-prompt): Handle nil value of 'tmm-mid-prompt'.
(tmm-completion-delete-prompt): Don't rely on the exact text of
the completion heading line, as it is now a customizable format
string, and can be nil, meaning no heading line is inserted at
all. Instead, search for the first character of the menu based on
text properties used for it. (Bug#63754)
Alan Mackenzie [Fri, 26 May 2023 14:32:07 +0000 (14:32 +0000)]
Fontify Java constructor names and arglists
This fixes bug#63328.
* lisp/progmodes/cc-engine.el (c-forward-decl-or-cast-1): New
variable got-stmt-block. After scanning an arglist, set
got-arglist to t. When we have as yet no identifier,
got-arglist, and scan an open brace, test the "type" for being
the name of the enclosing class.
(c-directly-in-class-called-p): Test the two names for
equality, not merely one being the head of the other.
Support setting PAGER=cat in comint.el (bug#62958)
Paging can be undesirable in comint-derived commands such as
async-shell-command and M-x shell. It is a frequent footgun for new
Emacs users when they try to run commands which start a pager in such
modes.
Simply adding (setenv "PAGER" "cat") globally is not correct, since
that will break modes like term, which support paging quite well.
It's only and exactly the comint-derived modes which don't need
paging.
* lisp/comint.el (comint-pager): Add. (bug#62958)
(comint-exec-1): Use comint-pager to set PAGER.
Eli Zaretskii [Fri, 26 May 2023 11:04:03 +0000 (07:04 -0400)]
Merge from origin/emacs-29
aa5158630e7 Use 'font-lock-extend-region-functions' in python-mode b7b82ecb2b4 Fix python-info-docstring-p f42de74ebea ; * src/lread.c (read0, skip_lazy_string): Fix commentary... b6b384023a9 Fix cancellation of Wdired 916c2a19bde Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/... f535c0e49d5 Handle #@00 in new reader in a compatible way (bug#63722) 40a758f5ceb ; Minor fixes in documentation of recently-changed VC com... c0d7447e9dc ; * etc/NEWS: Describe the Cairo XCB option. (Bug#63589) 42052686752 Don't mark selection request events 9f5249d5c8d Disable cairo-xcb support by default e5f42706ce2 * lisp/progmodes/project.el: Move :safe from defcustom to... 3afe4a42e90 * lisp/vc/vc-annotate.el (vc-annotate-mode-menu): Quote v... b62a2b08b80 Add vc-create/switch/print-branch to menu and update docu... d292d282292 Fix rare crashes in 'try_window_reusing_current_matrix' 709d9020021 Make last Tramp change less invasive a72a1f24fcb ; Fix last change. 5c6517a115d ; * lisp/menu-bar.el (popup-menu): Doc fix. 212884f2bfe ; Fix last change. 1b9812af80b ; * etc/PROBLEMS: Document problem with GnuPG 2.4.1. (Bu... 765edc204d4 ; Support SQLite3 extensions on macOS 5aadb87d6f6 Fix 'use-dialog-box-p' and friends
Eli Zaretskii [Fri, 26 May 2023 10:20:56 +0000 (13:20 +0300)]
Fix emacsclient when there are irrecoverable file-visiting errors
* lisp/server.el (server-process-filter, server-return-error):
Display the error message to be sent to the client as a regular
message, to give the user the opportunity to see it. Delete the
terminal immediately after sending the error message to the
client, to make sure the terminal's modes are restored.
(Bug#63629)
kobarity [Wed, 24 May 2023 13:06:51 +0000 (22:06 +0900)]
Use 'font-lock-extend-region-functions' in python-mode
* lisp/progmodes/python.el (python-font-lock-extend-region): Change
arguments and return value for 'font-lock-extend-region-functions'.
(python-mode): Change from
'font-lock-extend-after-change-region-function' to
'font-lock-extend-region-functions'. (Bug#63622)
kobarity [Wed, 24 May 2023 13:01:12 +0000 (22:01 +0900)]
Fix python-info-docstring-p
* lisp/progmodes/python.el (python-info-docstring-p): Stop using
python-rx string-delimiter.
* test/lisp/progmodes/python-tests.el
(python-font-lock-escape-sequence-bytes-newline)
(python-font-lock-escape-sequence-hex-octal)
(python-font-lock-escape-sequence-unicode)
(python-font-lock-raw-escape-sequence): Mark as expected failures
until another bug in 'python-info-docstring-p' is corrected.
(python-info-docstring-p-7): New test. (Bug#63622)
Handle #@00 in new reader in a compatible way (bug#63722)
This was a regression from Emacs 28.
* src/lread.c (skip_lazy_string, read0): Make #@00 read as nil, which
is a quirk from the old reader that we preserve for compatibility.
* test/src/lread-tests.el (lread-skip-to-eof): Verify it.
Juri Linkov [Thu, 25 May 2023 18:40:38 +0000 (21:40 +0300)]
* lisp/progmodes/project.el: Move :safe from defcustom to autoload (bug#63469)
(project-vc-ignores, project-vc-merge-submodules)
(project-vc-include-untracked, project-vc-name)
(project-vc-extra-root-markers, project-kill-buffers-display-buffer-list):
Autoload the line that puts 'safe-local-variable' property on defcustom symbol
instead of using the :safe keyword.
Juri Linkov [Thu, 25 May 2023 18:24:23 +0000 (21:24 +0300)]
Add vc-create/switch/print-branch to menu and update documentation (bug#63690)
* doc/emacs/maintaining.texi (VC Change Log):
Add 'C-x v b l' (vc-print-branch-log).
(Creating Branches): Add @kindex and @findex for vc-create-branch.
(Switching Branches): Add @kindex and @findex for vc-switch-branch.
* lisp/vc/vc-hooks.el (vc-menu-map): Add menu items for new
commands vc-create-branch and vc-switch-branch, and also
vc-print-branch-log.