changeset 49025:24d4032aaa07

(nroff-mode-hook): Customize. (nroff-imenu-expression): New. (nroff-mode): Use it.
author Dave Love <fx@gnu.org>
date Fri, 03 Jan 2003 20:04:48 +0000
parents 417bead90660
children 4ecab4bfe0cd
files lisp/textmodes/nroff-mode.el
diffstat 1 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/nroff-mode.el	Fri Jan 03 20:01:24 2003 +0000
+++ b/lisp/textmodes/nroff-mode.el	Fri Jan 03 20:04:48 2003 +0000
@@ -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
@@ -68,6 +68,10 @@
     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
@@ -93,6 +97,11 @@
   :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 @@
   (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