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

Failed to define function python-ts-mode #851

Open
Gako358 opened this issue Dec 17, 2024 · 7 comments
Open

Failed to define function python-ts-mode #851

Gako358 opened this issue Dec 17, 2024 · 7 comments

Comments

@Gako358
Copy link

Gako358 commented Dec 17, 2024

Getting an error when using evil-collection with python:

File mode specification error: (error Autoloading file /nix/store/4dxx3kdl76zqf6a42flvf3wi89sfj927-emacs-packages-deps/share/emacs/site-lisp/elpa/evil-collection-20241011.2043/modes/python/evil-collection-python.elc failed to define function python-ts-mode)

If I turn off collection, it works, and with all other LSP, I got no problem.
Is this a known issue?

My config:

  (use-package treesit
    :ensure nil
    :custom
    (treesit-font-lock-level 4)
    :config
    (seq-do (lambda (it)
              (push it major-mode-remap-alist))
              '((javascript-mode . js-ts-mode)
              (python-mode . python-ts-mode)
              (typescript-mode . typescript-ts-mode)
              (java-mode . java-ts-mode)
              (css-mode . css-ts-mode)
              (sh-mode . bash-ts-mode)
              (scala-mode . scala-ts-mode)
              (nix-mode . nix-ts-mode)
              (shell-script-mode . bash-ts-mode))))

  (use-package eglot-booster
    :after eglot
    :config	(eglot-booster-mode))

  (with-eval-after-load 'eglot
    (add-to-list 'eglot-server-programs
                 '(scala-ts-mode . ("metals"))))

  (use-package scala-ts-mode
    :init
    (setq scala-ts-indent-offset 2))

  (use-package haskell-mode)
  (use-package markdown-mode)
  (use-package nix-ts-mode
    :mode "\\.nix\\'"
    :hook (nix-ts-mode . eglot-ensure))

  (use-package python
    :after eglot
    :hook (python-ts-mode . eglot-ensure)
    :mode "\\.py\\'")
@condy0919
Copy link
Collaborator

It seems like the autoload file of evil-collection doesn't provide the definition of python-ts-mode. How do you turn on evil-collection-mode. My setup:

(use-package evil-collection
  :ensure t
  :hook (evil-mode . evil-collection-init)
  :bind (([remap evil-show-marks] . evil-collection-consult-mark)
         ([remap evil-show-jumps] . evil-collection-consult-jump-list))
  :config
  ;; Make `evil-collection-consult-mark' and `evil-collection-consult-jump-list'
  ;; immediately available.
  (evil-collection-require 'consult)
  :custom
  (evil-collection-setup-debugger-keys nil)
  (evil-collection-calendar-want-org-bindings t)
  (evil-collection-unimpaired-want-repeat-mode-integration t))

@Gako358
Copy link
Author

Gako358 commented Dec 17, 2024

I tried with your way of turning on evil-collection, but still getting the same error.
If you try with a python file, does it work?

@jojojames
Copy link
Collaborator

Your emacs version...

@Gako358
Copy link
Author

Gako358 commented Dec 17, 2024

GNU Emacs 30.0.92

@jojojames
Copy link
Collaborator

I loaded up a python file in 29 & 31 and it works for me. I don't use the ts mode stuff though.

@Gako358
Copy link
Author

Gako358 commented Dec 18, 2024

so just normal python-mode?

@jojojames
Copy link
Collaborator

Yes.

Can you produce a reproducible -Q recipe?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants