diff options
author | Theodor Thornhill <theo@thornhill.no> | 2023-01-21 12:24:55 +0100 |
---|---|---|
committer | Theodor Thornhill <theo@thornhill.no> | 2023-01-21 21:38:27 +0100 |
commit | 6adc193ad66445acd84caba6973424ecbd21da26 (patch) | |
tree | 717e3eda15002a19b07f417283aab53b8100610a /lisp/progmodes/csharp-mode.el | |
parent | 161706ec3312ba329de582b12c32e09a8dfe95e8 (diff) | |
download | emacs-6adc193ad66445acd84caba6973424ecbd21da26.tar.gz emacs-6adc193ad66445acd84caba6973424ecbd21da26.tar.bz2 emacs-6adc193ad66445acd84caba6973424ecbd21da26.zip |
Move c-like common utils into own library (bug#60961)
* lisp/progmodes/c-ts-common.el: New file.
* lisp/progmodes/c-ts-mode.el (treesit-induce-sparse-tree): Remove
unused declaration.
(c-ts-mode--indent-styles): Refer to the new library.
(c-ts-mode--looking-at-star,
c-ts-mode--comment-start-after-first-star,
c-ts-mode--comment-2nd-line-matcher,
c-ts-mode--comment-2nd-line-anchor, c-ts-mode--comment-regexp,
c-ts-mode--fill-paragraph, c-ts-mode--fill-block-comment): Move to
c-ts-common and expose as public.
(c-ts-mode-comment-setup): Move to c-ts-common.
* lisp/progmodes/csharp-mode.el (c-ts-common): Require new library.
(csharp-ts-mode--indent-rules): Refer to the new symbols.
(csharp-ts-mode): Use new function.
* lisp/progmodes/java-ts-mode.el (c-ts-common): Require new library.
(java-ts-mode--indent-rules): Refer to the new symbols.
(java-ts-mode): Use new function.
* lisp/progmodes/js.el (c-ts-common): Require new library.
(js--treesit-indent-rules): Refer to the new symbols.
(js-ts-mode): Use new function.
* lisp/progmodes/rust-ts-mode.el (c-ts-common): Require new library.
(rust-ts-mode--indent-rules): Refer to the new symbols.
(rust-ts-mode): Use new function.
* lisp/progmodes/typescript-ts-mode.el (c-ts-common): Require new
library.
(typescript-ts-mode--indent-rules): Refer to the new symbols.
(typescript-ts-base-mode): Use new function.
Diffstat (limited to 'lisp/progmodes/csharp-mode.el')
-rw-r--r-- | lisp/progmodes/csharp-mode.el | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el index 04f7f222362..852e893dc25 100644 --- a/lisp/progmodes/csharp-mode.el +++ b/lisp/progmodes/csharp-mode.el @@ -34,7 +34,7 @@ (require 'cc-mode) (require 'cc-langs) (require 'treesit) -(require 'c-ts-mode) ; For comment indenting and filling. +(require 'c-ts-common) ; For comment indenting and filling. (eval-when-compile (require 'cc-fonts) @@ -634,8 +634,8 @@ compilation and evaluation time conflicts." ((node-is "}") parent-bol 0) ((node-is ")") parent-bol 0) ((node-is "]") parent-bol 0) - ((and (parent-is "comment") c-ts-mode--looking-at-star) - c-ts-mode--comment-start-after-first-star -1) + ((and (parent-is "comment") c-ts-common-looking-at-star) + c-ts-common-comment-start-after-first-star -1) ((parent-is "comment") prev-adaptive-prefix 0) ((parent-is "namespace_declaration") parent-bol 0) ((parent-is "class_declaration") parent-bol 0) @@ -908,7 +908,7 @@ Key bindings: (treesit-parser-create 'c-sharp) ;; Comments. - (c-ts-mode-comment-setup) + (c-ts-common-comment-setup) ;; Indent. (setq-local treesit-simple-indent-rules csharp-ts-mode--indent-rules) |