[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/typst-ts-mode 42c080fa64 122/246: fix(compabiilty): Emacs2
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/typst-ts-mode 42c080fa64 122/246: fix(compabiilty): Emacs29 treesit-lparser-list -> typst-ts-utils-parser-list |
Date: |
Fri, 14 Feb 2025 16:54:35 -0500 (EST) |
branch: elpa/typst-ts-mode
commit 42c080fa64eb8223c42302b00f0f53e53dfdc6fa
Author: Meow King <mr.meowking@anche.no>
Commit: Meow King <mr.meowking@anche.no>
fix(compabiilty): Emacs29 treesit-lparser-list -> typst-ts-utils-parser-list
---
typst-ts-embedding-lang-settings.el | 6 +++---
typst-ts-mode.el | 2 +-
typst-ts-utils.el | 15 +++++++++++++++
3 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/typst-ts-embedding-lang-settings.el
b/typst-ts-embedding-lang-settings.el
index d73ccc98c7..dcba2183e6 100644
--- a/typst-ts-embedding-lang-settings.el
+++ b/typst-ts-embedding-lang-settings.el
@@ -773,7 +773,7 @@ Use this function as one notifier of
`treesit-parser-notifiers'."
;; parsers created by `treesit-language-at-point-function' (
;; `typst-ts-mode--language-at-point'.)
;; i.e. parsers cannot be created by `treesit-range-settings'
- (mapcar #'treesit-parser-language (treesit-parser-list))
+ (mapcar #'treesit-parser-language (typst-ts-utils-parser-list))
;; parsers created by `treesit-range-settings'
(mapcar #'treesit-parser-language
(typst-ts-utils-local-parsers-on (point-min)
(point-max))))))
@@ -789,7 +789,7 @@ Use this function as one notifier of
`treesit-parser-notifiers'."
(typst-ts-els-merge-lang-settings lang)
;; some feature like cmake-ts-mode will create a parser when
;; the feature is required, so we need to clean thease
parsers
- (mapc #'treesit-parser-delete (treesit-parser-list nil lang))
+ (mapc #'treesit-parser-delete (typst-ts-utils-parser-list
nil lang))
(message "Load %s language settings from configuration."
lang))
(error
;; if language not in setting or encounter error during loading,
@@ -801,7 +801,7 @@ Use this function as one notifier of
`treesit-parser-notifiers'."
(typst-ts-els--add-treesit-range-rules lang)
;; delete top level parsers, so range rules works (i.e.
local parsers)
;; so that highlighting will not exceed the desired
range
- (mapc #'treesit-parser-delete (treesit-parser-list nil
lang))
+ (mapc #'treesit-parser-delete
(typst-ts-utils-parser-list nil lang))
;; find and merge settings
(setq lang-ts-mode
diff --git a/typst-ts-mode.el b/typst-ts-mode.el
index 113458ed36..feae32afc2 100644
--- a/typst-ts-mode.el
+++ b/typst-ts-mode.el
@@ -1143,7 +1143,7 @@ typst tree sitter grammar (at least %s)!"
(current-time-string min-time))
(typst-ts-els-merge-settings config)
;; some feature like cmake-ts-mode will create a parser when
;; the feature is required, so we need to clean thease parsers
- (mapc #'treesit-parser-delete (treesit-parser-list nil lang))
+ (mapc #'treesit-parser-delete (typst-ts-utils-parser-list nil
lang))
(add-to-list 'typst-ts-els--include-languages lang))))
(typst-ts-mode-check-grammar-version))
diff --git a/typst-ts-utils.el b/typst-ts-utils.el
index b817742974..aa6311ba1a 100644
--- a/typst-ts-utils.el
+++ b/typst-ts-utils.el
@@ -23,6 +23,21 @@
(require 'treesit)
+(defun typst-ts-utils-parser-list (&optional buffer language)
+ "An comptibility function for Emacs 29's `treesit-parser-list' function.
+BUFFER defaults to the current buffer. If that buffer is an indirect
+buffer, its base buffer is used instead. That is, indirect buffers
+use their base buffer's parsers.
+
+If LANGUAGE is non-nil, only return parsers for that language. "
+ (if (>= emacs-major-version 30)
+ (funcall #'treesit-parser-list buffer language)
+ (let ((parsers (treesit-parser-list buffer)))
+ (seq-filter
+ (lambda (parser)
+ (eq (treesit-parser-language parser) language))
+ parsers))))
+
;; code is from treesit.el inside Emacs Source
(defun typst-ts-utils-local-parsers-at (&optional pos language with-host)
"Return all the local parsers at POS.
- [nongnu] elpa/typst-ts-mode 271cedb1de 066/246: feat: add customization option to enable raw block highlighting, (continued)
- [nongnu] elpa/typst-ts-mode 271cedb1de 066/246: feat: add customization option to enable raw block highlighting, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode fded764913 069/246: fix(els): remove language tag map duplication, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode d6cd6d7283 076/246: feat: Also auto insert numbered list., ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode 49a3981040 083/246: fix: Only search for the current line., ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode 0454e44977 087/246: feat: Autoincrement on enter and fix heading insertion., ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode 078b2efbb9 089/246: fix: disable echoing indentation debug information, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode 3d373bba6f 095/246: fix: fix outline recognization error when section indent offset is not nil, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode 2d25a0ac3f 097/246: refactor: `typst-ts-mode-insert--item`, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode 893430dc14 100/246: merge `develop` branch, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode d8d36ba3e9 110/246: doc: update README.md, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode 42c080fa64 122/246: fix(compabiilty): Emacs29 treesit-lparser-list -> typst-ts-utils-parser-list,
ELPA Syncer <=
- [nongnu] elpa/typst-ts-mode dc45e44e38 153/246: doc: update README, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode d614af3433 163/246: fix: don't add lsp configuration by default to respect user's custom configuration, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode 6b54ff7084 175/246: refactor: remove `typst-ts-mode--item-on-line-p` function, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode e2309a468c 191/246: fix: typst-ts-mode-cycle, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode eb988ca372 187/246: fix: multiline item indentation issue, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode 78e6ec9921 207/246: fix: #15 heading inserting should still work, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode 322b52e3cd 209/246: fix: typst-ts-mode-return delete new added line, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode b1deb2d667 214/246: feat: #16 code for reordering list items, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode 619acd01e2 220/246: Merge branch 'feat-16/list-item-reordering' into develop, ELPA Syncer, 2025/02/14
- [nongnu] elpa/typst-ts-mode a451dcaa67 223/246: chore, ELPA Syncer, 2025/02/14