Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set up haskell-mode to generate tags?

I am trying to setup emacs for haskell. I downloaded haskell-mode with el-get and some parts are working (like indentation, starting ghci, etc.) but I can't get the tags-generation working.

Hasktags is installed, and (load "~/.emacs.d/el-get/haskell-mode/haskell-site-file") is added to my init-file.

Does hasktags need to be in a certain directory? (I added the directory to PATH, no success.)

The haskell-process-generate-tags function is not available with M-x. When I add (load "~/.emacs.d/el-get/haskell-mode/haskell-process.el") manually to the init-file the function is available but no TAGS file is generated.

(PS: I am using emacs 24.1 with linux)

like image 660
Pi Tabread Avatar asked Nov 04 '12 16:11

Pi Tabread


2 Answers

hasktags should be in PATH, but are you sure that PATH in Emacs is the same as PATH in shell? I just tried, and haskell-process-generate-tags worked for me without problem. Try to setup PATH from Emacs with:

(setenv "PATH" (concat (getenv "PATH") ":directory_with_hasktags"))

You can also bind C-x C-s to haskell-mode-save-buffer as described in examples/init.el - in this case, you can set haskell-tags-on-save variable to t, and hasktags will be called on every save of you haskell files.

like image 55
Alex Ott Avatar answered Oct 21 '22 10:10

Alex Ott


haskell-process-generate-tags is obsolete since 2016-03-14.

use haskell-mode-generate-tags instead.

How to find this out on your own:

M-x describe-function
Describe function: haskell-process-generate-tags
....
like image 31
Chris Avatar answered Oct 21 '22 11:10

Chris