Defining as dynamic an already lexical var: ts-fold-indicators-mode
getong opened this issue · comments
eval-buffer: Defining as dynamic an already lexical var: ts-fold-indicators-mode
I just run ts-fold-close-all
, just occur this error.
What method you use to install package? I can't reproduce this. 🤔
(unless (package-installed-p 'vc-use-package)
(package-vc-install "https://github.com/slotThe/vc-use-package"))
(require 'vc-use-package)
(use-package tree-sitter
:ensure t
:defer t
:disabled t
:preface
(setq tsc-dyn-get-from '(:compilation))
:init
(defadvice tsc-dyn-get--download (around tsc-dont-download (&rest arg)))
)
(use-package tree-sitter-langs
:ensure t
;; :after tree-sitter
:defer t
:disabled t
)
(use-package ts-fold
:vc (:fetcher github :repo "emacs-tree-sitter/ts-fold")
:config
(add-to-list 'ts-fold-range-alist
'(tsx-ts-mode
(export_clause . ts-fold-range-seq)
(statement_block . ts-fold-range-seq)
(comment . ts-fold-range-c-like-comment)))
(add-to-list 'ts-fold-summary-parsers-alist
'(tsx-ts-mode . ts-fold-summary-javadoc)))
tree-sitter-langs, tree-sitter is from melpa, the ts-fold is from github source code.
I run emacs-plus@29 in osx, and have treesit package enabled.
Can you try post the backtrace here as well? I appreciate it!
eval-buffer: Defining as dynamic an already lexical var: ts-fold-indicators-mode
And the error doesn't make sense to me, why eval-buffer
? 🤔
Debugger entered--Lisp error: (error "Defining as dynamic an already lexical var" ts-fold-indicators-mode)
(defvar ts-fold-indicators-mode nil "Non-nil if Ts-Fold-Indicators mode is enabled.\nUse...")
eval-buffer(#<buffer *load*> nil "/Users/gerald/.emacs.d/elpa/ts-fold/ts-fold-indica..." nil t) ; Reading at buffer position 4310
load-with-code-conversion("/Users/gerald/.emacs.d/elpa/ts-fold/ts-fold-indica..." "/Users/gerald/.emacs.d/elpa/ts-fold/ts-fold-indica..." nil t)
(ts-fold-indicators-refresh)
ts-fold--after-command(#<user-ptr ptr=0x600003a10b40 finalizer=0x1580f9bd0>)
apply(ts-fold--after-command #<user-ptr ptr=0x600003a10b40 finalizer=0x1580f9bd0>)
ts-fold-close(#<user-ptr ptr=0x600003a10b40 finalizer=0x1580f9bd0>)
mapc(ts-fold-close (#<user-ptr ptr=0x600003a10b40 finalizer=0x1580f9bd0> #<user-ptr ptr=0x600003a116e0 finalizer=0x1580f9bd0> #<user-ptr ptr=0x600003a11710 finalizer=0x1580f9bd0> #<user-ptr ptr=0x600003a117a0 finalizer=0x1580f9bd0> #<user-ptr ptr=0x600003a11530 finalizer=0x1580f9bd0> #<user-ptr ptr=0x600003a11740 finalizer=0x1580f9bd0> #<user-ptr ptr=0x600003a118c0 finalizer=0x1580f9bd0> #<user-ptr ptr=0x600003a117d0 finalizer=0x1580f9bd0> #<user-ptr ptr=0x600003a10e40 finalizer=0x1580f9bd0> #<user-ptr ptr=0x600003a10e10 finalizer=0x1580f9bd0> #<user-ptr ptr=0x600003a11620 finalizer=0x1580f9bd0> #<user-ptr ptr=0x600003a11890 finalizer=0x1580f9bd0> #<user-ptr ptr=0x600003a11950 finalizer=0x1580f9bd0> #<user-ptr ptr=0x600003a119e0 finalizer=0x1580f9bd0> #<user-ptr ptr=0x600003a11860 finalizer=0x1580f9bd0> #<user-ptr ptr=0x600003a11680 finalizer=0x1580f9bd0> #<user-ptr ptr=0x600003a12760 finalizer=0x1580f9bd0> #<user-ptr ptr=0x600003a119b0 finalizer=0x1580f9bd0> #<user-ptr ptr=0x600003a11a40 finalizer=0x1580f9bd0> #<user-ptr ptr=0x600003a11b00 finalizer=0x1580f9bd0> #<user-ptr ptr=0x600003a11a70 finalizer=0x1580f9bd0> #<user-ptr ptr=0x600003a11aa0 finalizer=0x1580f9bd0> #<user-ptr ptr=0x600003a11ad0 finalizer=0x1580f9bd0> #<user-ptr ptr=0x600003a11b60 finalizer=0x1580f9bd0> #<user-ptr ptr=0x600003a11b90 finalizer=0x1580f9bd0> #<user-ptr ptr=0x600003a11bc0 finalizer=0x1580f9bd0> #<user-ptr ptr=0x600003a11bf0 finalizer=0x1580f9bd0>))
(let* ((ts-fold-indicators-mode) (node (tsc-root-node tree-sitter-tree)) (patterns (seq-mapcat #'(lambda (fold-range) (cons (list ...) '...)) (alist-get major-mode ts-fold-range-alist) 'vector)) (query (tsc-make-query tree-sitter-language patterns)) (nodes-to-fold (tsc-query-captures query node #'ignore))) (mapc #'ts-fold-close (mapcar #'cdr nodes-to-fold)))
(progn (let* ((ts-fold-indicators-mode) (node (tsc-root-node tree-sitter-tree)) (patterns (seq-mapcat #'(lambda (fold-range) (cons ... ...)) (alist-get major-mode ts-fold-range-alist) 'vector)) (query (tsc-make-query tree-sitter-language patterns)) (nodes-to-fold (tsc-query-captures query node #'ignore))) (mapc #'ts-fold-close (mapcar #'cdr nodes-to-fold))))
(if (and (boundp 'tree-sitter-mode) tree-sitter-mode) (progn (let* ((ts-fold-indicators-mode) (node (tsc-root-node tree-sitter-tree)) (patterns (seq-mapcat #'(lambda ... ...) (alist-get major-mode ts-fold-range-alist) 'vector)) (query (tsc-make-query tree-sitter-language patterns)) (nodes-to-fold (tsc-query-captures query node #'ignore))) (mapc #'ts-fold-close (mapcar #'cdr nodes-to-fold)))) (user-error "Ignored, tree-sitter-mode is not enabled in the cu..."))
(closure (t) nil "Fold all foldable syntax nodes in the buffer." (interactive) (if (and (boundp 'tree-sitter-mode) tree-sitter-mode) (progn (let* ((ts-fold-indicators-mode) (node (tsc-root-node tree-sitter-tree)) (patterns (seq-mapcat #'... (alist-get major-mode ts-fold-range-alist) 'vector)) (query (tsc-make-query tree-sitter-language patterns)) (nodes-to-fold (tsc-query-captures query node #'ignore))) (mapc #'ts-fold-close (mapcar #'cdr nodes-to-fold)))) (user-error "Ignored, tree-sitter-mode is not enabled in the cu...")))()
apply((closure (t) nil "Fold all foldable syntax nodes in the buffer." (interactive) (if (and (boundp 'tree-sitter-mode) tree-sitter-mode) (progn (let* ((ts-fold-indicators-mode) (node (tsc-root-node tree-sitter-tree)) (patterns (seq-mapcat ... ... ...)) (query (tsc-make-query tree-sitter-language patterns)) (nodes-to-fold (tsc-query-captures query node ...))) (mapc #'ts-fold-close (mapcar #'cdr nodes-to-fold)))) (user-error "Ignored, tree-sitter-mode is not enabled in the cu..."))) nil)
ts-fold-close-all()
funcall-interactively(ts-fold-close-all)
call-interactively(ts-fold-close-all record nil)
command-execute(ts-fold-close-all record)
execute-extended-command(nil "ts-fold-close-all" nil)
funcall-interactively(execute-extended-command nil "ts-fold-close-all" nil)
call-interactively(execute-extended-command nil nil)
command-execute(execute-extended-command)
Should fix in 5fd2a5a. Can you try the latest version? Thanks!
It works. Thanks.