reddit / emacs

Emacs becomes extremely sluggish when I enter a haskell file

Im-vArtix · 2022-10-02 22:05
I will provide a video of it, and my .emacs.d repo at the bottom. I've only been using Emacs for about 4 days now, so I am by no means an expert at this, but since the beginning of the day, whenever I open a haskell file in Emacs it becomes EXTREMELY sluggish. I can successfully exit it, and enter any other filetype, but it does not react the same way as when I do it with haskell Here is a video: ​ [Around 0:26 is when I open the haskell file](https://reddit.com/link/xu1aut/video/6tvaxjpttgr91/player) Here is the link to my config ( I tried using ORG mode to write it, but it reacts the same as the equivalent el file ) [https://github.com/kavulox/emacs](https://github.com/kavulox/emacs) Thanks!
michzappa · 2022-10-03 01:57
check if you have any similar config to what caused this issue: https://github.com/haskell/haskell-mode/issues/1777 for me
c256 · 2022-10-03 18:39
Open a new file with no file extension, such as /temp/foo. Insert the haskell file with C-x i. Is emacs sluggish now? If so, repeat the process above with M-: (insert-file-contents-literally “/path/to/haskell/file.hs”) RET and see if it’s still sluggish. If not, switch to haskell-mode with M-x haskell-mode RET and see if it becomes sluggish.
Im-vArtix · 2022-10-03 19:20
Yeah it is haskell-mode causing it to do that I tried disabling everything related to haskell && haskell-mode in my config and reloaded it, but it still becomes slow when I open a hs file Is there anything I could do to fix that?
c256 · 2022-10-04 04:45
Does it happen with every Haskell file? Even a new, empty file ending in .hs? If so, I’d suggest going through the effort of starting emacs -Q, loading Haskell-mode manually, and then opening a haskell file and seeing if it’s still sluggish, to isolate your confit entirely from haskell-mode. If not, try adding/removing chunks of the problematic haskell file and see if you can determine what triggers the bad behavior. Is it a certain construction, a file length, or a particular symbol, perhaps? Binary search usually works well here. If you can narrow the problem down to a small, reproducible case, it’s usually much easier to get it fixed even if you/we can’t figure it out ourselves.
Im-vArtix · 2022-10-04 12:16
Thanks