]> code.delx.au - gnu-emacs/blobdiff - lisp/textmodes/nroff-mode.el
(tex-main-file): Use with-no-warnings.
[gnu-emacs] / lisp / textmodes / nroff-mode.el
index 76849019ac5656c9a27c047c8cdc9e3cfbec19c6..de122679f984497b995f1dcd93b47ef61f007984 100644 (file)
@@ -1,6 +1,6 @@
 ;;; nroff-mode.el --- GNU Emacs major mode for editing nroff source
 
-;; Copyright (C) 1985, 1986, 1994, 1995 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 86, 94, 95, 97, 2001  Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
 ;; Keywords: wp
     st)
   "Syntax table used while in `nroff-mode'.")
 
+(defvar nroff-imenu-expression
+  ;; man headers:
+  '((nil "^\\.SH \"?\\([^\"\n]*\\)\"?$" 1)))
+
 (defcustom nroff-font-lock-keywords
   (list
    ;; Directives are . or ' at start of line, followed by
   :group 'nroff
   :type '(repeat regexp))
 
+(defcustom nroff-mode-hook nil
+  "Hook run by function `nroff-mode'."
+  :type 'hook
+  :group 'nroff)
+
 ;;;###autoload
 (define-derived-mode nroff-mode text-mode "Nroff"
   "Major mode for editing text intended for nroff to format.
@@ -118,7 +127,8 @@ closing requests for requests that are used in matched pairs."
   (set (make-local-variable 'comment-start) "\\\" ")
   (set (make-local-variable 'comment-start-skip) "\\\\\"[ \t]*")
   (set (make-local-variable 'comment-column) 24)
-  (set (make-local-variable 'comment-indent-function) 'nroff-comment-indent))
+  (set (make-local-variable 'comment-indent-function) 'nroff-comment-indent)
+  (set (make-local-variable 'imenu-generic-expression) nroff-imenu-expression))
 
 (defun nroff-outline-level ()
   (save-excursion