Emacs/Project navigation: Difference between revisions

From HaskellWiki
m (Added infobox.)
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
[[Category:Emacs|*]]
== Emacs tags/hasktags ==
{{Haskell infobox}}
 
=== Get hasktags ===
 
ETAGS allows jumping to the definition of names at the point via <code>M-.</code>.  To generate tags (a TAGS file) for a project, you need [http://hackage.haskell.org/package/hasktags hasktags].
 
$ cabal install hasktags
 
=== Calling directly ===
 
Run <code>M-x haskell-process-generate-tags</code> to generate the TAGS file of the [[Sessions|current session directory.]]
 
You can now use <code>M-.</code> on a name in a Haskell buffer which will jump directly to its definition. You can also now use it for [[Emacs/Autocompletion|autocompletion]].
 
=== On save ===
 
You just need to enable tags generation on save:
 
(custom-set-variables
  '(haskell-tags-on-save t))
 
or
 
(setq haskell-tags-on-save t)
 
or just <code>M-x customize-group haskell</code> and it's in there.


== Speedbar ==
== Speedbar ==

Latest revision as of 18:23, 11 April 2016

Emacs tags/hasktags

Get hasktags

ETAGS allows jumping to the definition of names at the point via M-.. To generate tags (a TAGS file) for a project, you need hasktags.

$ cabal install hasktags

Calling directly

Run M-x haskell-process-generate-tags to generate the TAGS file of the current session directory.

You can now use M-. on a name in a Haskell buffer which will jump directly to its definition. You can also now use it for autocompletion.

On save

You just need to enable tags generation on save:

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

or

(setq haskell-tags-on-save t)

or just M-x customize-group haskell and it's in there.

Speedbar

Emacs has a SpeedBar which works quite nice together with haskell-mode and also detects syntactic elements such as variables, imports, instances, classes.

Just add

   (require 'speedbar)
   (speedbar-add-supported-extension ".hs")

to your .emacs file and fire up speedbar with M-x speedbar.