gcv / julia-snail

An Emacs development environment for Julia
GNU General Public License v3.0
235 stars 23 forks source link

Leaf install, failed to find function julia-snail-mode #60

Closed Cons-Cat closed 2 years ago

Cons-Cat commented 2 years ago

When I run M-x julia-snail-mode or M-x julia-snail, I get this message:

command-execute: Autoloading file /home/conscat/.emacs.d/elpa/julia-snail-20210818.310/julia-snail.elc failed to define function julia-snail-mode

I have installed the package in this way:

(leaf vterm
  :ensure t)

(leaf julia-snail
  :ensure t
  :require vterm
  :hook (julia-mode . julia-snail-mode))

I have deleted the directories for my elc files to clean install and build everything, which doesn't solve the issue. Could this be because of the byte compiling?

This issue doesn't happen when I use use-package for these two.

gcv commented 2 years ago

I just checked, and was able to install everything using leaf into a clean Emacs environment. I bet your julia-snail.elc file is truncated because of the weird installation bug that happens if you don’t have vterm fully installed with its module compiled first. See https://github.com/gcv/julia-snail#installation, steps 3 and 4. I should probably emphasize that step 4 is critical; you have to have vterm fully working before installing Snail.

You need to delete the julia-snail-20210818.310 directory, then run M-x vterm. Compile the module when prompted. If that doesn’t work, you’ll have to figure out why (probably an environment path problem or a missing package on your system). Then you can install the julia-snail package.

I have no idea why this happens. It’s a strange interaction between the Emacs byte compiler and native modules.

gcv commented 2 years ago

Maybe when you tried this with use-package you had the vterm module already built?