prosseek
prosseek

Reputation: 190659

"Autoloading failed to define function haskell-interactive-bring" issue with running Haskell on Emacs

Following haskell repl in emacs, I could install packages. I used MELPA stable for repository ('("melpa-stable" . "http://stable.melpa.org/packages/") t))

I also installed the binaries with cabal.

Cabal version 1.22.6.0, GNU Emacs version 24.5.1 on Mac OS X 10.10.4.

The issue is that when I tried to run ghci with C-`, I have the error message.

command-execute: Autoloading failed to define function haskell-interactive-bring

With C-c C-l, I have this error message.

command-execute: Autoloading failed to define function haskell-process-load-or-reload

What might be wrong?

enter image description here

This is the Haskell related code in init.el.

;; Haskell

; http://www.mew.org/~kazu/proj/ghc-mod/en/preparation.html
(autoload 'ghc-init "ghc" nil t)
(autoload 'ghc-debug "ghc" nil t)
(add-hook 'haskell-mode-hook (lambda () (ghc-init)))
;;(add-hook 'haskell-mode-hook 'turn-on-haskell-indentation).

; https://github.com/serras/emacs-haskell-tutorial/blob/master/tutorial.md 
; https://stackoverflow.com/questions/26603649/haskell-repl-in-emacs
(let ((my-cabal-path (expand-file-name "~/Library/Haskell/bin")))
  (setenv "PATH" (concat my-cabal-path ":" (getenv "PATH")))
  (add-to-list 'exec-path my-cabal-path))
(custom-set-variables '(haskell-tags-on-save t))

(add-hook 'haskell-mode-hook 'turn-on-haskell-indentation)

(eval-after-load 'haskell-mode '(progn
  (define-key haskell-mode-map (kbd "C-c C-l") 'haskell-process-load-or-reload)
  (define-key haskell-mode-map (kbd "C-`") 'haskell-interactive-bring)
  (define-key haskell-mode-map (kbd "C-c C-n C-t") 'haskell-process-do-type)
  (define-key haskell-mode-map (kbd "C-c C-n C-i") 'haskell-process-do-info)
  (define-key haskell-mode-map (kbd "C-c C-n C-c") 'haskell-process-cabal-build)
  (define-key haskell-mode-map (kbd "C-c C-n c") 'haskell-process-cabal)))
(eval-after-load 'haskell-cabal '(progn
  (define-key haskell-cabal-mode-map (kbd "C-`") 'haskell-interactive-bring)
  (define-key haskell-cabal-mode-map (kbd "C-c C-k") 'haskell-interactive-ode-clear)
  (define-key haskell-cabal-mode-map (kbd "C-c C-c") 'haskell-process-cabal-build)
  (define-key haskell-cabal-mode-map (kbd "C-c c") 'haskell-process-cabal)))

(custom-set-variables
 '(haskell-interactive-mode-hide-multi-line-errors nil)
 '(haskell-process-log t)
 '(haskell-process-type (quote cabal-repl)))

Added

In Emacs, auto completion shows that the "haskell-interactive-bring" function is available.

enter image description here

However, autoloading is failed.

enter image description here

Upvotes: 1

Views: 856

Answers (1)

prosseek
prosseek

Reputation: 190659

The issue was that I have "haskell.el" that stores all the haskell related configuration setup. This has caused some conflict so that the "haskell.el" in the ELPA/haskell... package unable to properly loaded.

When I renamed my "haskell.el" to "haskell_config.el", everything seems to be working fine.

Upvotes: 2

Related Questions