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

cannot autoload julia-snail #75

Closed
nesteiner opened this issue Jan 29, 2022 · 19 comments
Closed

cannot autoload julia-snail #75

nesteiner opened this issue Jan 29, 2022 · 19 comments
Labels
bug Something isn't working

Comments

@nesteiner
Copy link

maybe is the problem of my program ability on emacs-lisp, when I type this code, julia-snail can't autoload when loading a julia file

(use-package julia-mode
  :config
  (setq julia-repl-switches nil
	julia-snail-extra-args nil
	julia-indent-offset 2)
  :commands julia-snail-mode)


(use-package julia-snail
  :ensure t
  :after julia-mode
  :requires vterm
  :hook (julia-mode-hook . julia-snail-mode)
  :config
  (setq-default julia-snail-extra-args "--sysimage /home/steiner/.julia-images/julia-dev.so"))

I remember that it was ok, after i use byte compile emacs-lisp file, it does not work since then

@gcv
Copy link
Owner

gcv commented Jan 29, 2022

How large is the julia-snail.elc byte-compiled file? Sometimes the byte compiler does not compile the whole file. If it’s only a few hundred bytes, delete it, make sure vterm is fully loaded (M-x vterm), and recompile julia-snail.el.

@nesteiner
Copy link
Author

still not work,
2022-01-30 21-14-02 的屏幕截图
does that work on your system ?

@gcv
Copy link
Owner

gcv commented Jan 30, 2022

Is init-julia.el the file with your use-package forms? Please post the size of your julia-snail.el* files. Let’s first make sure the Snail installation is not broken.

@nesteiner
Copy link
Author

2022-01-31 18-33-52 的屏幕截图

@gcv
Copy link
Owner

gcv commented Jan 31, 2022

That's still an init-julia.el file. I'm asking for ls -la output of your Snail installation directory, not your configuration code.

@nesteiner
Copy link
Author

here you are
Uploading 2022-02-01 01-49-46 的屏幕截图.png…

@gcv
Copy link
Owner

gcv commented Jan 31, 2022

There's nothing attached to your message.

@nesteiner
Copy link
Author

2022-02-01 01-49-46 的屏幕截图

@gcv
Copy link
Owner

gcv commented Feb 1, 2022

That's the installation directory. I want to see the files inside it, specifically the julia-snail.elc file.

@nesteiner
Copy link
Author

2022-02-01 13-41-16 的屏幕截图

@gcv
Copy link
Owner

gcv commented Feb 1, 2022

Your installation looks good.

Can you post the values of julia-mode-hook both when you do and do not have the byte-compiled init-julia file available? I want to understand if the byte compiler is messing something up for your configuration file.

@nesteiner
Copy link
Author

2022-02-01 13-52-00 的屏幕截图

both hook are the same like this, maybe it the problem of my configuration code ?

@nesteiner
Copy link
Author

holy shit, this code works !

(use-package julia-mode
  :hook (julia-mode . julia-snail-mode)
  :config
  (setq julia-repl-switches nil
	julia-snail-extra-args nil
	julia-indent-offset 2)
  :commands julia-snail-mode)

I think I have took you too much time

@gcv
Copy link
Owner

gcv commented Feb 1, 2022

Very interesting. You're the second person to report this problem and this exact workaround (see #70). For completeness and so I can look into this later, what version of Emacs are you using? What OS? Do you have native compilation enabled?

@nesteiner
Copy link
Author

maybe we are not so familiar with emacs-lisp, I think the major mode once loaded, so that its hook can be called.

@gcv
Copy link
Owner

gcv commented Feb 1, 2022

What we don't understand is use-package. I managed to reproduce the problem you reported. Remove :requires vterm from your original example, and it should work.

It looks like this bug occurs because of :requires: https://github.com/jwiegley/use-package#prevent-loading-if-dependencies-are-missing — so if your (use-package vterm) form is not evaluated first, even if the vterm package is installed, julia-snail is not loaded. It looks like your case and #70 both happened because of this.

I'll update the Snail README and remove :requires vterm and see if that causes a separate set of problems.

@gcv gcv added the bug Something isn't working label Feb 1, 2022
gcv added a commit that referenced this issue Feb 1, 2022
@nesteiner
Copy link
Author

@gcv hey I think I found the problem, using this code

(use-package julia-snail
  :ensure t
  :after julia-mode
  :requires vterm
  :config
  (setq-default julia-snail-extra-args "--sysimage /home/steiner/.julia-images/julia-dev.so")
  (setq julia-snail-executable "/usr/local/bin/julia"))

and I found that when load julia file, watching the local varibale and the julia-snail-extra-args is nil, so I think this code is not loaded at all

@nesteiner
Copy link
Author

how about trying this code, and check the local buffer variable, you will find out

@gcv
Copy link
Owner

gcv commented Feb 22, 2022

You need to remove requires :vterm from there. I discovered this upthread: #75 (comment)

@gcv gcv closed this as completed Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants