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

Error when initializing haskell-mode #1471

Closed
linhmtran168 opened this issue May 2, 2015 · 5 comments
Closed

Error when initializing haskell-mode #1471

linhmtran168 opened this issue May 2, 2015 · 5 comments

Comments

@linhmtran168
Copy link

After enabling haskell layout in spacemacs, I keep seeing this error when emacs starting

An error occurred while initializing haskell-mode (error: (file-error Cannot open

I think this is related to the fact that haskell-yas was removed from haskell-mode (haskell/haskell-mode#618)

@alanz
Copy link
Contributor

alanz commented May 3, 2015

I tried adding haskell-snippets to the required package list, but it is not installed. I ended up getting it to load by commenting out as below

(defun haskell/init-haskell-mode ()
  ;; (require 'haskell-yas)

But obviously then there are not snippets.

@syl20bnr
Copy link
Owner

syl20bnr commented May 3, 2015

Thank you for the report, this is fixed in develop and current release.

@syl20bnr
Copy link
Owner

syl20bnr commented May 3, 2015

Seems that there is another issue, I'll look into it this evening.

@syl20bnr syl20bnr reopened this May 4, 2015
syl20bnr added a commit that referenced this issue May 4, 2015
@syl20bnr
Copy link
Owner

syl20bnr commented May 4, 2015

OK should be good now :-)

@lebensterben
Copy link
Contributor

lebensterben commented Mar 28, 2021

I've found a fix for this:

(defun haskell/post-init-yasnippet ()
  (spacemacs/add-to-hooks 'spacemacs/load-yasnippet
                          '(haskell-mode-hook haskell-literate-mode-hook)))

(defun haskell/init-haskell-snippets ()
  (use-package haskell-snippets
    :defer t
    :hook (yas-minor-mode . haskell-snippets-initialize)))

The first part actually is optional, but it's conventional to call spacemacs/load-yasnippet first, which would add yasnippet-snippets(if installed) to yas-snippet-dirs.

Then when haskell-snippets package is not excluded, yasnippet would also add it to yas-snippet-dirs.

This will be included in a coming PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants