1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-08 15:30:40 -08:00
Commit graph

268 commits

Author SHA1 Message Date
Yuan Fu
cec9333dc5
Fix c-ts-mode--top-level-declarator
* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--top-level-declarator): Don't use treesit-node-match-p.
2023-05-20 00:45:39 -07:00
Yuan Fu
f571e8f1bb
Improve c-ts-mode font-lock for function names (bug#63390)
When a function definition has preproc directives in its body, it
can't correctly parse into a function_definition.  This fix tries to
recognize this case and highlight the function_declarator correctly.

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--font-lock-settings): New rule.
(c-ts-mode--top-level-declarator): New function.
2023-05-19 16:11:23 -07:00
Stefan Monnier
e4c8ba6c05 Merge branch 'emacs-29' 2023-05-10 11:18:43 -04:00
Eli Zaretskii
7133784303 Teach c-ts-mode about the 'restrict' keyword
* lisp/progmodes/c-ts-mode.el (c-ts-mode--keywords): Add
"restrict" and "_Atomic" type qualifiers.  (Bug#63323)
2023-05-06 15:15:42 +03:00
Eli Zaretskii
daf602a5c8 Merge from origin/emacs-29
46392c1623 Fix vertical-motion when tab-line is displayed in a window
0e52beeace Update to Org 9.6.5-3-g2993f4
dd21003878 Prevent generating empty autoload files
2bcf11d0ef * lisp/org/org-macs.el (org--inhibit-version-check): Fix ...
ca43435816 Fix redisplay of mode line after its format changes from nil
610a7657e0 Fix c-ts-mode--emacs-c-range-query
7f94558b77 Improve documentation of warnings
5a3f0e2c55 ; Doc fix in c-ts-mode.el
21361d0563 Fix FOR_EACH_TAIL fontification (bug#62951)
d0df3404fd ; * etc/EGLOT-NEWS:  chsharp-le -> csharp-ls
c229e83c3c ; * etc/EGLOT-NEWS (https): Elglot -> Eglot.
b4f2f49978 Fix documentation of libxml-parse-* functions
5dd784961d ; * src/treesit.c (syms_of_treesit): Fix error messages.
ddfa0d8da9 ; Remove some leftover text
2023-05-02 08:50:09 -04:00
Eli Zaretskii
4f44c56c86 Revert "; * lisp/progmodes/c-ts-mode.el: allow loading file without treesit"
This reverts commit 7d246c359c.
The same problem was already fixed on the release branch,and this
change will just cause merge conflicts.
2023-05-02 15:43:51 +03:00
Mattias Engdegård
7d246c359c ; * lisp/progmodes/c-ts-mode.el: allow loading file without treesit 2023-05-01 19:09:47 +02:00
Michael Albinus
610a7657e0 Fix c-ts-mode--emacs-c-range-query
* lisp/progmodes/c-ts-mode.el (c-ts-mode--emacs-c-range-query):
Check for (treesit-available-p).
2023-04-30 12:11:00 +02:00
Eli Zaretskii
5a3f0e2c55 ; Doc fix in c-ts-mode.el
* lisp/progmodes/c-ts-mode.el (c-ts-mode--fontify-for-each-tail):
Doc fix.
2023-04-30 08:21:38 +03:00
Yuan Fu
21361d0563
Fix FOR_EACH_TAIL fontification (bug#62951)
Fix the fontification inconsistency between different FOR_EACH_TAIL's.
See the comment for more explanation.  Also enable the emacs-devel
feature automatically when c-ts-mode-emacs-sources-support is on.

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--for-each-tail-regexp): Move up.
(c-ts-mode--font-lock-settings): New font-lock rule for FOR_EACH_TAIL.
(c-ts-mode--fontify-for-each-tail): New function.
(c-ts-mode): Automatically enable emacs-devel feature.
2023-04-29 15:51:09 -07:00
Eli Zaretskii
e155df7da7 Merge from origin/emacs-29
212e30f678 ; Fix byte-compilation warnings in c-ts-mode.el
1f2214dabd Skip over whitespace in annotation-top-cont check (bug#63...
7e136c51f6 Update zh-CN tutorial translation
d3ca0b3aa2 ; * lisp/progmodes/c-ts-mode.el: Fix comments and doc str...
c6f15c2486 ; Fix last change.
b9e06330f7 ; * etc/NEWS: Followup to bug#62720.
b33d25f596 ; Minor improvements in doc strings of package-upgrade co...
c3a61870b9 Fix eglot.texi

# Conflicts:
#	etc/NEWS
2023-04-28 12:14:26 -04:00
Eli Zaretskii
212e30f678 ; Fix byte-compilation warnings in c-ts-mode.el
* lisp/progmodes/c-ts-mode.el (treesit-parser-set-included-ranges)
(treesit-query-compile): Declare treesit.c functions.
(treesit-load-name-override-list): Defvar it.
2023-04-28 12:01:19 -04:00
Eli Zaretskii
d3ca0b3aa2 ; * lisp/progmodes/c-ts-mode.el: Fix comments and doc strings (bug#62951). 2023-04-28 08:40:56 +03:00
Po Lu
a97c382682 Merge from origin/emacs-29
a40f181623 Fix two crashes upon startup
44ebd9cbd5 Eglot: explain how to update Eglot in manual (bug#62720)
941ef044f2 Eglot: fix edge case when deleting inlay hint overlays
a365984d9e package-upgrade[-all]: Expand docstrings to note the curr...
f965f35b33 Rename all functions called package-*-update-* to package...
31b58161bb Fix FOR_EACH_TAIL in c-ts-mode (bug#62951)
0cf6e0998b * Makefile.in (distclean): Remove the 'native-lisp' direc...
933705d61e Improve greek-ibycus4 input method

# Conflicts:
#	etc/NEWS
2023-04-28 11:51:01 +08:00
Yuan Fu
31b58161bb
Fix FOR_EACH_TAIL in c-ts-mode (bug#62951)
* lisp/progmodes/c-ts-mode.el
(c-ts-mode--indent-styles): New indent rule.

(c-ts-mode--for-each-tail-regexp)
(c-ts-mode--for-each-tail-body-matcher)
(c-ts-mode--emacs-c-range-query)
(c-ts-mode--for-each-tail-ranges)
(c-ts-mode--reverse-ranges)
(c-ts-mode--emacs-set-ranges): New functions and variables.

(c-ts-mode): Create a emacs-c parser.  More setup for Emacs source
support.

* lisp/treesit.el (treesit-query-range): Ignore underscore-prefixed
capture names.
2023-04-27 12:50:16 -07:00
Eli Zaretskii
2f013c46f7 Merge from origin/emacs-29
44145bf07e Add indentation style setting for c-ts-mode in .dir-local...
e7db6c59cc ; * .dir-locals.el (c-ts-mode): Add settings.
d041f01b02 ; Minor fix in Emacs Lisp Intro manual
2023-04-22 04:56:57 -04:00
Eli Zaretskii
44145bf07e Add indentation style setting for c-ts-mode in .dir-locals.el
* lisp/progmodes/c-ts-mode.el (c-ts-indent-style-safep): New
predicate.
(c-ts-mode-indent-style): Use it to test the value for being safe.

* .dir-locals.el (c-ts-mode): Set 'c-ts-mode-indent-style' to 'gnu'.
2023-04-22 09:41:50 +03:00
Eli Zaretskii
f1ce49d148 Merge from origin/emacs-29
3899acbb33 ; * src/fringe.c: Fix description of large circle.  (Bug#...
2b10e1827d sql: add missing postgresql types
9ac1259278 Fix display of menu-bar bindings of commands in *Help* bu...
ecdd3a9efa Improve Completion Example section in the Emacs manual
626e1ac62b Improve 'message-server-alist' docstring
327986936c Add index entry for fallback modes
1c4783c330 ; * etc/NEWS: Copyedits and grammar fixes.
3d6f755331 xref-search-program-alist: Fix searching larger file list...
1b8b2cf61b Fix typo and inaccuracy in the ELisp Reference manual
df17682ebf ; Support 'dart-ts-mode' in Eglot
e0dc60e078 ; Fix typos in gdb-mi.el
60560cc7ad Fix description of lexical environment's internals
1456adf424 ; Eglot: fix a typo in a customization type
2f59595f5f ; * etc/NEWS: Grammar fixes.
596b780ab7 Update to Org 9.6.4-2-g0f6ae7
a0b04a2247 Documentation copyedits for 'package-install-upgrade-buil...
580d8278c5 Allow upgrading built-in packages with 'package-install'
329304c23f ; * src/term.c (init_tty): Fix last change.  (Bug#62877)
200dbf7d30 Minor changes in c-ts-mode.el's support of DEFUNs
9686b015a0 Fix strike-through attribute support on TTY frames
39035fbfc5 Avoid crashes in 'describe-keymap' due to shadowing

# Conflicts:
#	etc/NEWS
#	lisp/progmodes/c-ts-mode.el
#	lisp/progmodes/eglot.el
2023-04-21 07:29:14 -04:00
Eli Zaretskii
200dbf7d30 Minor changes in c-ts-mode.el's support of DEFUNs
* lisp/progmodes/c-ts-mode.el (c-ts-mode--fontify-DEFUN): Renamed
from 'c-ts-mode--fontify-defun'; all callers changed.
(c-ts-mode-emacs-sources-support): Renamed from
'c-ts-mode-emacs-devel' and made into a defcustom; all users
changed.
(c-ts-mode--emacs-defun-p, c-ts-mode--emacs-defun-at-point)
(c-ts-mode--emacs-current-defun-name): Doc fixes.  (Bug#62825)
2023-04-16 11:12:39 +03:00
Eli Zaretskii
bc61a1afdd Merge from origin/emacs-29
b7023da662 Make image-map bindings available on image links
d9e96c029b * CONTRIBUTE: Fix a typo
3f71a2a0cf ; * lisp/progmodes/c-ts-mode.el (treesit-node-next-siblin...
adf9c956c2 Add to Eglot support for additional language-servers.
b3603b84bd Partial support for DEFUN in c-ts-mode (bug#62825)

# Conflicts:
#	lisp/progmodes/c-ts-mode.el
2023-04-15 13:05:04 -04:00
Eli Zaretskii
7191318b71 Merge from origin/emacs-29
864a4dc236 Fix compilation of w32.c with old MinGW system headers
a22eb9ae0f ruby-add-log-current-method: Reduce the use of 'nreverse'
17d803d0a7 Fix detection of WebP images by their signature
43290391ce ; Eglot: make version parseable by version-to-list
6e6e8b5c97 Add more documentation for the keys of `package-vc-select...
7972b76c2c ; vc-checkout: Wrap var lookup in 'bound-and-true-p'
e9fef1d70f vc-checkout: Try to use the vc-dir's backend first
372e024acc ; Fix wallpaper-tests on XFCE
7055fd8e43 Improve documentation related to 'ispell-complete-word'
61fd017abd * configure.ac: Add -lbsd on Haiku.
05971c4d9a Add menu to 'c-ts-mode' and 'c++-ts-mode'

# Conflicts:
#	lisp/progmodes/eglot.el
#	lisp/progmodes/ruby-mode.el
2023-04-15 13:02:04 -04:00
Eli Zaretskii
79b5d1022f Merge from origin/emacs-29
db8f207e52 Fix some cases of incomplete code's indentation [c/c++-ts...
589959fb09 project-search: Pipe the list of files through 'file-regu...
2023-04-15 12:43:40 -04:00
Eli Zaretskii
3f71a2a0cf ; * lisp/progmodes/c-ts-mode.el (treesit-node-next-sibling): Declare. 2023-04-15 13:12:20 +03:00
Yuan Fu
b3603b84bd
Partial support for DEFUN in c-ts-mode (bug#62825)
The DEFUN is hard to incorporate because it's made of two nodes rather
than one, and most tree-sitter functionalities assume a defun is one
node.  I fixed the indent-defun and add-log functionality, but
beginning/end-of-defun and imenu still don't recognize DEFUN.

* lisp/progmodes/c-ts-mode.el (c-ts-mode-emacs-devel): New variable.
(c-ts-mode--defun-name): Support DEFUN.
(c-ts-mode--defun-valid-p): Support DEFUN.
(c-ts-mode--emacs-defun-p)
(c-ts-mode--emacs-defun-at-point): New functions.
(c-ts-mode-indent-defun): Use c-ts-mode--emacs-defun-at-point.
(c-ts-mode--emacs-current-defun-name): New function.
(c-ts-mode, c++-ts-mode): Optionally setup custom defun-name function.
2023-04-14 13:09:05 -07:00
Yuan Fu
1a5a03c15a
Define sexp in c-ts-mode more broadly (bug#62302)
* lisp/progmodes/c-ts-mode.el: Define sexp in c/c++-ts-mode as
anything but delimiters.
2023-04-12 00:02:21 -07:00
Eli Zaretskii
05971c4d9a Add menu to 'c-ts-mode' and 'c++-ts-mode'
* lisp/progmodes/c-ts-mode.el (c-ts-mode-menu): New menu.
2023-04-11 13:37:25 +03:00
Dmitry Gutov
db8f207e52 Fix some cases of incomplete code's indentation [c/c++-ts-mode]
* lisp/progmodes/c-ts-mode.el (c-ts-base--before-indent): Try to
guess when the parse tree is incomplete, and provide a better node
to indent against (bug#62717).
(c-ts-base-mode): Set up advice for local treesit-indent-function.
2023-04-10 02:58:46 +03:00
Eli Zaretskii
2d1a96e878 Merge from origin/emacs-29
305246d972 Add emoji-zoom-reset
470d269ec1 Make emoji-zoom-{increase,decrease} set text properties c...
63d4a86f8d Fix transforming sliced images
5e1953a8f8 ; * etc/NEWS: Minor copyedits of entry for 'keymap-*' fun...
6b9f9df945 ; Improve documentation of 'declare-function'
81d1f46d0f ; Avoid compiler warning in eglot.el.
38cdfcb212 ; Fix description of new 'keymap-*' functions
257090b872 Adapt EMBA scripts.
90c07d3fdd Another terminology fix in ELisp reference manual
a832bc7090 Correct terminology in Elisp Reference Manual
db308233cb Comment out GNUSTEP jobs on EMBA (again)
8c1b102243 ; * lisp/image.el (put-image): Doc fix.
eda88c63ad ; * doc/emacs/trouble.texi (Checklist): Minor grammar fix.
728bc09cf3 Fix regexp string escaping mistake in vhdl-mode.el (bug#6...
479626dbac Update to Org 9.6.3-2-gf2949d
5a1c9aace7 ; Add a bit more docstring to tsx-ts-mode (bug#62429)
86cf9fd932 Eglot: don't watch directories that don't exist
82d0b6c64e ; * lisp/subr.el (use-dialog-box-p): Fix last change.
3619663f98 Preserve peer information for web page in eww-readable
cb8d6ab648 * lisp/subr.el (use-dialog-box-p): Fix conditions for GUI...
fb2c440920 ; * lisp/progmodes/c-ts-mode.el (c++-ts-mode): Add some n...

# Conflicts:
#	etc/NEWS
2023-04-06 14:38:20 -04:00
Yuan Fu
fb2c440920
; * lisp/progmodes/c-ts-mode.el (c++-ts-mode): Add some notice. 2023-04-01 23:14:45 -07:00
Mattias Engdegård
0724c6dbda Use string-search instead of string-match[-p] when possible
* lisp/progmodes/c-ts-mode.el
(c-ts-mode--standalone-parent-skip-preproc):
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--align-chain):
* lisp/treesit.el (treesit-max-buffer-size)
(treesit--check-manual-coverage):
Use the much faster string-search when just searching for a substring.
2023-03-26 12:09:41 +02:00
Stefan Kangas
90dca0a533 Merge from origin/emacs-29
6de00e4df9 ; Fix xref-match's :version since the default value did c...
db355b420b Use libgccjit-10-dev on EMBA
8496395653 * lisp/outline.el (outline--fix-buttons-after-change): Ad...
3d3bbaace6 Align concatenated strings to the first sibling in c-ts-mode
f856468e45 Only fill the current paragraph in c-ts-common--fill-bloc...
df669c5a11 Add missing indent rule for c-ts-mode
2023-03-23 06:30:13 +01:00
Yuan Fu
3d3bbaace6
Align concatenated strings to the first sibling in c-ts-mode
* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): Change rule.
2023-03-21 23:27:20 -07:00
Yuan Fu
df669c5a11
Add missing indent rule for c-ts-mode
* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): New rule for case.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: New test.
2023-03-21 16:24:29 -07:00
Stefan Kangas
42fba8f36b Merge from origin/emacs-29
b7f0333355 Improve warning about changing the string returned by sym...
e62f8b0239 Fix visiting XBM/XPM files when 'c-ts-mode' is active
94d1c81cf0 * lisp/mpc.el (mpc-format): Fix oversight in commit 48b6c...
a4d97811ed Bail early from eglot--apply-text-edits if nothing to do
61d571760b ; Clarify in-code commentary of eglot--after-change
5bbbd70f56 Improve ergonomics of Eglot's inlay hints
c3a543123a Protect against too large size of 'recent-keys' vector
231190b37f * lisp/net/tramp.el (tramp-yn-prompt-regexp): Fix regexp.
0bebd0e5f0 ; Remove 'build-module' and 'html-manual' directories fro...
6674c362ad Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/...
829e5dfabe Update to Org 9.6.1-48-g92471e
e84f878e19 ; * admin/notes/tree-sitter/starter-guide: Update starter...
ea0949853f Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/...
11592bcfda ; * lisp/nxml/xmltok.el (xmltok-scan-attributes): Fix las...
e388a77cf0 ; Minor copyedits of recent changes in ELisp reference ma...
33a2670368 ; Minor fixes in recent Eglot changes
d2cf1386fa ; * doc/misc/eglot.texi (Eglot Commands): Improve indexing.
b75e489362 ; Again correct node reference casing in doc/misc/eglot.texi
a55d2edc5a ; Remove overly verbose commentary
22a70451f3 Merge confusing duplicate sections on commands in Eglot m...
3293f93988 Don't take over mouse-1 binding on Eglot diagnostics (bug...
013057e351 ; Prefer "language server" to "LSP server" in Eglot manual
94a21c8864 * lisp/progmodes/eglot.el (eglot--connect): Improve Tramp...
0eddfa28eb Avoid slowdowns in xmltok-scan-attributes
647c6bf2a6 ; * test/lisp/abbrev-tests.el (abbrev--possibly-save-test...
531f8f7103 ; * admin/git-bisect-start: Update failing commits

# Conflicts:
#	admin/notes/tree-sitter/build-module/batch.sh
#	admin/notes/tree-sitter/build-module/build.sh
2023-03-20 06:30:40 +01:00
Eli Zaretskii
e62f8b0239 Fix visiting XBM/XPM files when 'c-ts-mode' is active
* lisp/progmodes/c-ts-mode.el (treesit-ready-p): Fix association
for XBM/XPM files in 'auto-mode-alist'.  (Bug#62276)
2023-03-19 22:19:52 +02:00
João Távora
a55aaf9eaf Merge from origin/emacs-29
4b6f2a7028 * lisp/progmodes/xref.el: Bump the version.
24c8b146bb * lisp/progmodes/xref.el (xref--xref-buffer-mode): Split ...
46f9e53c3d Fix import of keys in buffer created by epa-search-keys
36ade0704e Fix connection-local variables settings
e759905d2e ; Minor copyedits in EGLOT-NEWS
ba22a2c346 Bump Eglot version to 1.12
54e123a505 Update Eglot's manual about eglot-workspace-configuration
812597f864 ; * lisp/novice.el (disabled-command-function): Add note ...
4a603c9849 Amend last Eglot commit (bug#62065)
b916ec88b2 Make eglot-ensure's post-command-hook run a bit later (bu...
1c05175c21 Fix display of disabled-command help text
3ce37db988 Remove mention of old dotted-list reader quirk from manual
42335c2c1f Fix value history shown for 'gc-cons-percentage'
fffbce2934 TRework fix for bug#62106
8bc12a2736 ; * etc/NEWS: Fix last change.
2ac068d294 ; Remove 'ns-popup-font-panel' from documentation
5bc32d008f Add missing indentation rule for rust-ts-mode (Bug#62109)
0404924930 ; One more improvement to ELisp "internals" appendix.
c857775ca6 Fix bug#62106
0fedbfa6a9 ; Minor improvement of documentation of GC thresholds
b0b24ad2fc Add missing rust-ts-mode highlight query for scoped_type_...
c0cf69f7a1 Make "case" keyword a dedenter in Python
db178517ce ; * lisp/arc-mode.el (w32-get-console-codepage): Declare.
157a91b54b Fix decoding non-ASCII file names in zip archives on MS-W...
4803f97204 Fix copying binary files from zip archives
679f528b95 Skip ruby-ts-syntax-propertize-symbol unless treesitter i...
081cc7aa8e ; * doc/misc/eglot.texi (Project-specific configuration):...
1de513a29f Fix enums and unions appearing as structs in c-ts-base-mo...
ecdfd584a5 ruby-ts-mode: Fine-tune s-p-f on symbols (bug#62086)
29228e24f2 python-info-dedenter-opening-block-positions: Fix to supp...
01b65d442a Autoload Eglot helper funtion eglot--debbugs-or-github-bu...
50a3559c5a Add chapter on advanced server configuration to Eglot manual
2e7460c231 ; * lisp/progmodes/java-ts-mode.el (treesit-query-capture...
255eeee0e0 java-ts-mode: detect if text_block is supported.
6fe9075ff3 Revert workaround introduced in Bug#56271
f175141aea Fix searching for end of string in python-nav-end-of-stat...

# Conflicts:
#	etc/NEWS
2023-03-14 18:14:48 +00:00
Randy Taylor
1de513a29f
Fix enums and unions appearing as structs in c-ts-base-mode's imenu
* lisp/progmodes/c-ts-mode.el (c-ts-base-mode): Separate enums and unions out
from structs.
2023-03-09 21:58:55 -08:00
Stefan Kangas
5ff018524c Merge from origin/emacs-29
f9b7913656 Fix empty line indentation in c-ts-mode (bug#61997)
90504f9d89 Fix tree-sitter indent preset prev-line (bug#61998)
ed3bab3cc7 Revert 'forward-sentence-default-function' to return poin...
bfe62b1041 ; * etc/NEWS: Fix typos.
3c1693d08b Fix Elisp code injection vulnerability in emacsclient-mai...
ab417c8a6e Fix problem with debuginfod queries in "M-x gdb"

# Conflicts:
#	etc/NEWS
2023-03-08 06:30:18 +01:00
Yuan Fu
f9b7913656
Fix empty line indentation in c-ts-mode (bug#61997)
* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--indent-styles): Handle the empty line case.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: New test.

* doc/lispref/modes.texi (Parser-based Indentation): Update manual.
* lisp/treesit.el (treesit-simple-indent-presets): Support null as
a value for NODE-TYPE in the 'match' matcher.
2023-03-07 16:42:44 -08:00
Stefan Kangas
aad617870b Merge from origin/emacs-29
1c67e4f895 Fix c-ts-mode indentation
d724d7d678 Fix c-ts-mode indentation
7292b24c80 Fix c-ts-mode indentation
75cdc1afbe ; Change font-lock-variable-name-face to font-lock-variab...
b1b3af5b90 Update to Org 9.6.1-40-g3d817c
80e1037df4 Add string-interpolation feature to bash-ts-mode
5b8e0b3154 Fix tramp-sh-handle-insert-directory
2258ed01f4 ; Minor fix of last change
9c18af0cfa * Warn when certain primitives are redefined (bug#61880)
5af695c747 ; * lib-src/etags.c (print_help): Fix indentation.
2023-03-06 06:30:13 +01:00
Yuan Fu
1c67e4f895
Fix c-ts-mode indentation
Mentioned in bug#61893.

* lisp/progmodes/c-ts-mode.el (c-ts-mode--anchor-prev-sibling): Handle
"#elif" and "#else".
* test/lisp/progmodes/c-ts-mode-resources/indent-preproc.erts: Add an
"#elif" to the test.
2023-03-05 15:22:36 -08:00
Yuan Fu
d724d7d678
Fix c-ts-mode indentation
Mentioned in bug#61893, although not the subject of it.

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--anchor-prev-sibling): Fix the child index for preproc_else
and preproc_elif case.
* test/lisp/progmodes/c-ts-mode-resources/indent-preproc.erts:
New test.
2023-03-05 15:07:58 -08:00
Yuan Fu
7292b24c80
Fix c-ts-mode indentation
Not the subject of it, but mentioned in bug#61893.

* lisp/progmodes/c-ts-mode.el (c-ts-mode--anchor-prev-sibling): Skip
the sibling if it doesn't start on it's own line.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: New test.
2023-03-05 15:01:54 -08:00
Stefan Kangas
6fb8a4dff7 Merge from origin/emacs-29
836044f329 Fix c-ts-mode preproc directive indentation
64980a59b6 ; * lisp/files.el (hack-local-variables): Fix typo in the...
a7cd125d49 More robustly unspoof HOME in Eglot tests (bug#61637)
6c66dbd02c Turn on Eglot inlay hints by default
246f5b541c Update ts modes missed in 4c16fd3a51 to use column-0
0bfba49ca7 Robustify Eglot for "transient" projects
ea5fd375bb Fix documentation of 'normal-mode' in buffers that don't ...
4c16fd3a51 Change tree-sitter indent anchor 'point-min' to 'column-0'
f47b393015 Fix go-ts-mode multi-line string indentation (bug#61923)
e0bf2da3db ; More accurate doc strings for 'window-at' and 'window-a...
2023-03-05 06:30:15 +01:00
Yuan Fu
836044f329
Fix c-ts-mode preproc directive indentation
Mentioned in bug#61893, although not the subject of that report.  This
change fixes indentation for nested directives.  For example, when the
directive involves elif and the like, the elif is nested in the if
directive, so simply using grand-parent and great-grand-parent for
anchor is insufficient, because the nesting can grow arbitrarily.

The test added also covers the last preproc fix.

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--standalone-parent-skip-preproc): New function.
(c-ts-mode--indent-styles): New rules.
* test/lisp/progmodes/c-ts-mode-resources/indent-preproc.erts: New test.
2023-03-04 15:03:12 -08:00
Yuan Fu
4c16fd3a51
Change tree-sitter indent anchor 'point-min' to 'column-0'
Point-min isn't necessarily at column 0, using line-beginning-position
is better. column-0 is also more intuitive.

* doc/lispref/modes.texi (Parser-based Indentation): Update manual.
* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles):
* lisp/progmodes/java-ts-mode.el (java-ts-mode--indent-rules):
* lisp/progmodes/rust-ts-mode.el (rust-ts-mode--indent-rules):
* lisp/progmodes/typescript-ts-mode.el:
(typescript-ts-mode--indent-rules): Change point-min to column-0.
* lisp/treesit.el (treesit-simple-indent-presets): Change point-min to
column-0.
2023-03-04 01:20:02 -08:00
Stefan Kangas
841614c722 Merge from origin/emacs-29
9e105d483f Fix c-ts-mode indentation for statement after preproc (bu...
a72a55e3e4 Fix c/c++-ts-mode's mode lighter
67befc1f5a Eglot: use shell-file-name in eglot--cmd (bug#61748)
1c7b2673bd Avoid signaling errors in url-basic-auth when password is...
756225e377 Fix wdired-tests on MS-Windows
a137f71c67 Improvements to xwidget on macOS (bug#60703)
3f43a16bc6 ; Avoid byte-compilation warning in c-ts-mode.el
2023-03-03 06:30:12 +01:00
Yuan Fu
9e105d483f
Fix c-ts-mode indentation for statement after preproc (bug#61893)
Originally our c-ts-mode--anchor-prev-sibling only specially handled
labeled_statements, now we add special case for preproc in the similar
fasion: instead of using the preproc directive as anchor, use the last
statement in that preproc as the anchor. Thus effectively ignore the
preproc.

There should be an accompanying test, but there are some problem in
the elif preproc directive indent so it would pass, we'll add the test
when that is fixed.

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--anchor-prev-sibling): Add special case for preproc
directives.
2023-03-02 19:59:37 -08:00
Eli Zaretskii
a72a55e3e4 Fix c/c++-ts-mode's mode lighter
* lisp/progmodes/c-ts-mode.el (c-ts-mode-set-modeline): Remove
trailing blank from comment-start when indicating the comment
style on the mode line.
2023-03-02 21:34:22 +02:00
Eli Zaretskii
3f43a16bc6 ; Avoid byte-compilation warning in c-ts-mode.el
* lisp/progmodes/c-ts-mode.el (treesit-node-first-child-for-pos):
Declare.
2023-03-02 09:33:04 +02:00