Skip to content

Generation of tags #39

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

Open
paldepind opened this issue Oct 13, 2015 · 8 comments
Open

Generation of tags #39

paldepind opened this issue Oct 13, 2015 · 8 comments

Comments

@paldepind
Copy link

I'm following along the tutorial. I'm stuck in the section on settings up tags. No TAGS file is being generated when I save.

Related to haskell-mode I have this in my .emacs

(let ((my-cabal-path (expand-file-name "~/.cabal/bin")))
  (setenv "PATH" (concat my-cabal-path path-separator (getenv "PATH")))
  (add-to-list 'exec-path my-cabal-path))

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


(custom-set-variables
  '(haskell-tags-on-save t))

If I do M-: (getenv "PATH") then the correct path to .cabal/bin appears. Hasktags is installed and a binary file exists in the Cabal bin directory.

As I mentioned a tags file is not being generated on save. Thus M-. does not work. If however I do haskell-mode-tag-find then a GHCi session is being started and a TAGS file is generated. From then on the TAGS file is also being updated on save.

In the haskell-mode documentation tags appears as belonging to the interactive mode.

I'm unsure if I'm doing something wrong of if the tags part shouldn't have been included in the non interactive part of the tutorial.

@gromakovsky
Copy link

I have the same problem.

@tmbull
Copy link

tmbull commented Nov 17, 2015

Be careful that you only have one custom-set-variables in your .emacs file. I had the same issue initially, and this was the problem.

@paldepind
Copy link
Author

@tmbull I don't understand. What do you mean?

@tmbull
Copy link

tmbull commented Nov 21, 2015

custom-set-variables can only be defined once. For example:

(custom-set-variables
'(haskell-tags-on-save t)
'(some-other-val t))

Rather than two separate instances of custom-set-variables.

@serras
Copy link
Owner

serras commented Nov 24, 2015

@paldepind Did the solution by @tmbull work for you? If so, I can add it to the tutorial.

@paldepind
Copy link
Author

No. I only have one custom-set-variables. As I mentioned, starting a GHCi session makes tag generation on save work.

I am still under the impression that one needs to have an open session in order for the on save tag generation to work. That is what I am experiencing. And I guess that is why the haskell-mode wiki page on the topic is titled "Haskell Interactive Mode Tags". Thus I believe the coverage of tags should be moved to the interactive part of the tutorial.

I also think suggesting the following binding to the tutorial would be a great idea:

(define-key haskell-mode-map (kbd "M-.") 'haskell-mode-jump-to-def)

Then a GHCi session will automatically be started and a tags file generated if it is missing.

@ghost
Copy link

ghost commented Dec 10, 2015

I am still under the impression that one needs to have an open session in order for the on save tag generation to work.

It seems so. Take a look here: https://github.com/haskell/haskell-mode/blob/master/haskell.el#L341-L350

@apuchitnis
Copy link

Is there an agreement that this part of the documentation is in the wrong section? If so, I can move it across to the correct part of the docs.

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

No branches or pull requests

5 participants