From: David Raymond Christiansen Date: Tue, 26 Jul 2016 15:37:04 +0000 (-0400) Subject: Add imenu support to the Emacs mode X-Git-Url: https://git.ak3n.com/?a=commitdiff_plain;h=5ddfe344795e5e4310a87679fe311212c9ef5ec9;p=cubicaltt.git Add imenu support to the Emacs mode imenu is a general-purpose index for things in a buffer, used by a variety of Emacs tools to give a list of definitions in the buffer. This adds support for it to the Emacs mode. --- diff --git a/cubicaltt.el b/cubicaltt.el index 47fb26f..26b81ed 100644 --- a/cubicaltt.el +++ b/cubicaltt.el @@ -199,6 +199,12 @@ suggestions for completion rather than too few.") (set (make-local-variable 'completion-at-point-functions) '(ctt-completion-at-point)) + ;; Setup imenu, to allow tools such as imenu and Helm to jump + ;; directly to names in the current buffer. + (set (make-local-variable 'imenu-generic-expression) + '(("Definitions" "^\\(?1:[[:word:]']+\\) *[:(]" 1) + ("Datatypes" "^\\s-*data\\s-+\\(?1:[[:word:]']+\\)" 1))) + ;; Clear memory (setq ctt-keywords-regexp nil) (setq ctt-operators-regexp nil)