[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/treesit-fold fbb5510d5c 290/417: feat: Add LaTex support (
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/treesit-fold fbb5510d5c 290/417: feat: Add LaTex support (#76) |
Date: |
Mon, 1 Jul 2024 10:02:36 -0400 (EDT) |
branch: elpa/treesit-fold
commit fbb5510d5c46b9463c5f3844f2d35cab619a8115
Author: Jen-Chieh Shen <jcs090218@gmail.com>
Commit: GitHub <noreply@github.com>
feat: Add LaTex support (#76)
---
CHANGELOG.md | 1 +
README.md | 7 +------
ts-fold-parsers.el | 7 +++++++
ts-fold-summary.el | 6 ++++++
ts-fold.el | 1 +
5 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5177103cc6..510c5f11e1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -34,6 +34,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for
recommendations on how
* Add Scheme support (#73)
* Add Beancount support (#74)
* Add Verilog support (#75)
+* Add LaTex support (#76)
## 0.1.0
> Released Oct 18, 2021
diff --git a/README.md b/README.md
index 276af85532..07ed19f153 100644
--- a/README.md
+++ b/README.md
@@ -19,11 +19,6 @@ to provide code folding based on the tree-sitter syntax tree.
<!-- markdown-toc start - Don't edit this section. Run M-x
markdown-toc-refresh-toc -->
-<!---
-your comment goes here
-and here
--->
-
**Table of Contents**
- [💾 Installation](#-installation)
@@ -125,7 +120,7 @@ These languages are fairly complete:
- Haskell / HTML
- Jai / Java / JavaScript / JSX / JSON / Julia
- Kotlin
-- Lua
+- LaTex / Lua
- Markdown
- Nix
- Perl / PHP / Python
diff --git a/ts-fold-parsers.el b/ts-fold-parsers.el
index 1ffe47acd7..a2c0c78a91 100644
--- a/ts-fold-parsers.el
+++ b/ts-fold-parsers.el
@@ -258,6 +258,13 @@
(multiline_comment . ts-fold-range-c-like-comment)
(line_comment . ts-fold-range-c-like-comment)))
+(defun ts-fold-parsers-latex ()
+ "Rule set for LaTex."
+ '((curly_group . ts-fold-range-seq)
+ (line_comment
+ . (lambda (node offset)
+ (ts-fold-range-line-comment node offset "%")))))
+
(defun ts-fold-parsers-lua ()
"Rule set for Lua."
'((expression_list . ts-fold-range-seq)
diff --git a/ts-fold-summary.el b/ts-fold-summary.el
index 0f3d47768d..caa6f70614 100644
--- a/ts-fold-summary.el
+++ b/ts-fold-summary.el
@@ -140,6 +140,10 @@ type of content by checking the word boundary's existence."
"Extract summary from DOC-STR in Rust."
(ts-fold-summary--generic doc-str "///"))
+(defun ts-fold-summary-tex-doc (doc-str)
+ "Extract summary from DOC-STR in Tex family."
+ (ts-fold-summary--generic doc-str "%"))
+
(defun ts-fold-summary-c-macro (doc-str)
"Parse C macro summary from DOC-STR."
(when (ts-fold--is-face doc-str
@@ -213,6 +217,7 @@ type of content by checking the word boundary's existence."
(css-mode . ts-fold-summary-javadoc)
(dart-mode . ts-fold-summary-javadoc)
(emacs-lisp-mode . ts-fold-summary-elisp)
+ (elixir-mode . ts-fold-summary-ruby-doc)
(gdscript-mode . ts-fold-summary-ruby-doc)
(go-mode . ts-fold-summary-go)
(haskell-mode . ts-fold-summary-lua-doc)
@@ -225,6 +230,7 @@ type of content by checking the word boundary's existence."
(js3-mode . ts-fold-summary-javadoc)
(julia-mode . ts-fold-summary-julia-doc)
(kotlin-mode . ts-fold-summary-javadoc)
+ (latex-mode . ts-fold-summary-tex-doc)
(lua-mode . ts-fold-summary-lua-doc)
(markdown-mode . ts-fold-summary-markdown)
(objc-mode . ts-fold-summary-c)
diff --git a/ts-fold.el b/ts-fold.el
index dea42f5f17..ed93a90e8e 100644
--- a/ts-fold.el
+++ b/ts-fold.el
@@ -85,6 +85,7 @@
(jsonc-mode . ,(ts-fold-parsers-json))
(julia-mode . ,(ts-fold-parsers-julia))
(kotlin-mode . ,(ts-fold-parsers-kotlin))
+ (latex-mode . ,(ts-fold-parsers-latex))
(lua-mode . ,(ts-fold-parsers-lua))
(markdown-mode . ,(ts-fold-parsers-markdown))
(nix-mode . ,(ts-fold-parsers-nix))
- [nongnu] elpa/treesit-fold 9b25eeeb0b 404/417: chore: Update mouse face docstring, (continued)
- [nongnu] elpa/treesit-fold 9b25eeeb0b 404/417: chore: Update mouse face docstring, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 6b759ca36e 402/417: Update README.org (#4), ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold a9d4c2ec53 296/417: feat: Add XML support (#80), ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 5c45efb2d5 316/417: Update CHANGELOG.md, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold abb1c53bd4 336/417: Bump version for next release, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 544390c602 329/417: fix: Fold line comment with same indentation, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 7fdaf447cc 245/417: Change global mode to turn on with tree-sitter (#41), ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 07fe2d17f4 249/417: feature: Add minor-mode for line comment (#45), ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 458903e88d 250/417: fix: Fix nil tree-sitter-node, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 6ada31e372 251/417: changelog, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold fbb5510d5c 290/417: feat: Add LaTex support (#76),
ELPA Syncer <=
- [nongnu] elpa/treesit-fold 81dc9eff92 283/417: Update CHANGELOG.md, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold f8df121f08 270/417: ci(dependabot): Maintain github-actions, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold a474fd6b42 285/417: feat: Add Jai support (#71), ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 27e8f44fb6 269/417: test: Emacs 29.1, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 7110ff8943 287/417: feat: Add Scheme support (#73), ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 999f295bf4 282/417: fix: Don't fold lint comment when only 1 line (#69), ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold befad113c9 390/417: feat: Return node when closing, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 9d18dee909 354/417: Added a matlab parser for folding., ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold bfdba4f0a8 339/417: fix PR id, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 56c19e3b2d 351/417: chore: Update changelog and README regarding dev, ELPA Syncer, 2024/07/01