Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

global-ts-fold-indicators-mode does not work #121

Open
tomoya opened this issue May 28, 2024 · 3 comments
Open

global-ts-fold-indicators-mode does not work #121

tomoya opened this issue May 28, 2024 · 3 comments
Labels
documentation Improvements or additions to documentation question Further information is requested

Comments

@tomoya
Copy link

tomoya commented May 28, 2024

My emacs got an error due to updated ts-fold package a few days ago.

Debugger entered--Lisp error: (error "No language registered for major mode ‘fundamental...")
  error("No language registered for major mode `%s'" fundamental-mode)
  tree-sitter--setup()
  tree-sitter-mode()
  ts-fold-indicators-mode()
  ts-fold-mode(-1)
  ts-fold--tree-sitter-trigger()
  global-ts-fold-mode(1)
  global-ts-fold-indicators-mode(1)
  load-with-code-conversion("/Users/tomoya/.config/emacs/init.el" "/Users/tomoya/.config/emacs/init.el" t t)
  load("/Users/tomoya/.config/emacs/init" noerror nomessage)
  startup--load-user-init-file(#f(compiled-function () #<bytecode 0x80e71dfb90107fa>) #f(compiled-function () #<bytecode 0xe1b30db824d45f1>) t)
  command-line()
  normal-top-level()

This error has occurred (global-ts-fold-indicators-mode 1) configuration.
When I tried changing it to (add-hook 'tree-sitter-after-on-hook #'ts-fold-indicators-mode), the error disappeared.

P.S.
ts-fold is a very nice package for me, Thank you.

@jcs090218
Copy link
Member

global-ts-fold-indicators-mode is probably going to be deprecated. (add-hook 'tree-sitter-after-on-hook #'ts-fold-indicators-mode) is the correct way to configure this package.

@jcs090218 jcs090218 added the question Further information is requested label May 28, 2024
@tomoya
Copy link
Author

tomoya commented Jun 1, 2024

Thanks for your comment.
This documentation seemed to favor (global-ts-fold-indicators-mode 1) for me.
So maybe the documentation needs to be updated?

ts-fold/README.md

Lines 448 to 458 in 6e5e8c0

- To enable this automatically whenever `tree-sitter-mode` is enabled, use the global indicator mode:
```elisp
(global-ts-fold-indicators-mode 1)
```
Else, a hook can be added to tree-sitter directly.
```elisp
(add-hook 'tree-sitter-after-on-hook #'ts-fold-indicators-mode)
```

@jcs090218
Copy link
Member

Yeah, the document will need to be updated.

@jcs090218 jcs090218 added the documentation Improvements or additions to documentation label Jun 1, 2024
nixmaniack added a commit to nixmaniack/spacemacs that referenced this issue Jun 24, 2024
New version of ts-fold breaks in modes in which tree-sitter isn't supported.
Based on
[this](emacs-tree-sitter/ts-fold#121 (comment))
issue and comment, update the ts-fold activation for major mode.
nixmaniack added a commit to nixmaniack/spacemacs that referenced this issue Jun 24, 2024
New version of ts-fold breaks in modes in which tree-sitter isn't supported.
Based on
[this](emacs-tree-sitter/ts-fold#121 (comment))
issue and comment, update the ts-fold activation for major mode.
nixmaniack added a commit to nixmaniack/spacemacs that referenced this issue Jun 24, 2024
New version of ts-fold breaks in modes in which tree-sitter isn't supported.
Based on
[this](emacs-tree-sitter/ts-fold#121 (comment))
issue and comment, update the ts-fold activation for major mode.
nixmaniack added a commit to nixmaniack/spacemacs that referenced this issue Jun 24, 2024
New version of ts-fold breaks in modes in which tree-sitter isn't supported.
Based on
[this](emacs-tree-sitter/ts-fold#121 (comment))
issue and comment, update the ts-fold activation for major mode.
smile13241324 pushed a commit to syl20bnr/spacemacs that referenced this issue Jun 24, 2024
New version of ts-fold breaks in modes in which tree-sitter isn't supported.
Based on
[this](emacs-tree-sitter/ts-fold#121 (comment))
issue and comment, update the ts-fold activation for major mode.
2ynn pushed a commit to 2ynn/spacemacs that referenced this issue Jul 8, 2024
New version of ts-fold breaks in modes in which tree-sitter isn't supported.
Based on
[this](emacs-tree-sitter/ts-fold#121 (comment))
issue and comment, update the ts-fold activation for major mode.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants