Using imenu facility in R mode

Stephen Eglen stephen at cogsci.ed.ac.uk
Fri Jun 9 09:25:30 CEST 2000


Hi,

I have a suggestion for ESS mode; could it be extended to allow
support for imenu?  Imenu provides a menu to jump to the start of a
function.

If you've not used it before, to see it in action, just visit any .el
file with defuns (eg ess-mode.el) and then do 
M-x imenu-add-to-menubar RET Imenu


I currently use Imenu in .R files by doing:


(add-hook 'ess-mode-hook 'my-ess-hook)

(defun my-ess-hook ()
  (setq imenu-generic-expression 
	'( (nil "^\\(.+\\)\\s-+<-\\s-+function" 1)))
  (imenu-add-to-menubar "Imenu")
  )

Perhaps the imenu-generic-expression for each Stats language could be
included in the ESS files?  (I know only about functions under R, not
for other stats languages such as SAS).

Note although that Imenu has only recently been included in XEmacs
(since 21 I think), although it has been in Emacs for a long time.

Cheers, Stephen
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
ess-help mailing list -- To (un)subscribe, send
subscribe	or	unsubscribe
(in the "body", not the subject !)  To: ess-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the ESS-help mailing list