[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/treesit-fold f2650076af 382/417: fix: Clean compile warngi
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/treesit-fold f2650076af 382/417: fix: Clean compile warngins |
Date: |
Mon, 1 Jul 2024 10:03:08 -0400 (EDT) |
branch: elpa/treesit-fold
commit f2650076af2b5b25b3a431fd8c99c77813782a1d
Author: JenChieh <jcs090218@gmail.com>
Commit: JenChieh <jcs090218@gmail.com>
fix: Clean compile warngins
---
treesit-fold-summary.el | 60 +++++++++++++++++++++++++------------------------
treesit-fold-util.el | 2 ++
2 files changed, 33 insertions(+), 29 deletions(-)
diff --git a/treesit-fold-summary.el b/treesit-fold-summary.el
index 618e7c5f3d..6168d190f0 100644
--- a/treesit-fold-summary.el
+++ b/treesit-fold-summary.el
@@ -27,6 +27,8 @@
(require 's)
+(require 'treesit-fold-util)
+
(defcustom treesit-fold-summary-show t
"Flag to show summary if available."
:type 'boolean
@@ -194,35 +196,6 @@ type of content by checking the word boundary's existence."
;; (@* "Core" )
;;
-(defun treesit-fold-summary--keep-length (summary)
- "Keep the SUMMARY length to `treesit-fold-summary-max-length'."
- (let ((len-sum (length summary))
- (len-exc (length treesit-fold-summary-exceeded-string)))
- (when (< treesit-fold-summary-max-length len-sum)
- (setq summary (substring summary 0 (- treesit-fold-summary-max-length
len-exc))
- summary (concat summary treesit-fold-summary-exceeded-string))))
- summary)
-
-(defun treesit-fold-summary--apply-format (summary)
- "Return the SUMMARY that has added the summary prefix."
- (format treesit-fold-summary-format summary))
-
-(defun treesit-fold-summary--parser ()
- "Return the summary parser from `treesit-fold-summary-parsers-alist'."
- (assoc (buffer-local-value 'major-mode (current-buffer))
treesit-fold-summary-parsers-alist))
-
-(defun treesit-fold-summary--get (doc-str)
- "Extract summary from DOC-STR in order to display ontop of the overlay."
- (let ((parser (cdr (treesit-fold-summary--parser))) summary)
- (when parser
- (setq summary (funcall parser doc-str))
- (when (integerp treesit-fold-summary-max-length)
- (setq summary (treesit-fold-summary--keep-length summary)))
- (when summary
- (setq summary (treesit-fold-summary--apply-format summary)
- summary (propertize summary 'face
'treesit-fold-replacement-face))))
- summary))
-
;; TODO(everyone): keep this alist alphabetically sorted
(defcustom treesit-fold-summary-parsers-alist
`((actionscript-mode . treesit-fold-summary-javadoc)
@@ -313,5 +286,34 @@ type of content by checking the word boundary's existence."
:type '(alist :key-type symbol :value-type function)
:group 'treesit-fold)
+(defun treesit-fold-summary--keep-length (summary)
+ "Keep the SUMMARY length to `treesit-fold-summary-max-length'."
+ (let ((len-sum (length summary))
+ (len-exc (length treesit-fold-summary-exceeded-string)))
+ (when (< treesit-fold-summary-max-length len-sum)
+ (setq summary (substring summary 0 (- treesit-fold-summary-max-length
len-exc))
+ summary (concat summary treesit-fold-summary-exceeded-string))))
+ summary)
+
+(defun treesit-fold-summary--apply-format (summary)
+ "Return the SUMMARY that has added the summary prefix."
+ (format treesit-fold-summary-format summary))
+
+(defun treesit-fold-summary--parser ()
+ "Return the summary parser from `treesit-fold-summary-parsers-alist'."
+ (assoc (buffer-local-value 'major-mode (current-buffer))
treesit-fold-summary-parsers-alist))
+
+(defun treesit-fold-summary--get (doc-str)
+ "Extract summary from DOC-STR in order to display ontop of the overlay."
+ (let ((parser (cdr (treesit-fold-summary--parser))) summary)
+ (when parser
+ (setq summary (funcall parser doc-str))
+ (when (integerp treesit-fold-summary-max-length)
+ (setq summary (treesit-fold-summary--keep-length summary)))
+ (when summary
+ (setq summary (treesit-fold-summary--apply-format summary)
+ summary (propertize summary 'face
'treesit-fold-replacement-face))))
+ summary))
+
(provide 'treesit-fold-summary)
;;; treesit-fold-summary.el ends here
diff --git a/treesit-fold-util.el b/treesit-fold-util.el
index 8b47cab845..e9a772b3aa 100644
--- a/treesit-fold-util.el
+++ b/treesit-fold-util.el
@@ -25,6 +25,8 @@
;;; Code:
+(require 'tsc)
+
;;
;; (@* "Redisplay" )
;;
- [nongnu] elpa/treesit-fold 21bba126be 321/417: fix: Ensure refresh when window size changes, (continued)
- [nongnu] elpa/treesit-fold 21bba126be 321/417: fix: Ensure refresh when window size changes, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 665e3f074c 376/417: feat: Support new LaTeX-mode, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 947fbec8b5 350/417: reordered the alists for alphabetical ordering, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold ab81fe718e 389/417: feat(json): Fold comment, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 22ffb18db6 303/417: feat: Add Pascal support (#85), ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold aafc4c0a5f 373/417: Changelog, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 47c58282f7 335/417: Release, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 9cbc292502 394/417: fix: Use handle dependent, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold c7a9d62e4c 363/417: feat: Add Ninja support, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 2236641e53 397/417: chore: changelog, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold f2650076af 382/417: fix: Clean compile warngins,
ELPA Syncer <=
- [nongnu] elpa/treesit-fold 882c4faae8 271/417: fix(parsers): update nix definitions (#37), ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold bb5bd2e31e 276/417: feat: Add Clojure support (#64), ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold dcf6fdcb85 292/417: Bump version for next version, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold b52b33357e 300/417: feat: Add Erlang support (#83), ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold cd7963038f 318/417: feat: Add Fish support (#96), ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 8972eb674e 391/417: feat: Fully support isearch and modification conditions (#1), ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 3dd7c477fb 305/417: feat: Add CMake support (#86), ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 250567abd2 345/417: Register qss-mode with CSS, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 648f75ef06 342/417: fix(indicators): Add option for rendering method, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold db35c17409 331/417: lint, ELPA Syncer, 2024/07/01