[mercury-users] Questions

Dominique de Waleffe ddw at miscrit.be
Tue Mar 28 18:05:01 AEST 2000

> -----Original Message-----
> From: owner-mercury-users at cs.mu.OZ.AU
> [mailto:owner-mercury-users at cs.mu.OZ.AU]On Behalf Of Robert Ernst Johann

> >    * Medium (e.g. Emacs mode with support to some programming tasks and
> > independent automatic tools)
> This would work well for me - as long as the indentation rules were easily
> customisable :)
> Actually, something like the emacs mode for Haskell would be brilliant. It
> scans your source and builds up a menu of all the declarations in your
> program that allows you to jump straight to them in the source. It also
> has built in support for Hugs, and can open up a Hugs window inside the
> editor.

(require 'imenu)
(setq mercury-imenu-generic-expression
      '(("C code" "^:-[ \t]*pragma[ \t]+c_code(\\([a-z][_a-zA-Z0-9:]*\\)"
	1 )
	("Instances" "^:-[ \t]*instance[ \t]+\\([a-z][_a-zA-Z0-9:]*\\)" 1)
	("Typeclasses" "^:-[ \t]*typeclass[ \t]+\\([a-z][_a-zA-Z0-9:]*\\)" 1)
	("Types" "^:-[ \t]*type[ \t]+\\([a-z][_a-zA-Z0-9:]*\\)" 1)
	("Clauses" "^\\([a-z][_a-zA-Z0-9:]*\\).*\\(:-\\|-->\\)" 1)
	("Modes" "^:-[ \t]*mode[ \t]+\\([a-z][_a-zA-Z0-9:]*\\)" 1)
	("Funcs" "^:-[ \t]*func[ \t]+\\([a-z][_a-zA-Z0-9:]*\\)" 1)
	("Preds" "^:-[ \t]*pred[ \t]+\\([a-z][_a-zA-Z0-9:]*\\)" 1)))

; or prolog-mode-hook...
(add-hook mercury-mode-hook (function(lambda()
  (setq imenu-generic-expression mercury-imenu-generic-expression)
  (imenu-add-to-menubar "Imenu"))))

Now you've got an interactive menu with declarations and clauses (most of
them at least).
If you further activate the speedbar (menu Tools, Display Speedbar, you've
got Mercury support in the speedbar).


mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe

More information about the users mailing list