Closed jcs090218 closed 10 months ago
any update?
That is intentional. The treemacs-extensions module is obsolete and should no longer be used, its replacement is the treemacs-treelib module. It was still being loaded by treemacs itself, but that is a bug that has been fixed now.
The new api has unfortunately been different enough to require a hard break. On the other hand it's a lot easier to maintain and debug for me, and supports new features like asynchronous extensions.
If you're working with extensions I suggest looking at new new tutorial. If you have extensions that are now broken for your users you can tell them to treemacs use v2.11 which is the very last commit before the api rewrite.
Sorry about having to bother you with this whole migration, but the previous extensions api internals were all built on many, many macros which made it awful to debug problems or add new features like async support. The new system has been coming for a long time.
Hi, i get following error after update to 984099b
Symbol's function definition is void: treemacs-define-expandable-node
I don't know if i use any extensions, but, i guess not.
after (require 'treemacs-extensions)
, it works now, but i get same error message when i start emacs daemon as before.
Eager macro-expansion failure: (wrong-number-of-arguments ((cl-struct-treemacs-extension-tags t) (extension &rest --cl-rest--) "Initialise an external buffer for use with the given EXTENSION.
EXTENSION is the same symbol that was passed as a `:key' argument
to `treemacs-define-variadic-entry-node-type'.
WITH-EXPAND-DEPTH indicates the number of nodes that should be expanded *in
addition* to the default. If a value is given that is not a number then
treemacs will assume that *all* possible nodes should be expanded.
AND-DO can be used to set up buffer-local variables after the buffer has
switched over to `treemacs-mode'.
(fn EXTENSION &key (WITH-EXPAND-DEPTH 0) AND-DO)" (let* ((with-expand-depth (car (cdr (or (plist-member --cl-rest-- ':with-expand-depth) '(nil 0))))) (and-do (car (cdr (plist-member --cl-rest-- ':and-do))))) (progn (let ((--cl-keys-- --cl-rest--)) (while --cl-keys-- (cond ((memq (car --cl-keys--) '(:with-expand-depth :and-do :allow-other-keys)) (setq --cl-keys-- (cdr (cdr --cl-keys--)))) ((car (cdr (memq ':allow-other-keys --cl-rest--))) (setq --cl-keys-- nil)) (t (error "Keyword argument %s not one of (:with-expand-depth :and-do)" (car --cl-keys--)))))) (cons 'progn (cons '(treemacs--disable-fringe-indicator) (cons '(treemacs-with-writable-buffer (erase-buffer)) (cons '(let ((treemacs-fringe-indicator-mode nil) (treemacs--in-this-buffer t)) (treemacs-mode)) (cons '(setq-local treemacs-space-between-root-nodes nil) (cons '(setq-local treemacs--in-this-buffer :extension) (cons and-do (cons (list 'treemacs--render-extension (cons 'let (cons (list (list 'instance (list 'treemacs--ext-symbol-to-instance (list 'quote extension)))) (cons (list 'treemacs-static-assert '(and instance (treemacs-extension->variadic\? instance)) "%s is not a variadic extension" extension) '(instance)))) (cons 'if (cons (list 'numberp with-expand-depth) (cons with-expand-depth '(999))))) '((goto-char 1) (treemacs--evade-image))))))))))))) 0)
after (require 'treemacs-extensions), it works now
You shouldn't do that, that module is obsolete and will break things in newer treemacs versions if loaded.
By default no extension module should be loaded now, neither the old one, nor the new one. If you are still seeing extension related errors it's because some other package in your config - like lsp-treemacs - is loading them. You need to find that package and update it to a version that supports the new extension api. If there is no such version you need to stick with treemacs v2.11.
Eager macro-expansion failure: (wrong-number-of-arguments ((cl-struct-treemacs-extension-tags t) (extension &rest --cl-rest--) "Initialise an external buffer for use with the given EXTENSION.
This error looks like an issue with a small api change made in https://github.com/Alexander-Miller/treemacs/commit/20765acd38e00faa46a72b9a2cf63a7b451c6850, so a fix should be pretty easy.
By default no extension module should be loaded now, neither the old one, nor the new one. If you are still seeing extension related errors it's because some other package in your config - like lsp-treemacs - is loading them. You need to find that package and update it to a version that supports the new extension api. If there is no such version you need to stick with treemacs v2.11.
Okay, i guess it caused by dap-mode, after i remove (require 'treemacs-extensions)
, get following error.
Symbol's function definition is void: treemacs-define-expandable-node
I disable the loading of dap-mode, all works no any error.
@jcs090218 , do you consider fix this issue for dap-mode side?
treemacs-define-expandable-node
That is also a macro from the old module.
This issue has been automatically marked as stale because it has not had recent activity.
https://github.com/Alexander-Miller/treemacs/blob/861418d9d11b205930bd4555a40b430b9dde9dd4/src/elisp/treemacs-extensions.el#L540
and
https://github.com/Alexander-Miller/treemacs/blob/20765acd38e00faa46a72b9a2cf63a7b451c6850/src/elisp/treemacs-treelib.el#L1021
There is one macro and one function with the exact same name. Emacs is confused and reporting similar error,
Related issue: https://github.com/emacs-lsp/lsp-metals/issues/81