[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/indent-bars c40d858b83 1/4: rename indent-bars-ts-mode
From: |
ELPA Syncer |
Subject: |
[elpa] externals/indent-bars c40d858b83 1/4: rename indent-bars-ts-mode to indent-bars--ts-mode |
Date: |
Wed, 18 Sep 2024 15:58:24 -0400 (EDT) |
branch: externals/indent-bars
commit c40d858b83517f36b80e1916e0560fdd80fb20e4
Author: JD Smith <93749+jdtsmith@users.noreply.github.com>
Commit: JD Smith <93749+jdtsmith@users.noreply.github.com>
rename indent-bars-ts-mode to indent-bars--ts-mode
Avoids confusion about which mode to call in hooks.
---
indent-bars-ts.el | 17 +++++++++--------
indent-bars.el | 4 ++--
2 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/indent-bars-ts.el b/indent-bars-ts.el
index 90e02e8bcd..d25e93fabd 100644
--- a/indent-bars-ts.el
+++ b/indent-bars-ts.el
@@ -379,7 +379,7 @@ separate track of regions where bars are pending, and where
font-lock is pending."
(put-text-property jit-lock-start jit-lock-end
'indent-bars-font-lock-pending t))
-(defvar indent-bars-ts-mode)
+(defvar indent-bars--ts-mode)
(defun indent-bars-ts--context-fontify (fun)
"Wrap FUN to keep track of context fontification.
Added as `:around' advice to `jit-lock-context-unfontify-pos'.
@@ -388,16 +388,17 @@ invalidated text."
(let (orig)
(dolist (buffer (buffer-list))
(with-current-buffer buffer
- (when (and indent-bars-ts-mode jit-lock-context-unfontify-pos)
+ (when (and indent-bars--ts-mode jit-lock-context-unfontify-pos)
(setf (alist-get buffer orig) jit-lock-context-unfontify-pos))))
(funcall fun)
(dolist (buffer (buffer-list))
(with-current-buffer buffer
- (when (and indent-bars-ts-mode jit-lock-context-unfontify-pos
+ (when (and indent-bars--ts-mode jit-lock-context-unfontify-pos
(assq buffer orig)
(> jit-lock-context-unfontify-pos (alist-get buffer orig)))
(with-silent-modifications
- (put-text-property (alist-get buffer orig)
jit-lock-context-unfontify-pos
+ (put-text-property (alist-get buffer orig)
+ jit-lock-context-unfontify-pos
'indent-bars-font-lock-pending t)))))))
(defun indent-bars-ts--font-lock-inhibit (beg end)
@@ -510,20 +511,20 @@ To be set in `indent-bars--teardown-functions'."
#'indent-bars-ts--mark-change t))
;;;###autoload
-(define-minor-mode indent-bars-ts-mode
+(define-minor-mode indent-bars--ts-mode
"Minor mode for indent-bars using treesitter."
:group 'indent-bars-ts
- (if indent-bars-ts-mode
+ (if indent-bars--ts-mode
(if-let (((fboundp #'treesit-available-p))
((treesit-available-p))
(lang (treesit-language-at (point-min))))
(indent-bars-ts--setup lang)
- (setq indent-bars-ts-mode nil))
+ (setq indent-bars--ts-mode nil))
(indent-bars-ts--teardown)))
(defun indent-bars-ts--custom-update-scope ()
"Update the TS scope for custom setting."
- (when indent-bars-ts-mode
+ (when indent-bars--ts-mode
(indent-bars-ts--update-scope1 (current-buffer))))
(add-hook 'indent-bars-custom-set #'indent-bars-ts--custom-update-scope)
diff --git a/indent-bars.el b/indent-bars.el
index e48738ea6f..0658746196 100644
--- a/indent-bars.el
+++ b/indent-bars.el
@@ -1592,7 +1592,7 @@ Adapted from `highlight-indentation-mode'."
,@(if indent-bars-display-on-blank-lines
'((group (* (or ?\s ?\t ?\n)) ?\n))))))))
-(declare-function indent-bars-ts-mode "indent-bars-ts")
+(declare-function indent-bars--ts-mode "indent-bars-ts")
(defun indent-bars-setup ()
"Setup all face, color, bar size, and indentation info for the current
buffer."
;; Spacing
@@ -1618,7 +1618,7 @@ Adapted from `highlight-indentation-mode'."
(or indent-bars-no-descend-string indent-bars-no-descend-lists))
;; Treesitter
- (if indent-bars-treesit-support (indent-bars-ts-mode 1)) ; autoloads
+ (if indent-bars-treesit-support (indent-bars--ts-mode 1)) ; autoloads
;; Remap/Resize
(unless indent-bars--no-stipple