]> git.eshelyaron.com Git - emacs.git/log
emacs.git
2 years agoEnsure VC package names are not empty
Philip Kaludercic [Wed, 11 Jan 2023 08:27:01 +0000 (09:27 +0100)]
Ensure VC package names are not empty

* lisp/emacs-lisp/package-vc.el (package-vc--unpack): Raise an error
if the package name is empty.
(package-vc-install): Avoid generating an empty file name, if a URL
ends with a slash, and raise an error if the package name is empty.

2 years agoHandle missing package description when unpacking vc packages
Philip Kaludercic [Wed, 11 Jan 2023 08:21:57 +0000 (09:21 +0100)]
Handle missing package description when unpacking vc packages

* lisp/emacs-lisp/package-vc.el (package-vc--unpack): Create a dummy
descriptor if PKG-DESC is nil.

2 years agoCC Mode: partially revert commit from 2022-10-04
Alan Mackenzie [Tue, 10 Jan 2023 20:29:37 +0000 (20:29 +0000)]
CC Mode: partially revert commit from 2022-10-04

This reversion is of an ill-advised optimization, which resulted in non-type
identifiers getting fontified as types.

* lisp/progmodes/cc-fonts.el (c-fontify-new-found-type): Rather than writing
the expected face directly to the text, instead remove the `fontified'
property.  This allows the full font-lock mechanism to fontify the buffer
correctly.

2 years agoFix reftex-citation docstring (bug#60710)
Manuel Uberti [Tue, 10 Jan 2023 14:51:46 +0000 (15:51 +0100)]
Fix reftex-citation docstring (bug#60710)

* lisp/textmodes/reftex-cite.el (reftex-citation): Fix spelling.

2 years agoImprove 'describe-char-fold-equivalences' docstring
Robert Pluim [Tue, 10 Jan 2023 14:22:34 +0000 (15:22 +0100)]
Improve 'describe-char-fold-equivalences' docstring

* lisp/char-fold.el (describe-char-fold-equivalences): Explain what
the output looks like.

2 years agoRemove obsolete server buffers on MOTD in erc-track
F. Jason Park [Wed, 4 Jan 2023 07:10:53 +0000 (23:10 -0800)]
Remove obsolete server buffers on MOTD in erc-track

* lisp/erc/erc-networks.el
(erc-networks--copy-server-buffer-functions): New internal hook
through which modules can perform housekeeping when server buffers
belonging to the same network context are merged.
(erc-networks--copy-over-server-buffer-contents): Run new internal
hook `erc-networks--copy-server-buffer-functions'.
* lisp/erc/erc-track.el (erc-track-enable, erc-track-disable): Manage
membership in `erc-networks--copy-server-buffer-functions' hook.
(erc-track--replace-killed-buffer): New function to replace server
buffer being killed in `erc-modified-channels-alist'.
* test/lisp/erc/erc-scenarios-base-association.el
(erc-scenarios-networks-merge-server-track): New test.
* test/lisp/erc/resources/networks/merge-server/track.eld: New test
data.  (Bug#60560.)

2 years ago; Fix wrong type in erc-ignore hide-list options
F. Jason Park [Tue, 3 Jan 2023 02:13:08 +0000 (18:13 -0800)]
; Fix wrong type in erc-ignore hide-list options

* lisp/erc/erc.el (erc-network-hide-list, erc-channel-hide-list):
Fix type in custom definition.

2 years ago; Kill some stray buffers left behind by ERC tests
F. Jason Park [Wed, 4 Jan 2023 07:10:53 +0000 (23:10 -0800)]
; Kill some stray buffers left behind by ERC tests

* test/lisp/erc/erc-services-tests.el
(erc--auth-source-search--plstore-standard,
erc--auth-source-search--plstore-announced,
erc--auth-source-search--plstore-overrides): Kill buffer renamed by
plstore.  In the future, try using the `:buffer' keyword introduced in
Emacs 29.
* test/lisp/erc/resources/erc-d/erc-d-t.el
(erc-d-t-kill-related-buffers): Don't forget about `erc-dcc-chat-mode'
buffers.

2 years agoFix completion-auto-help docstring (bug#60709)
Manuel Uberti [Tue, 10 Jan 2023 13:24:04 +0000 (14:24 +0100)]
Fix completion-auto-help docstring (bug#60709)

* lisp/minibuffer.el (completion-auto-help): Remove extra period.

2 years agoFix c-ts-mode comment indent
Yuan Fu [Tue, 10 Jan 2023 05:46:07 +0000 (21:46 -0800)]
Fix c-ts-mode comment indent

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--comment-2nd-line-matcher): Also make sure PARENT is a
comment node.

2 years agoHighlight identifier in import statements in js-ts-mode
Yuan Fu [Tue, 10 Jan 2023 05:31:38 +0000 (21:31 -0800)]
Highlight identifier in import statements in js-ts-mode

Follow-up on bug#60689.  This commit just copied the change in
e385c099b8c to js-ts-mode.

* lisp/progmodes/js.el:
(js--treesit-font-lock-settings): Add import query.

2 years agoDon't print named tree-sitter nodes with parenthesizes (bug#60696)
Yuan Fu [Tue, 10 Jan 2023 04:15:12 +0000 (20:15 -0800)]
Don't print named tree-sitter nodes with parenthesizes (bug#60696)

* src/print.c (print_vectorlike): Use empty string as delimiters if
the node is named.

2 years agoImprove fontification for import-statements in typescript-ts-mode
Jostein Kjønigsen [Mon, 9 Jan 2023 10:17:53 +0000 (11:17 +0100)]
Improve fontification for import-statements in typescript-ts-mode

(bug#60689)

* lisp/progmodes/typescript-ts-mode.el:
(typescript-ts-mode--font-lock-settings): Add rules to highlight the
actual imports in import-statements.

2 years agoFix c-ts-mode indentation for 2nd line in block comment (bug#60270)
Yuan Fu [Mon, 9 Jan 2023 09:44:44 +0000 (01:44 -0800)]
Fix c-ts-mode indentation for 2nd line in block comment (bug#60270)

If the first line is "/*" or "/*   ", indent like this:

/*
   aaa

If the first line is "/*   some text", indent like this:

/*   some text
     aaa

* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles):
(c-ts-mode--looking-at-star): Minor refactor.
(c-ts-mode--comment-2nd-line-matcher)
(c-ts-mode--comment-2nd-line-anchor): New functions.
* lisp/treesit.el (treesit-simple-indent-presets):
prev-adaptive-prefix doesn't handle the comment-start-skip case (i.e,
2nd line) anymore.  (Handled by the new matcher.)

2 years ago; xref.el: Bump version
Dmitry Gutov [Tue, 10 Jan 2023 00:02:09 +0000 (02:02 +0200)]
; xref.el: Bump version

2 years ago; project.el: Bump version
Dmitry Gutov [Tue, 10 Jan 2023 00:00:29 +0000 (02:00 +0200)]
; project.el: Bump version

2 years ago; * src/callint.c (Finteractive): Doc string clarification.
Eli Zaretskii [Mon, 9 Jan 2023 12:03:04 +0000 (14:03 +0200)]
; * src/callint.c (Finteractive): Doc string clarification.

2 years ago* lisp/vc/diff-mode.el (diff-font-lock-keywords): Check for limit.
Juri Linkov [Mon, 9 Jan 2023 07:54:19 +0000 (09:54 +0200)]
* lisp/vc/diff-mode.el (diff-font-lock-keywords): Check for limit.

This check is necessary since 'diff-beginning-of-hunk' can move
not only backwards, but also forwards (bug#60660).

2 years agoMinor improvement for tree-sitter explorer
Yuan Fu [Mon, 9 Jan 2023 04:30:07 +0000 (20:30 -0800)]
Minor improvement for tree-sitter explorer

If you open an empty python buffer and type

1 + 2
a
b

Currently the explorer only displays the top-level node at point, ie,
only 1 + 2, only a, or only b. That's kind of awkward, so if the
buffer is small, show the entire parse tree.

* lisp/treesit.el (treesit--explorer-refresh): See above.

2 years agoMake sure NODE is not the root node in tree-sitter indent (bug#60602)
Yuan Fu [Mon, 9 Jan 2023 03:05:19 +0000 (19:05 -0800)]
Make sure NODE is not the root node in tree-sitter indent (bug#60602)

There are two possible ways to solve the problem raised in the bug
report: either make sure NODE is never the root (so that parent is
never nil), or allow parent to be nil.

If we go with the latter, a lot of matcher and anchor functions need
change (they need to guard against a null parent).  I tried it, and
needing to check for null parent is pretty annoying.  In comparison,
if NODE is never the root, it is very convenient for the user, and it
doesn't complicate the rule that much (and it's rather intuitive,
people usually don't think of the case where NODE is the root node).
So that's what I choose.

* doc/lispref/modes.texi (Parser-based Indentation): Update manual.
* lisp/treesit.el (treesit-indent-function): Update docstring.
(treesit--indent-1): Make sure NODE is not the root.

2 years agoFix label indent of GNU and Linux style in c-ts-mode (bug#60543)
Yuan Fu [Mon, 9 Jan 2023 00:57:29 +0000 (16:57 -0800)]
Fix label indent of GNU and Linux style in c-ts-mode (bug#60543)

The previous fix isn't correct.

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--indent-styles): New indent rule.  Fix the rule for Linux
style.
(c-ts-mode--top-level-label-matcher): New function.

2 years agoImprove go-ts-mode Imenu, navigation and electric pair (bug#60407)
Evgeni Kolev [Thu, 29 Dec 2022 15:49:40 +0000 (17:49 +0200)]
Improve go-ts-mode Imenu, navigation and electric pair (bug#60407)

The Imenu items are extended to support "Method", "Struct",
"Interface", "Alias" and "Type".

go-ts-mode is updated to use the Imenu facility added in commit
b39dc7ab27a696a8607ab859aeff3c71509231f5.

Variable electric-indent-chars is set in order to improve integration
with Electric Pair mode.

* lisp/progmodes/go-ts-mode.el (go-ts-mode--imenu-1) (go-ts-mode--imenu):
Remove functions.
(go-ts-mode--defun-name, go-ts-mode--interface-node-p)
(go-ts-mode--struct-node-p, go-ts-mode--other-type-node-p)
(go-ts-mode--alias-node-p): New functions.
(go-ts-mode): Improve Imenu settings, navigation, add Electric Pair
mode settings.

2 years ago; ruby.rb: Fix pattern matching syntax and extend the example
Dmitry Gutov [Sun, 8 Jan 2023 22:57:36 +0000 (00:57 +0200)]
; ruby.rb: Fix pattern matching syntax and extend the example

2 years agoRevert "Add c-or-c++-ts-mode (bug#59613)"
Yuan Fu [Sun, 8 Jan 2023 17:40:49 +0000 (09:40 -0800)]
Revert "Add c-or-c++-ts-mode (bug#59613)"

This reverts commit 1df2826639c912396fac0af108301533dac71406.

I forgot about the feature freeze, sorry :-)

2 years ago; * src/pgtkfns.c (parse_resource_key): Use recursive schema lookup
Tad Fisher [Wed, 4 Jan 2023 21:40:17 +0000 (13:40 -0800)]
; * src/pgtkfns.c (parse_resource_key): Use recursive schema lookup

XDG_DATA_DIRS may consist of multiple directories, and
g_settings_schema_source_get_default composes these into a recursive
schema source. One must pass TRUE to g_settings_schema_source_lookup,
otherwise only the first directory in XDG_DATA_DIRS is searched.

It follows that in the case that the directory containing the compiled
GSettings schema for Emacs is not the first in XDG_DATA_DIRS,
parse_resource_key will not accept any resource key, which causes
pgtk_get_defaults_value and pgtk_set_defaults_value to fail.

This impacts systems that compose multiple GSettings schema sources
via XDG_DATA_DIRS, such Flatpak and NixOS.

Supporting GIO documentation for g_settings_schema_source_get_default:

> The returned source may actually consist of multiple schema sources
> from different directories, depending on which directories were given
> in `XDG_DATA_DIRS` and `GSETTINGS_SCHEMA_DIR`. For this reason, all
> lookups performed against the default source should probably be done
> recursively.

Bug#60565

Copyright-paperwork-exempt: yes

2 years agoAdd back renamed function 'font-lock-fontify-syntactically-region'
Benson Chu [Sun, 1 Jan 2023 01:45:43 +0000 (19:45 -0600)]
Add back renamed function 'font-lock-fontify-syntactically-region'

A more accurate replacement for font-lock-fontify-syntactically-region
would be a function that funcalls the
font-lock-fontify-syntactically-function variable. That way, callers
of the function can inherit new behavior, if the value of that variable
changes.

* lisp/font-lock.el (font-lock-fontify-syntactically-region):
Add function back, remove its obsolete alias.

Copyright-paperwork-exempt: yes

2 years ago; * lisp/progmodes/ruby-ts-mode.el: Fix compilation warnings (bug#60647).
Eli Zaretskii [Sun, 8 Jan 2023 10:56:13 +0000 (12:56 +0200)]
; * lisp/progmodes/ruby-ts-mode.el: Fix compilation warnings (bug#60647).

2 years ago; * src/callint.c (Finteractive): Fix the doc string (bug#60645).
Eli Zaretskii [Sun, 8 Jan 2023 10:43:56 +0000 (12:43 +0200)]
; * src/callint.c (Finteractive): Fix the doc string (bug#60645).

2 years agoImprove options and docs of M-x command completion
Eli Zaretskii [Sun, 8 Jan 2023 10:23:26 +0000 (12:23 +0200)]
Improve options and docs of M-x command completion

* lisp/simple.el (read-extended-command-predicate): Expand the
doc string.  Add 2 more selectable values.
(command-completion-using-modes-and-keymaps-p): New function.
(execute-extended-command): Mention
'read-extended-command-predicate' in the doc string.  (Bug#60645)

2 years ago; Fix NEWS
Michael Albinus [Sun, 8 Jan 2023 09:56:06 +0000 (10:56 +0100)]
; Fix NEWS

2 years agoUpdate to Org 9.6-90-ga6523f
Kyle Meyer [Sun, 8 Jan 2023 04:50:54 +0000 (23:50 -0500)]
Update to Org 9.6-90-ga6523f

2 years agoFix string fontification on python-ts-mode (bug#60599)
Yuan Fu [Sun, 8 Jan 2023 02:41:28 +0000 (18:41 -0800)]
Fix string fontification on python-ts-mode (bug#60599)

* lisp/progmodes/python.el:
(python--treesit-fontify-string): Generalize and skip anything
before the first quote character.

2 years agoFix string-interpolation feature of python-ts-mode (bug#60599)
Yuan Fu [Sun, 8 Jan 2023 02:38:24 +0000 (18:38 -0800)]
Fix string-interpolation feature of python-ts-mode (bug#60599)

* lisp/progmodes/python.el:
(python--treesit-fontify-string-interpolation): New function.
(python--treesit-settings): Use the new function for
string-interpolation.

2 years agoAdd indentation rule for concatenated_string (bug#60572)
Theodor Thornhill [Sat, 7 Jan 2023 12:04:07 +0000 (13:04 +0100)]
Add indentation rule for concatenated_string (bug#60572)

* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): Indent to
parent-bol.

2 years agoFix highlighting of variable-declarations in typescript-ts-mode
Jostein Kjønigsen [Wed, 4 Jan 2023 08:13:23 +0000 (09:13 +0100)]
Fix highlighting of variable-declarations in typescript-ts-mode

(bug#60546)

- Highlight variable declarations in catch-clauses.
- Remove highlighting of variables where not declarations (improve
  consistency with other *-ts-modes).

* lisp/progmodes/typescript-ts-mode.el:
(typescript-ts-mode--font-lock-settings): See above.

2 years agoFix label indentation for Linux style in c-ts-mode (bug#60543)
Yuan Fu [Sun, 8 Jan 2023 02:11:03 +0000 (18:11 -0800)]
Fix label indentation for Linux style in c-ts-mode (bug#60543)

Reference:
1. https://www.gnu.org/software/indent/manual/indent/Common-styles.html
2. https://www.gnu.org/software/indent/manual/indent/Option-Summary.html

The GNU indent manual says Linux style should use -il1 flag, which
means "indent labels to column 1".

* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): Indent label
to column 1 in Linux style.

2 years agoRemove duplicate entries in c-ts-mode's Imenu
Yuan Fu [Sun, 8 Jan 2023 01:46:27 +0000 (17:46 -0800)]
Remove duplicate entries in c-ts-mode's Imenu

Right now the Class subindex includes top-level functions, which is
wrong. This change ensures the Class subindex only contain classes and
functions nested in those classes.

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--defun-for-class-in-imenu-p): New function.
* lisp/progmodes/c-ts-mode.el (c-ts-base-mode): Use the new function.

2 years agoFix use of treesit-ready-p in c/c++-ts-mode
Yuan Fu [Sun, 8 Jan 2023 01:26:26 +0000 (17:26 -0800)]
Fix use of treesit-ready-p in c/c++-ts-mode

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode)
(c++-ts-mode): Put setup code in a when form.

2 years ago; * lisp/progmodes/gud.el (gud-tooltip-modes): Add ts- modes.
Yuan Fu [Sun, 8 Jan 2023 00:54:43 +0000 (16:54 -0800)]
; * lisp/progmodes/gud.el (gud-tooltip-modes): Add ts- modes.

Prompted by bug#60463.

2 years ago; * lisp/align.el (align-c++-modes): Add c/c++-ts-mode.
Yuan Fu [Sun, 8 Jan 2023 00:52:17 +0000 (16:52 -0800)]
; * lisp/align.el (align-c++-modes): Add c/c++-ts-mode.

This fixes bug#60463.

2 years agoAdd documentation for c/c++-ts-mode (bug#60443)
Yuan Fu [Sun, 8 Jan 2023 00:32:46 +0000 (16:32 -0800)]
Add documentation for c/c++-ts-mode (bug#60443)

Explain that tree-sitter c modes and cc-mode c modes don't share
config variables.

* lisp/progmodes/c-ts-mode.el (c-ts-mode)
(c++-ts-mode): Update docstring.

2 years ago(ruby-ts--font-lock-settings): Improve highlighting in patterns
Dmitry Gutov [Sun, 8 Jan 2023 01:56:32 +0000 (03:56 +0200)]
(ruby-ts--font-lock-settings): Improve highlighting in patterns

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--font-lock-settings):
Improve highlighting in patterns: highlight values not keys as
variable in the usual case; highlight keys when no value;
highlight the "as pattern" variable.

2 years agoOptionally include the namespace in c-ts-mode--declarator-identifier
Yuan Fu [Sun, 8 Jan 2023 00:03:37 +0000 (16:03 -0800)]
Optionally include the namespace in c-ts-mode--declarator-identifier

This is an additional fix for bug#60397.

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--declarator-identifier): New parameter QUALIFIED.
(c-ts-mode--defun-name): Use qualified identifier.

2 years agoSupport namespaces in c++-ts-mode (bug#60397)
Yuan Fu [Sat, 7 Jan 2023 23:45:05 +0000 (15:45 -0800)]
Support namespaces in c++-ts-mode (bug#60397)

Not a complete fix.  See the next commit.

* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): Add rules.
(c-ts-mode--defun-name): Add namespace_definition.
(c-ts-base-mode): Add namespace_definition to
treesit-defun-type-regexp.

2 years agoFix c-ts-mode--looking-at-star
Yuan Fu [Sat, 7 Jan 2023 23:26:56 +0000 (15:26 -0800)]
Fix c-ts-mode--looking-at-star

Not the topic of bug#60270 but reported in one of the replies.

* lisp/progmodes/c-ts-mode.el (c-ts-mode--looking-at-star): Check not
the character after point but character after BOL. Otherwise
indentation is wrong when point is not at BOL.

2 years agoAdd c-or-c++-ts-mode (bug#59613)
Yuan Fu [Sat, 7 Jan 2023 22:58:37 +0000 (14:58 -0800)]
Add c-or-c++-ts-mode (bug#59613)

* lisp/progmodes/c-ts-mode.el
(c-ts-mode--c-or-c++-regexp): New variable.
(c-or-c++-ts-mode): New mode.
* etc/NEWS: Mention c-or-c++-ts-mode.

2 years agoDocument the 'definition-name' property.
Eli Zaretskii [Sat, 7 Jan 2023 17:57:30 +0000 (19:57 +0200)]
Document the 'definition-name' property.

* doc/lispref/symbols.texi (Standard Properties): Document
'definition-name'.
* doc/lispref/functions.texi (Defining Functions): Describe how to
use 'definition-name' when generating function definitions at run
time.  (Bug#60568)

2 years ago; Fix description of etc/DOC
Eli Zaretskii [Sat, 7 Jan 2023 17:16:47 +0000 (19:16 +0200)]
; Fix description of etc/DOC

* doc/lispref/help.texi (Accessing Documentation): Doc strings of
preloaded symbols are no longer in etc/DOC.

2 years ago; Fix documentation of etc/DOC
Eli Zaretskii [Sat, 7 Jan 2023 13:25:11 +0000 (15:25 +0200)]
; Fix documentation of etc/DOC

* doc/lispref/help.texi (Documentation Basics): Doc strings of
preloaded symbols are no longer in etc/DOC.

2 years ago(treesit-simple-indent-presets): Do that for 'or' as well.
Dmitry Gutov [Sat, 7 Jan 2023 11:16:56 +0000 (13:16 +0200)]
(treesit-simple-indent-presets): Do that for 'or' as well.

* lisp/treesit.el
(treesit-simple-indent-presets): Do that for 'or' as well.

2 years ago; Minor rewording of tree-sitter terminology
Eli Zaretskii [Sat, 7 Jan 2023 09:25:52 +0000 (11:25 +0200)]
; Minor rewording of tree-sitter terminology

* doc/lispref/parsing.texi (Retrieving Nodes): Minor rewording.
(Bug#60555)

2 years agoFix 'python-shell-buffer-substring' when START is in middle of 1st line
kobarity [Sun, 1 Jan 2023 12:09:10 +0000 (21:09 +0900)]
Fix 'python-shell-buffer-substring' when START is in middle of 1st line

* lisp/progmodes/python.el (python-shell-buffer-substring): Instead
of checking whether START is point-min, check whether START is in
the first line.  (Bug#60466)
* test/lisp/progmodes/python-tests.el
(python-shell-buffer-substring-18): New test.

2 years ago; Fix last change
Eli Zaretskii [Sat, 7 Jan 2023 08:47:44 +0000 (10:47 +0200)]
; Fix last change

* doc/emacs/misc.texi (Saving Emacs Sessions): Minor rewording and
rearrangements.  (Bug#60600)

2 years agoRearrange the "Saving Emacs Sessions" section of the user manual
Manuel Giraud [Fri, 6 Jan 2023 10:29:20 +0000 (11:29 +0100)]
Rearrange the "Saving Emacs Sessions" section of the user manual

* doc/emacs/misc.texi (Saving Emacs Sessions): Organize this
node more logically with main behavior and important features
near the top.   (Bug#60600)

2 years ago(treesit-simple-indent-presets): Ensure 'and' works for anchors too
Dmitry Gutov [Sat, 7 Jan 2023 01:28:38 +0000 (03:28 +0200)]
(treesit-simple-indent-presets): Ensure 'and' works for anchors too

* lisp/treesit.el (treesit-simple-indent-presets):
Rewrite to return the last successful evaluation, not just t.

2 years ago(treesit--indent-rules-optimize): Optimize 'and' and 'or' matcher forms
Dmitry Gutov [Sat, 7 Jan 2023 00:44:07 +0000 (02:44 +0200)]
(treesit--indent-rules-optimize): Optimize 'and' and 'or' matcher forms

* lisp/treesit.el (treesit--indent-rules-optimize):
Optimize 'and' and 'or' matcher forms.  When 'and' has a 'query'
matcher inside (as is the case in ruby-ts--indent-rules, many
times over), this yields a significant performance boost.

2 years ago(treesit-simple-indent-presets): Short-circuit 'and' and 'or'
Dmitry Gutov [Sat, 7 Jan 2023 00:02:25 +0000 (02:02 +0200)]
(treesit-simple-indent-presets): Short-circuit 'and' and 'or'

* lisp/treesit.el (treesit-simple-indent-presets):
Short-circuit the 'and' and 'or' matchers.  To avoid calling all
fns after one returned nil or truthy value, respectively.

2 years ago(font-lock-regexp-face): New face
Dmitry Gutov [Fri, 6 Jan 2023 17:56:20 +0000 (19:56 +0200)]
(font-lock-regexp-face): New face

* lisp/font-lock.el (font-lock-regexp-face): New face.

* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--font-lock-settings):
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--font-lock-settings):
* lisp/progmodes/js.el (js--treesit-font-lock-settings):
Use it for regexps.

* etc/NEWS: Mention the addition.

2 years agoUnify the string interpolation delimiters face across ts modes
Dmitry Gutov [Fri, 6 Jan 2023 14:17:50 +0000 (16:17 +0200)]
Unify the string interpolation delimiters face across ts modes

* lisp/progmodes/js.el (js--treesit-font-lock-settings):
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--font-lock-settings):
* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--font-lock-settings):
Use font-lock-misc-punctuation-face for string interpolation
delimiters.

2 years agoruby-ts-mode: Highlight more kinds of parameters
Dmitry Gutov [Fri, 6 Jan 2023 13:38:00 +0000 (15:38 +0200)]
ruby-ts-mode: Highlight more kinds of parameters

* lisp/progmodes/ruby-ts-mode.el
(ruby-ts--font-lock-settings): Highlight destructured parameters,
lambda parameters, identifiers in pattern matching clauses
(array/hash) and exception variables.
Move the 'symbol' matchers lower to make 'hash_key_symbol' lower
priority than hash keys in match patterns.

2 years agoFix `pr-interface'
Robert Pluim [Fri, 6 Jan 2023 08:00:00 +0000 (09:00 +0100)]
Fix `pr-interface'

`pr-interface' specifies `inline' for its menu items, which is not
necessary, but it causes `widget-choice-value-create' to bug
out.  (Bug#60501)

* lisp/wid-edit.el (widget-choice-value-create): Allow the value to be
a non-list.
* test/lisp/wid-edit-tests.el (widget-test-handle-spurious-inline):
Add test to ensure that unnecessary :inline is allowed.

2 years agoFurther generic-related improvements in csharp-ts-mode (bug#60376)
Jostein Kjønigsen [Sun, 1 Jan 2023 19:46:02 +0000 (20:46 +0100)]
Further generic-related improvements in csharp-ts-mode (bug#60376)

This is an additional patch for bug#60376.

* lisp/progmodes/csharp-mode.el (csharp-ts-mode--font-lock-settings):
New rules.

2 years agoruby-ts-mode: Highlight method and block parameters
Dmitry Gutov [Fri, 6 Jan 2023 02:48:35 +0000 (04:48 +0200)]
ruby-ts-mode: Highlight method and block parameters

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--font-lock-settings):
Add rules for method and block parameters.
(ruby-ts-mode): Add corresponding feature.

2 years agoruby-ts-mode: Highlight variable assignments
Perry Smith [Fri, 6 Jan 2023 02:20:02 +0000 (04:20 +0200)]
ruby-ts-mode: Highlight variable assignments

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--font-lock-settings):
Bring back the 'assignment' feature.
(ruby-ts-mode): Replace the unused 'variable' with 'assignment'.  Use
the level 3 for consistency with other ts modes.
Update the Commentary as well.

2 years agoruby-ts-mode: Move 'self' and 'super' from constants to keywords
Dmitry Gutov [Fri, 6 Jan 2023 01:31:41 +0000 (03:31 +0200)]
ruby-ts-mode: Move 'self' and 'super' from constants to keywords

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--font-lock-settings):
Move 'self' and 'super' from constants to keywords.

2 years ago(ruby-ts-mode): Split font-lock feature 'builtin' into two
Dmitry Gutov [Fri, 6 Jan 2023 01:12:20 +0000 (03:12 +0200)]
(ruby-ts-mode): Split font-lock feature 'builtin' into two

* lisp/progmodes/ruby-ts-mode.el (ruby-ts-mode):
Split the 'builtin' feature in two: 'builtin-constant' and
'builtin-variable'.
(ruby-ts-highlight-predefined-constants):
Drop the user option, the highlighting granularity can be chosen
using treesit-font-lock-recompute-features.
(ruby-ts--font-lock-settings): Update accordingly.
(ruby-ts--predefined-constants, ruby-ts--predefined-variables):
Fix docstrings.

2 years agoAvoid assertion violation due to fill-column indicator face
Eli Zaretskii [Thu, 5 Jan 2023 20:33:51 +0000 (22:33 +0200)]
Avoid assertion violation due to fill-column indicator face

* src/xdisp.c (extend_face_to_end_of_line): Use the original
iterator metrics for the stretch glyph, the one unaffected by the
'fill-column-indicator' face.  (Bug#60580)

2 years agoMerge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29
Eli Zaretskii [Thu, 5 Jan 2023 20:32:17 +0000 (22:32 +0200)]
Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/emacs into emacs-29

2 years ago; Another review of etc/NEWS
Michael Albinus [Thu, 5 Jan 2023 19:53:25 +0000 (20:53 +0100)]
; Another review of etc/NEWS

2 years ago; * src/gnutls.c (Fgnutls_deinit): Fix typo in doc string (bug#60579).
Eli Zaretskii [Thu, 5 Jan 2023 18:39:14 +0000 (20:39 +0200)]
; * src/gnutls.c (Fgnutls_deinit): Fix typo in doc string (bug#60579).

2 years ago* lisp/cedet/semantic/symref/grep.el: Support ts-modes (bug#60525)
Juri Linkov [Thu, 5 Jan 2023 18:18:11 +0000 (20:18 +0200)]
* lisp/cedet/semantic/symref/grep.el: Support ts-modes (bug#60525)

(semantic-symref-filepattern-alist): Duplicate entries
c-mode -> c-ts-mode, c++-mode -> c++-ts-mode, ruby-mode -> ruby-ts-mode,
python-mode -> python-ts-mode.

2 years ago; Another fix for doc strings of 2 treesit.el functions
Eli Zaretskii [Thu, 5 Jan 2023 07:34:02 +0000 (09:34 +0200)]
; Another fix for doc strings of 2 treesit.el functions

* lisp/treesit.el (treesit-parent-while): Clarify "closest" and
"furthest" in the doc string.  (Bug#60531)

2 years ago; Fix the doc strings of 2 treesit.el functions
Eli Zaretskii [Thu, 5 Jan 2023 07:20:02 +0000 (09:20 +0200)]
; Fix the doc strings of 2 treesit.el functions

* lisp/treesit.el (treesit-parent-until, treesit-parent-while):
Doc fixes.  (Bug#60531)

2 years agoMake 'toml-ts-mode' optional
Eli Zaretskii [Thu, 5 Jan 2023 06:40:07 +0000 (08:40 +0200)]
Make 'toml-ts-mode' optional

* etc/NEWS: Reflect the fact that 'toml-ts-mode' is optional.

* lisp/textmodes/toml-ts-mode.el (auto-mode-alist): Don't autoload
the addition of 'toml-ts-mode'.  (Bug#60559)

2 years ago; * etc/NEWS: Fix wording in last change.
Eli Zaretskii [Wed, 4 Jan 2023 18:52:41 +0000 (20:52 +0200)]
; * etc/NEWS: Fix wording in last change.

2 years ago; * etc/NEWS: Instructions for builds without tree-sitter (bug#60559)
Eli Zaretskii [Wed, 4 Jan 2023 18:51:04 +0000 (20:51 +0200)]
; * etc/NEWS: Instructions for builds without tree-sitter (bug#60559)

2 years ago; Fix documentation of y-or-n-p/yes-or-no-p
Eli Zaretskii [Wed, 4 Jan 2023 17:25:47 +0000 (19:25 +0200)]
; Fix documentation of y-or-n-p/yes-or-no-p

* lisp/subr.el (y-or-n-p):
* src/fns.c (Fyes_or_no_p): Doc fix.

2 years agoFix bug in Tramp multi-hop
Michael Albinus [Wed, 4 Jan 2023 17:12:02 +0000 (18:12 +0100)]
Fix bug in Tramp multi-hop

* lisp/net/tramp.el (tramp-compute-multi-hops): Make check for
host name more robust.  (Bug#60499)

2 years ago* lisp/files.el (find-sibling-rules): Fix docstring.
Michael Albinus [Wed, 4 Jan 2023 17:11:31 +0000 (18:11 +0100)]
* lisp/files.el (find-sibling-rules): Fix docstring.

2 years agoTree-sitter doc fixes (bug#60524)
Juri Linkov [Wed, 4 Jan 2023 07:57:06 +0000 (09:57 +0200)]
Tree-sitter doc fixes (bug#60524)

* doc/lispref/modes.texi (Parser-based Font Lock):
Replace :lang with :language.

* doc/lispref/parsing.texi (Language Grammar): Replace
treesit-load-suffixes with dynamic-library-suffixes.
(Retrieving Nodes): Fix function names.
(Tree-sitter Major Modes): Fix treesit-ready-p args.
Fix pxref to Parser-based Indentation.
(Tree-sitter C API): Fix function names.

* lisp/treesit.el (treesit--simple-indent-eval): Remove cond BODY
duplicated from CONDITION.
(treesit)<define-short-documentation-group>: Fix function names.

2 years ago; Fix function reference in comment in c-ts-mode.el (bug#60514)
Daniel Martín [Tue, 3 Jan 2023 12:49:08 +0000 (13:49 +0100)]
; Fix function reference in comment in c-ts-mode.el (bug#60514)

* lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings): Fix
reference.

2 years agoFontify C++ function definitions in c-ts-mode (bug#60529)
Daniel Martín [Tue, 3 Jan 2023 21:08:13 +0000 (22:08 +0100)]
Fontify C++ function definitions in c-ts-mode (bug#60529)

* lisp/progmodes/c-ts-mode.el (c-ts-mode--declarator-identifier):
Teach the code how to extract the declarator of a node of type
"qualified_identifier".
(c-ts-mode--fontify-declarator): Consider the case where the
identifier in a function declarator is buried inside
"qualifier_identifier" nodes.

2 years ago(ruby-ts-add-log-current-function): Fix when between two methods
Dmitry Gutov [Tue, 3 Jan 2023 22:37:43 +0000 (00:37 +0200)]
(ruby-ts-add-log-current-function): Fix when between two methods

* lisp/progmodes/ruby-ts-mode.el
(ruby-ts-add-log-current-function): Fix the case when point is
between two methods.  'treesit-node-at' returs the 'def' node of
the method after point in such case, so it behaved like point was
inside the method below.

* test/lisp/progmodes/ruby-ts-mode-tests.el
(ruby-ts-add-log-current-method-outside-of-method):
Update the test case.

* test/lisp/progmodes/ruby-mode-tests.el
(ruby-add-log-current-method-outside-of-method):
Mirror that change.

2 years ago; * doc/lispref/positions.texi (List Motion): Minor wording fix.
Eli Zaretskii [Tue, 3 Jan 2023 13:16:42 +0000 (15:16 +0200)]
; * doc/lispref/positions.texi (List Motion): Minor wording fix.

2 years ago; Improve documentation of 'treesit-language-source-alist'
Eli Zaretskii [Tue, 3 Jan 2023 13:12:48 +0000 (15:12 +0200)]
; Improve documentation of 'treesit-language-source-alist'

* lisp/treesit.el (treesit--install-language-grammar-build-recipe)
(treesit-install-language-grammar):  Doc fixes.
(treesit-install-language-grammar): Autoload it.

* etc/NEWS: Improve wording of the
'treesit-install-language-grammar' documentation.

2 years ago; * etc/NEWS: Mention treesit-install-language-grammar.
Yuan Fu [Tue, 3 Jan 2023 06:52:42 +0000 (22:52 -0800)]
; * etc/NEWS: Mention treesit-install-language-grammar.

2 years ago* lisp/vc/vc-git.el (vc-git-checkin): Pass vc-git-diff-switches.
Sean Whitton [Tue, 3 Jan 2023 06:08:39 +0000 (23:08 -0700)]
* lisp/vc/vc-git.el (vc-git-checkin): Pass vc-git-diff-switches.

2 years agoExtract common code into ruby-base-mode to derive from
Dmitry Gutov [Tue, 3 Jan 2023 01:10:49 +0000 (03:10 +0200)]
Extract common code into ruby-base-mode to derive from

* lisp/progmodes/ruby-mode.el (ruby-base-mode):
New major base mode, to set up common vars and hooks.
(ruby-mode-variables): Delete.  Move most code to ruby-base-mode.
And some -- to ruby-mode body.
(ruby-mode): Derive from ruby-base-mode.  Also move some setup
to there.

* lisp/progmodes/ruby-ts-mode.el (ruby-ts-mode):
Derive from ruby-base-mode.  Remove duplicating settings.

2 years agoruby-ts-mode: Indentation fixes
Dmitry Gutov [Tue, 3 Jan 2023 00:26:00 +0000 (02:26 +0200)]
ruby-ts-mode: Indentation fixes

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--align-keywords):
Fix for 'def' (which was misread as 'method' in the check).
(ruby-ts--indent-rules): Indent the curly block closer the same
way as the 'do ... end' closer.

2 years agoruby-ts--font-lock-settings: Use more standard faces
Dmitry Gutov [Mon, 2 Jan 2023 22:41:25 +0000 (00:41 +0200)]
ruby-ts--font-lock-settings: Use more standard faces

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--font-lock-settings):
Use more standard faces for regexp literals and string
interpolation delimiters (following js-ts-mode).

2 years agoruby-ts-mode: Standardize the string literal highlights
Dmitry Gutov [Mon, 2 Jan 2023 21:26:39 +0000 (23:26 +0200)]
ruby-ts-mode: Standardize the string literal highlights

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--font-lock-settings):
Use font-lock-string-face for %w() and `...`.
Use font-lock-constant-face (just like we do for symbol literals)
for symbol array literals, %i().
Combine the matchers for string content and heredocs.

2 years agoImprove fontification in java-ts-mode (bug#60492)
Theodor Thornhill [Mon, 2 Jan 2023 12:46:25 +0000 (13:46 +0100)]
Improve fontification in java-ts-mode (bug#60492)

* lisp/progmodes/java-ts-mode.el (java-ts-mode--font-lock-settings):
Add expression_statement with only identifier support.

2 years agoFontification improvements in typescript-ts-mode (bug#60500)
Jostein Kjønigsen [Mon, 2 Jan 2023 19:56:41 +0000 (20:56 +0100)]
Fontification improvements in typescript-ts-mode (bug#60500)

- highlight method-definitins in interfaces.
- only highlight variable-declarations, not variables
  everywhere (consistency with other modes).
- move highlighting of method invocations to level 4

* lisp/progmodes/typescript-ts-mode.el:
(typescript-ts-mode--font-lock-settings): Update rules.
(typescript-ts-mode, tsx-ts-mode): Update feature list.

2 years agoImprove fontification consistency in js-ts-mode (bug#60503)
Jostein Kjønigsen [Mon, 2 Jan 2023 20:26:36 +0000 (21:26 +0100)]
Improve fontification consistency in js-ts-mode (bug#60503)

* lisp/progmodes/js.el (js--treesit-font-lock-settings): Highlight
declared parameters in functions, methods and arrow-expressions as
variables.

2 years ago; Update tree-sitter manual
Yuan Fu [Mon, 2 Jan 2023 22:15:36 +0000 (14:15 -0800)]
; Update tree-sitter manual

* doc/lispref/positions.texi (List Motion): Replace
treesit-defun-prefer-top-level with treesit-defun-tactic.

2 years ago; Fix tree-sitter manual title case
Yuan Fu [Mon, 2 Jan 2023 22:15:05 +0000 (14:15 -0800)]
; Fix tree-sitter manual title case

* doc/lispref/elisp.texi:
* doc/lispref/modes.texi:
* doc/lispref/parsing.texi: Change to title case.

2 years ago; nt/INSTALL: Update for Emacs 29.
Eli Zaretskii [Mon, 2 Jan 2023 18:56:52 +0000 (20:56 +0200)]
; nt/INSTALL: Update for Emacs 29.

2 years ago; Update copyright notice in tramp-sh.el
Michael Albinus [Mon, 2 Jan 2023 18:50:07 +0000 (19:50 +0100)]
; Update copyright notice in tramp-sh.el

* lisp/net/tramp-sh.el (tramp-perl-encode, tramp-perl-decode):
Remove copyright notice, Tramp is copyrighted by FSF anyway.

2 years ago(typescript/tsx-ts-mode): Split font-lock feature list into 4 values
Dmitry Gutov [Mon, 2 Jan 2023 18:42:52 +0000 (20:42 +0200)]
(typescript/tsx-ts-mode): Split font-lock feature list into 4 values

* lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode)
(tsx-ts-mode): Split font-lock feature list into 4 values.

2 years agojs-ts-mode: Move 'string-interpolation' to font-lock level 3
Dmitry Gutov [Mon, 2 Jan 2023 17:59:50 +0000 (19:59 +0200)]
js-ts-mode: Move 'string-interpolation' to font-lock level 3

* lisp/progmodes/js.el (js-ts-mode):
Move 'string-interpolation' to font-lock level 3.