File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 3535; ; (defun lisp-enable-paredit-hook () (paredit-mode 1))
3636; ; (add-hook 'clojure-mode-hook 'lisp-enable-paredit-hook)
3737
38+ ; ;; Todo:
39+
40+ ; ; * hashbang is also a valid comment character
41+
3842; ;; License:
3943
4044; ; This program is free software; you can redistribute it and/or
@@ -137,6 +141,9 @@ All commands in `lisp-mode-shared-map' are inherited by this map.")
137141This holds a cons cell of the form `(DIRECTORY . FILE)'
138142describing the last `clojure-load-file' or `clojure-compile-file' command." )
139143
144+ (defvar clojure-def-regexp " ^\\ s *\\ ((def\\ S *\\ s +\\ (\\ S +\\ )\\ )"
145+ " A regular expression to match any top-level definitions." )
146+
140147;;;### autoload
141148(defun clojure-mode ()
142149 " Major mode for editing Clojure code - similar to Lisp mode..
@@ -163,6 +170,12 @@ if that value is non-nil."
163170 'clojure-indent-function )
164171 (set (make-local-variable 'font-lock-multiline ) t )
165172
173+ (setq lisp-imenu-generic-expression
174+ `((nil , clojure-def-regexp 2 )))
175+ (setq imenu-create-index-function
176+ (lambda ()
177+ (imenu--generic-function lisp-imenu-generic-expression)))
178+
166179 (if (and (not (boundp 'font-lock-extend-region-functions ))
167180 (or clojure-mode-font-lock-multiline-def
168181 clojure-mode-font-lock-comment-sexp))
You can’t perform that action at this time.
0 commit comments