Closed Nathan-Furnal closed 2 years ago
I love the emoji lighter idea! I'll have to steal it.
Your hook is not quite right. Try :hook (julia-mode . julia-snail-mode)
instead.
More troubleshooting tips:
If the REPL crashes instantly, that usually means the Julia binary did not start (I'll have to improve the error messaging when that happens). Check the path and any command-line arguments.
Be sure to run vterm before installing julia-snail (https://github.com/gcv/julia-snail#installation, steps 3 and 4). Try M-x vterm
and make sure it can run a shell, then delete and reinstall julia-snail
.
I love the emoji lighter idea! I'll have to steal it.
Please do, I didn't think it would render but it does!
Your hook is not quite right. Try :hook (julia-mode . julia-snail-mode) instead.
No, it's correct because I have (setq use-package-hook-name-suffix nil)
at the top of my init but I think I fixed it, I merely needed the hook in the julia-mode declaration rather than in julia-snail.
Something like this :
(use-package julia-mode
:pin melpa
:defer t
:ensure t
:diminish "Jl"
:mode ("\\.jl\\'" . julia-mode)
:config
(setenv "JULIA_NUM_THREADS" "16")
:hook (julia-mode-hook . julia-snail-mode))
(use-package julia-snail
:pin melpa
:defer t
:ensure t
:after (vterm julia-mode)
:custom
(julia-snail-show-error-window nil)
:diminish " 🐌")
Weird. It's almost like the Snail autoloads aren't working in your environment. I wonder if native compilation affects this.
I'd like to know a bit more, because I'm sure other people will run into this problem. If you don't mind running the original configuration with a fresh Emacs session, please try the following:
julia-snail-autoloads.el
file have a line like this?
(autoload 'julia-snail-mode "julia-snail" ; ... probably more stuff here
julia-mode-hook
variable (using M-: or C-h v). What is its value?julia-snail-mode
the first time, and then reload the file (using find-alternate-file
or C-x C-v)? Same problem? What is the value of julia-mode-hook
after you manually enable julia-snail-mode
?PS: Also... https://github.com/gcv/julia-snail/commit/1411921cd89cfe4bd226edbb25066fc7260996c7 😎
julia-snail
, it's not loaded but when enabling manually, it does work. PS: Also... 1411921 sunglasses
I've made the update and I see our friendly snail!
Just to clarify, after you manually load julia-snail-mode
once, and then open another Julia file, does julia-snail-mode
get automatically enabled for the new Julia file? I'm wondering if the hook gets messed up somehow between buffers.
Alright I tried again, I put the hook back in the julia-snail
declaration. I can also confirm the autoload is present in julia-snail-autoloads
in my elpa directory.
Opening a julia file does not load the mode, the value of the hook after opening a julia file is nil
. Once julia-snail-mode
is manually enabled, opening a different julia file does use the mode correctly and the hook has the correct value.
I'm not really sure what's going on. It might be that some other hook is messing up with snail
but this is the only place I act on julia related mode. I usually delay a lot of loading and it might be that the hook is not used properly in julia-mode
because of that, but it's strange since I don't have problems with other modes.
Thank you for investigating that. I wonder if it's a deferred loading bug in use-package; perhaps some subtle interaction with native compilation. I'm reluctant to make your workaround an official recommendation, since it feels wrong to affect other modes' configurations. For now, I'll keep this ticket open, and we'll see if anyone else finds something.
I've been looking into this problem in #75, and I think I finally understand what happens. You don't have an explicit (use-package vterm ...)
form evaluating before your julia-mode
and julia-snail
use-package
sections. It seems that messes things up. If you remove :after (vterm julia-mode)
and :requires vterm
from (use-package julia-snail ...)
, the hook should work.
This should be resolved, please see https://github.com/gcv/julia-snail/issues/70#issuecomment-1026936841
Please reopen this ticket if there's anything else.
Hi!
I'm trying to use
julia-snail
with this simple config :When I open a julia file, snail is not started though the hook is there and I have vterm installed as well. I can
M-x julia-snail-mode
without an issue but the hook does not seem to work.I'm using the master branch of emacs with native compilation.
How can I fix this?
Thanks for the help.