hylang / hy-mode

Hy mode for Emacs
GNU General Public License v3.0
189 stars 48 forks source link

100% CPU Usage (Cannot open .hy extensions) #61

Closed dpavlic closed 6 years ago

dpavlic commented 6 years ago

I am not an emacs / spacemacs user usually, so I am having trouble in figuring out how to troubleshoot this issue: as soon as I open a .hy file, my CPU spikes to 100% and the file never opens (even if empty). The relevant changes to my file (besides disabling the Python hy-mode and adding this repo to the load file):

(defun dotspacemacs/user-config ()
  (require 'hy-mode)
  (require 'spacemacs-hy)
  )

The only thing that works is ctrl + g.

EDIT: I also have dash-functional in the list of additional packages:

   dotspacemacs-additional-packages '(dash-functional) ;
ekaschalk commented 6 years ago

Do you use master or stable for Hy and dev/stable for Spacemacs?

dpavlic commented 6 years ago

It's master for spacemacs + hy-mode (both downloaded today), whereas hy itself is hy (0.13.0+173.g49d2523). I can get the setup to work on jupyter Calysto kernel + hydrogen, but Atom is unbearably slow on my slow laptop.

ekaschalk commented 6 years ago

I'll look into it, in the meantime you can comment out the run-hy-internal in hy--mode-setup-inferior, you just won't have autocompletion or eldoc. Let me know if run-hy (started with , ') once in hy-mode also causes a freeze.

gilch commented 6 years ago

This is just a guess but, astor 0.6 recently broke Hy 0.13.0. We've tagged a 0.13.1 release to use astor=0.5 instead of >=0.5 and updated the current master to require 0.6 as of Oct 31. If you had a previous version of Hy installed, you might still have version 0.5. Make sure you have astor 0.6 installed now.

dpavlic commented 6 years ago

Interesting. That unblocked it, but cannot eval anything because:

ImportError: No module named 'astor.codegen'

Process Hy exited abnormally with code 1

My guess is that it's fairly likely that the hang is a result of the same issue.

gilch commented 6 years ago

Update Hy from github and delete all the .pyc files. The current version should not be using astor.codegen anywhere.

ekaschalk commented 6 years ago

This is just a guess but, astor 0.6 recently broke Hy 0.13.0.

This is actually how I noticed astor was broken, thought I found a bug with hy-mode at first.

dpavlic commented 6 years ago

It all works (including autocompletion now)! Thanks everyone!