            (setq font-lock-keywords fsharp-font-lock-keywords)))
          (make-local-variable 'font-lock-keywords-only)
          (setq font-lock-keywords-only t)
-         (font-lock-mode 1)))
+         (font-lock-mode 1)
+         (set (make-local-variable 'imenu-generic-expression)
+              fsharp-imenu-generic-expression)
+         ))
 
 (defun inferior-fsharp-mode-font-hook ()
   (cond

  (setq font-lock-doccomment-face 'Doc)
))


(defconst fsharp-font-lock-keywords
  (list

;;    '("\\<\\(begin\\|end\\|module\\|namespace\\|object\\|sig\\|struct\\)\\>"
;;      . font-lock-keyword-face)
;control

  ;; attributes
  '("\\[<[A-Za-z0-9_]+>\\]" . font-lock-preprocessor-face)
  ;; type defines
  `(,fsharp-type-def-regexp 1 font-lock-type-face)
  `(,fsharp-function-def-regexp 1 font-lock-function-name-face)
  `(,fsharp-pattern-function-regexp 1 font-lock-function-name-face)
  `(,fsharp-active-pattern-regexp 1 font-lock-function-name-face)
  `(,fsharp-member-function-regexp 1 font-lock-function-name-face)
  `(,fsharp-overload-operator-regexp 1 font-lock-function-name-face)
  ;; `(,fsharp-constructor-regexp 1 font-lock-function-name-face)
  `("[^:]:\\s-*\\(\\<[A-Za-z_'][^,)=<-]*\\)\\s-*\\(<[^>]*>\\)?"
    (1 font-lock-type-face)             ; type annotations
    ;; HACK: font-lock-negation-char-face is usually the same as
    ;; 'default'. use this to prevent generic type arguments from
    ;; being rendered in variable face
    (2 font-lock-negation-char-face nil t))
  `(,(format "^\\s-*\\<\\(let\\|use\\|override\\|member\\|and\\|\\(?:%snew\\)\\)\\>"
			 fsharp-access-control-regexp)
    (0 font-lock-keyword-face) ; let binding and function arguments
    (,fsharp-var-or-arg-regexp
     (,fsharp-var-pre-form) nil
     (1 font-lock-variable-name-face nil t)))
  `("\\<fun\\>"
    (0 font-lock-keyword-face) ; lambda function arguments
    (,fsharp-var-or-arg-regexp
     (,fsharp-fun-pre-form) nil
     (1 font-lock-variable-name-face nil t)))
  `(,fsharp-type-def-regexp
    (0 font-lock-keyword-face) ; implicit constructor arguments
    (,fsharp-var-or-arg-regexp
     (,fsharp-var-pre-form) nil
     (1 font-lock-variable-name-face nil t)))
  `(,fsharp-explicit-field-regexp
	(1 font-lock-variable-name-face)
	(2 font-lock-type-face))

  ;; open namespace
  '("\\<open\s\\([A-Za-z0-9_.]+\\)" 1 font-lock-type-face)

  ;; module/namespace
  '("\\<\\(?:module\\|namespace\\)\s\\([A-Za-z0-9_.]+\\)" 1 font-lock-type-face)

;labels (and open)
   '("\\<\\(assert\\|open\\|include\\|module\\|namespace\\|extern\\|void\\)\\>\\|[~?][ (]*[a-z][a-zA-Z0-9_']*"
     . font-lock-variable-name-face)
   ;; (cons (concat
   ;;        "\\<\\(asr\\|false\\|land\\|lor\\|lsl\\|lsr\\|lxor"
   ;;        "\\|mod\\|new\\|null\\|object\\|or\\|sig\\|true\\)\\>"
   ;;        "\\|\|\\|->\\|&\\|#")
   ;;       'font-lock-constant-face)
   ))

(defconst inferior-fsharp-font-lock-keywords
  (append
