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

Remove autoload might break the straight-use-package-mode #527

Closed
ccqpein opened this issue Mar 5, 2024 · 6 comments
Closed

Remove autoload might break the straight-use-package-mode #527

ccqpein opened this issue Mar 5, 2024 · 6 comments

Comments

@ccqpein
Copy link
Contributor

ccqpein commented Mar 5, 2024

I found the latest rust-mode cannot load successfully by my use-package (turned on the straight.el use-package integrated).

After some investigating, I found the PR #526 remove the ;;;###autoload of rust-mode. It causes straight-use-package cannot find the rust-mode function. (I guess it doesn't load the rust-mode.el when it initing?)

After more playing around, there are several behaviors were revealed.

  1. if I (load "~/.emacs.d/straight/repos/rust-mode/rust-mode.el") in *scratch* buffer. I can call M-x rust-mode. But M-x straight-use-package cannot find the rust-mode
  2. if I (autoload 'rust-mode "rust-mode" nil t) in *scratch* buffer. It does the same thing as 1..
  3. If I load rust-mode.el in use-package :init step. It works fine. Furthermore, if I (setq rust-mode-treesitter-derive t) before in :init before loading, it will in treesitter mode as master branch code is designed to do.

I haven't raised up the solution of this issue. I guess it is the autoload is necessary for straight.el. I am going to report this to them.

@ccqpein
Copy link
Contributor Author

ccqpein commented Mar 5, 2024

Also raised the question to straight.el repo. link

@jroimartin
Copy link
Contributor

Related: #528

@condy0919
Copy link
Contributor

condy0919 commented Mar 7, 2024

;; in rust-mode.el ...

;;;###autoload
(autoload 'rust-mode "rust-mode.el" nil t)

It will generate an (autoload 'rust-mode "rust-mode.el" nil t) in rust-mode-autoloads.el, but it looks like odd as of an autoload is autoloaded.

@psibi
Copy link
Member

psibi commented Mar 12, 2024

@ccqpein Can you check if this PR by @jroimartin fixes it for you: #530 ?

@ccqpein
Copy link
Contributor Author

ccqpein commented Mar 12, 2024

@psibi I just try and it fixes the rust-mode. Now my rust file can load the rust-mode (from rust-prog-mode.el). However, the straight-use-package still cannot find the rust-mode by M-x straight-use-package.

I might find sometime to study how the straight.el handle straight-use-package

@ccqpein
Copy link
Contributor Author

ccqpein commented Mar 14, 2024

Figure out it works. Thanks for @jroimartin 's PR

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

4 participants