1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-05 11:21:04 -08:00
Commit graph

162448 commits

Author SHA1 Message Date
Juri Linkov
3573ebfa6d * lisp/progmodes/xref.el: Support outline-minor-mode (bug#49731)
(xref--xref-buffer-mode): Set buffer-local variables outline-minor-mode-cycle,
outline-minor-mode-use-buttons, outline-search-function, outline-level
as settings for enabling outline-minor-mode in xref output buffers where
outline headings are xref groups, and their lines can be hidden by
outline commands.
2022-11-23 10:38:28 +02:00
Stefan Kangas
5e8c62ffca ; Fix typos 2022-11-23 05:49:22 +01:00
Yuan Fu
17ed39cc8d
; Remove obsolete use of inhibit-point-motion-hooks
* lisp/treesit.el (treesit-font-lock-fontify-region): Remove it.
2022-11-22 19:57:44 -08:00
Yuan Fu
d2ab1c4a9a
Tweak python-ts-mode fontification (bug#59470)
* lisp/progmodes/python.el (python--treesit-settings): Only fontify
the @ and the identifier of a decorator, not the argument list (if
there is any).
2022-11-22 19:07:27 -08:00
Randy Taylor
0ed3136422
Utilize new font-lock faces for more tree-sitter modes (Bug#59397)
* lisp/progmodes/java-ts-mode.el (java-ts-mode--font-lock-settings):
Use font-lock-number-face.
(java-ts-mode): Alphabetize features.
* lisp/progmodes/js.el (js--treesit-operators): Define operators.
(js--treesit-font-lock-settings): Use bracket, delimiter,
escape-sequence, property, number, and operator font-lock faces.
(js-ts-mode): Add them to the feature list and alphabetize.
* lisp/progmodes/json-ts-mode.el (json-ts-mode--font-lock-settings):
Use bracket, delimiter, escape-sequence, and number faces.  Remove
unused features.
(json-ts-mode): Add them to the feature list and alphabetize.
* lisp/progmodes/sh-script.el (sh-mode--treesit-settings): Use
bracket, delimiter, number, misc-punctuation, and operator font-lock
faces.
(sh-mode--treesit-operators): Remove ; and ;; from list.
(bash-ts-mode): Add them to the feature list and alphabetize.
* lisp/progmodes/ts-mode.el (ts-mode--operators): Define operators.
(ts-mode--font-lock-settings): Use escape-sequence, number, and
operator font-lock faces.
(ts-mode): Add them to the feature list and alphabetize.
2022-11-22 19:07:26 -08:00
Dmitry Gutov
efe599df31 Add a way to override project name for project-vc backend
* lisp/progmodes/project.el (project-vc-name): New user option.
(project-name): Override for VC project backend (bug#48747).
2022-11-23 04:17:06 +02:00
Yuan Fu
c69858b3f0
; * lisp/treesit.el (treesit-ready-p): Guard against empty buffers. 2022-11-22 17:29:26 -08:00
Yuan Fu
057901f55a
Fix treesit-update-ranges
* lisp/treesit.el (treesit--clip-ranges): New function.
(treesit-update-ranges): Now clips the range within (point-min)
and (point-max), so the new range we use are not out-of-range.
2022-11-22 12:38:20 -08:00
Yuan Fu
2fa6ccab01
; Fix treesit--children-covering-range
* lisp/treesit.el (treesit--children-covering-range): Handle the case
when NODE doesn't have children, and when CHILD is nil.
2022-11-22 12:38:14 -08:00
Yuan Fu
95d783f27c
; * src/casefiddle.c (casify_region): Stylistic change. 2022-11-22 12:37:38 -08:00
Stephen Leake
1f39da3098 * lisp/progmodes/eglot.el (eglot--connect): Use project-name
As discussed in bug#48747.
2022-11-22 11:43:22 -08:00
Stephen Leake
361297c6f4 * lisp/progmodes/project.el (project-name): New 2022-11-22 10:55:59 -08:00
Eli Zaretskii
368d2531be Fix 'treesit-max-buffer-size' and its use
* lisp/treesit.el (treesit-max-buffer-size): Avoid overflow in
computing buffer-size limit.  Account for 32-but systems built
"--with-wide-int".  Extend doc string.
(treesit-ready-p): Compare the limit with the size of the buffer
in bytes, not in characters.

* src/treesit.c (treesit_check_buffer_size): Measure buffer size
in bytes.
2022-11-22 20:22:41 +02:00
Eli Zaretskii
fa567684fa ; Fix comparisons in treesit.c
* src/treesit.c (Ftreesit_parser_add_notifier)
(Ftreesit_parser_remove_notifier): Fix comparison with Lisp
objects.  (Bug#59483)
2022-11-22 18:56:08 +02:00
Robert Pluim
4b6e152e34 Add '\lll' for VERY MUCH LESS-THAN to TeX input method
* lisp/leim/quail/latin-ltx.el (latin-ltx--define-rules): Add '\lll'
translation for U+22D8.  (Bug#59476)
2022-11-22 16:44:56 +01:00
Po Lu
350918e7be Adjust x_display_set_last_user_time for Xlib sign-extension
* src/xterm.c (x_display_set_last_user_time): Adjust for Xlib
sign extending fields in client messages to 64 bit long, which
then break x_display_set_last_user_time after 24 days, as Time
is unsigned long for historical reasons.  (bug#59480)
2022-11-22 20:58:07 +08:00
Ihor Radchenko
7c090ebf6b Improve the doc string of 'string-collate-lessp'
* src/fns.c (Fstring_collate_lessp): Clarify that
IGNORE-CASE argument might be ignored when the operating
system does not implement string collation for the
specified locale.  (Bug#59275)
2022-11-22 14:50:35 +02:00
Sam James
110769d039 Fix tree-sitter build using non-bash /bin/sh (bug#59460)
* configure.ac: Don't use '==' in comparisons.

Copyright-paperwork-exempt: yes.
2022-11-22 14:45:09 +02:00
Po Lu
60fac8a5e0 Avoid potentially expensive XFlush and fix ordering
* src/xterm.c (x_raise_frame): Don't call XFlush without a
request being made.
(x_lower_frame): Fix ordering wrt to xwidget view lowering.
2022-11-22 20:04:47 +08:00
Mattias Engdegård
eb02528b70 ; Fix warnings in builds without tree-sitter 2022-11-22 11:06:41 +01:00
Yuan Fu
1161c96cc9
Separate tree-sitter and non-tree-sitter variant of sh-mode
Now there are three modes, sh-base-mode, sh-mode, bash-ts-mode.

The change I made: change sh-mode to sh-base-mode, remove docstring.
Below the new sh-base-mode, create a new definition for sh-mode, paste
the dostring, add setup for font-lock-defaults.  Below sh-mode, add
bash-ts-mode.

* lisp/progmodes/sh-script.el (sh-mode): Moves all setup into
sh-base-mode, except for the setup for font-lock-defaults and the
docstring.
(sh-base-mode): New mode.
(bash-ts-mode): New mode.
2022-11-22 01:06:52 -08:00
Yuan Fu
e494ca4f4d
Fix treesit_record_change in casify_region
This fixes bug#59455.

* src/casefiddle.c: Always record changes.
2022-11-22 01:06:52 -08:00
Theodor Thornhill
d6d4adf3bd
Tweak faces in Java and TypeScript
* lisp/progmodes/java-ts-mode.el (java-ts-mode--operators): Remove @
as an operator.

(java-ts-mode--font-lock-settings): Use constant-face for @ to match
rest of the annotation.  Add bracket, delimiter and use some of the
new faces.

(java-ts-mode--imenu): Clean up the implementation a little.

(java-ts-mode): Refer to the new features.

* lisp/progmodes/ts-mode.el (ts-mode--font-lock-settings, ts-mode):
Add in bracket and delimiter'.
2022-11-22 01:06:51 -08:00
Yuan Fu
6e07838051
treesit-font-lock-recompute-features now has two modes of operation
1. Set activation of each feature (changes every feature)
2. Add/remove features (only change those explicitly configured by
ADD-LIST and REMOVE-LIST)

This is useful for enabling/disabling certain features for all
modes (without resetting others) by calling this function in
prog-mode-hook

* lisp/treesit.el (treesit-font-lock-recompute-features): See above
description.
2022-11-22 01:06:51 -08:00
Yuan Fu
cb60342c01
Tweak c-ts-mode fontification
New features: function and variable, which consistently fontify all
occurrences of functions and variables, respectively.

Remove expression feature, as its purpose is fulfilled by function,
variable, and property combined.

Fix declaration feature, remove unnecessary rule from label
feature.

* lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings): See
above description.
(c-ts-mode--fontify-variable): New function.
(c-ts-mode--base-mode): Add & remove features.
2022-11-22 01:06:51 -08:00
Yuan Fu
c7202e7f4a
; Fix docstrings in treesit.el
* lisp/treesit.el (treesit--explorer--nodes-to-highlight)
(treesit--explorer-draw-node): Fix docstrings.
2022-11-22 01:06:51 -08:00
Yuan Fu
74892eefc8
* lisp/treesit.el (treesit-max-buffer-size): Enlarge value. 2022-11-22 01:06:51 -08:00
Stefan Kangas
b32f50c6d8 Don't refer to deleted variable 'gnus-parameter-to-list-alist'
* doc/misc/gnus.texi (Group Parameters):
* lisp/gnus/message.el (message-recipients-without-full-name):
Don't refer to deleted variable 'gnus-parameter-to-list-alist'.
2022-11-22 08:25:51 +01:00
F. Jason Park
7cfa87ed5b ; Fix ERC test failure following recent typo fix
* test/lisp/erc/erc-scenarios-base-compat-rename-bouncer.el: Replace
expected buffer content in test assertion.
* test/lisp/erc/resources/erc-scenarios-common.el: Replace expected
buffer content in test assertion. See also
40539c7587 "; Fix typos".
2022-11-21 20:53:25 -08:00
Juanma Barranquero
ea73fd69f0 ; Fix typos in tree-sitter files
* admin/notes/tree-sitter/starter-guide (Font-lock)
(Debugging queries, Indent, Navigation, Which-func)
(More features?):
* lisp/treesit.el (treesit--merge-ranges)
(treesit-font-lock-feature-list, treesit-font-lock-rules)
(treesit-font-lock-fontify-region, treesit--font-lock-notifier)
(treesit-simple-indent-presets, treesit--font-lock-fast-mode)
(treesit--indent-region-batch-size)
(treesit--indent-rules-optimize, treesit-ready-p): Fix typos.
2022-11-22 04:40:49 +01:00
Stefan Kangas
19954da8dd Refresh menus in gnus.texi
Fixes problem reported by Po Lu <luangruo@yahoo.com>.
* doc/misc/gnus.texi (Top, Starting Up, Article Treatment)
(The Gnus Diary Library, Searching, nnmairix): Refresh menus.
2022-11-22 02:39:31 +01:00
Stefan Kangas
d901059281 Improve wording and markup in gnus-faq.texi
* doc/misc/gnus-faq.texi (FAQ 2-4): Improve wording and markup.
(FAQ 2-1, FAQ 2-4, FAQ 2-5, FAQ 3 - Getting Messages, FAQ 3-1)
(FAQ 3-2, FAQ 3-2, FAQ 3-4, FAQ 4-1, FAQ 4-2, FAQ 4-3, FAQ 4-4)
(FAQ 4-8, FAQ 4-9, FAQ 4-10, FAQ 4-12, FAQ 5-1, FAQ 5-2)
(FAQ 5-7, FAQ 6-1, FAQ 6-2, FAQ 6-2, FAQ 6-3, FAQ 6-4, FAQ 6-5)
(FAQ 7-2, FAQ 7-3, FAQ 7-3, FAQ 7-4, FAQ 8-1, FAQ 8-5, FAQ 9-1):
Improve markup and reflow some paragraphs.
2022-11-22 02:24:20 +01:00
Stefan Kangas
40539c7587 ; Fix typos 2022-11-22 02:24:20 +01:00
Yuan Fu
aeadba1418
; * lisp/progmodes/js.el (js-ts-mode): Add autoload cookie. 2022-11-21 13:46:52 -08:00
Yuan Fu
3f37f6b435
; * test/src/treesit-tests.el (treesit-misc): Remove test.
This test is for treesit--setting-for-mode, which is removed when we
switched from using treesit-settings to using separate major modes.
2022-11-21 13:34:38 -08:00
Yuan Fu
eb1a35adc1
; Update tree-sitter starter guide
* admin/notes/tree-sitter/starter-guide: Reflect recent changes.
* admin/notes/tree-sitter/html-manual/Using-Parser.html:
* admin/notes/tree-sitter/html-manual/Tree_002dsitter-C-API.html:
* admin/notes/tree-sitter/html-manual/Parsing-Program-Source.html:
* admin/notes/tree-sitter/html-manual/Parser_002dbased-Indentation.html:
* admin/notes/tree-sitter/html-manual/Parser_002dbased-Font-Lock.html:
* admin/notes/tree-sitter/html-manual/Multiple-Languages.html:
* admin/notes/tree-sitter/html-manual/Language-Definitions.html: Update.
2022-11-21 13:33:03 -08:00
Yuan Fu
abf40a41aa
; Fix typo in c-ts-mode--font-lock-settings
* lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings): Fix
typo.
2022-11-21 13:17:16 -08:00
Yuan Fu
aaeaa310f0
Merge remote-tracking branch 'savannah/master' into feature/tree-sitter 2022-11-21 12:54:35 -08:00
Yuan Fu
b2ea38ab03
; Minor fix in c-ts-mode fontification
* lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings): use
override.  Include the outer call_expression.
(c-ts-mode--fontify-defun): Use the override given to it rather than
hard-code.  Add missing space.
2022-11-21 12:50:40 -08:00
Yuan Fu
6cf8bf5042
Allow major modes to tweak tree-sitter fontification
treesit--font-lock-query-expand-range allows a major mode to fix
fontification problems temporarily before the parser can be fixed.

* lisp/treesit.el (treesit--font-lock-query-expand-range): New variable.
(treesit-font-lock-fontify-region): Use the new variable.
* lisp/textmodes/css-mode.el (css-ts-mode): Use the new variable.
2022-11-21 11:26:46 -08:00
Yuan Fu
0cbb7d3bd0
Further tweak tree-sitter fontification heuristics
So it turns out the slowness observed in bug#59415 is not due to the
size, but the strangely tall tree.  Adjust the heuristic to DTRT:
don't enable the heuristic by default or when buffer is large, enable
when query is abnormally slow.  We could do some clever thing that
calibrates a base reading for the query time instead of using a
hard-coded value, but it doesn't seem necessary.

* lisp/treesit.el (treesit--font-lock-fast-mode): New variable.
(treesit-font-lock-fontify-region): Don't activate heuristic by
default (reasons in comments).  Measure the query time and activate
the fast mode if query time is long.
2022-11-21 10:52:55 -08:00
Yuan Fu
aa6958c04e
; * src/treesit.c (treesit_load_language): Move call to eassume.
If handle is ever going to be NULL, it will be when error != NULL, so
we should only eassume handle != NULL after the check for error.
2022-11-21 09:31:14 -08:00
Eli Zaretskii
9f7ae2be60 ; Silence byte-compiler warnings
* lisp/textmodes/css-mode.el:
* lisp/progmodes/python.el:
* lisp/progmodes/json-ts-mode.el:
* lisp/progmodes/js.el:
* lisp/progmodes/java-ts-mode.el:
* lisp/progmodes/c-ts-mode.el: Add declarations of tree-sitter
functions.
2022-11-21 19:08:25 +02:00
Mattias Engdegård
2450973165 ; * test/src/treesit-tests.el (treesit-misc): Don't fail without ts 2022-11-21 16:53:15 +01:00
Eli Zaretskii
27e89ff116 ; * lisp/treesit.el (treesit-parser-add-notifier): Add declaration. 2022-11-21 17:24:42 +02:00
Mattias Engdegård
87c696b7a8 ; Repair build without tree-sitter 2022-11-21 15:41:28 +01:00
Stefan Kangas
f176a36f46 ; Doc fixes: remove references to missing symbols
* lisp/allout.el (allout-process-exposed): Don't refer to missing
value 'flat-indented'.
* lisp/help.el (resize-temp-buffer-window): Don't refer to missing
function 'preserve-window-size'.
* lisp/pcomplete.el (pcomplete-stub): Don't refer to missing
function 'pcomplete-filename'.
2022-11-21 15:20:11 +01:00
Stefan Kangas
beaa2e4953 ; Fix typos (misspelled symbols) 2022-11-21 15:20:11 +01:00
Michael Albinus
61e96789dd Activate direct asynchronous processes for Tramp container methods
* doc/misc/tramp.texi (Remote processes): Mention also
tramp-container.el.

* lisp/emacs-lisp/ert-x.el (ert-remote-temporary-file-directory):
Add `tramp-direct-async' to "mock" method.

* lisp/net/tramp-container.el
(tramp-methods) <docker, podman, kubernetes>: Add `tramp-direct-async'.

* lisp/net/tramp.el (tramp-methods): Adapt docstring.
(tramp-handle-make-process): Handle `tramp-direct-async'.

* test/lisp/net/tramp-tests.el (tramp-methods) <mock>:
Add `tramp-direct-async'.
2022-11-21 14:49:54 +01:00
Gregory Heytings
a3b654e069 Make sed invocation in Makefile POSIX-compliant
* Makefile.in: Add a semicolon before the closing brace, which is
required by POSIX.  Fixes bug#59444.
2022-11-21 13:47:06 +01:00