1 |
;;; nroff-mode.el --- GNU Emacs major mode for editing nroff source |
;;; nroff-mode.el --- GNU Emacs major mode for editing nroff source |
2 |
|
|
3 |
;; Copyright (C) 1985, 1986, 1994, 1995 Free Software Foundation, Inc. |
;; Copyright (C) 1985, 86, 94, 95, 97, 2001 Free Software Foundation, Inc. |
4 |
|
|
5 |
;; Maintainer: FSF |
;; Maintainer: FSF |
6 |
;; Keywords: wp |
;; Keywords: wp |
68 |
st) |
st) |
69 |
"Syntax table used while in `nroff-mode'.") |
"Syntax table used while in `nroff-mode'.") |
70 |
|
|
71 |
|
(defvar nroff-imenu-expression |
72 |
|
;; man headers: |
73 |
|
'((nil "^\\.SH \"?\\([^\"\n]*\\)\"?$" 1))) |
74 |
|
|
75 |
(defcustom nroff-font-lock-keywords |
(defcustom nroff-font-lock-keywords |
76 |
(list |
(list |
77 |
;; Directives are . or ' at start of line, followed by |
;; Directives are . or ' at start of line, followed by |
97 |
:group 'nroff |
:group 'nroff |
98 |
:type '(repeat regexp)) |
:type '(repeat regexp)) |
99 |
|
|
100 |
|
(defcustom nroff-mode-hook nil |
101 |
|
"Hook run by function `nroff-mode'." |
102 |
|
:type 'hook |
103 |
|
:group 'nroff) |
104 |
|
|
105 |
;;;###autoload |
;;;###autoload |
106 |
(define-derived-mode nroff-mode text-mode "Nroff" |
(define-derived-mode nroff-mode text-mode "Nroff" |
107 |
"Major mode for editing text intended for nroff to format. |
"Major mode for editing text intended for nroff to format. |
127 |
(set (make-local-variable 'comment-start) "\\\" ") |
(set (make-local-variable 'comment-start) "\\\" ") |
128 |
(set (make-local-variable 'comment-start-skip) "\\\\\"[ \t]*") |
(set (make-local-variable 'comment-start-skip) "\\\\\"[ \t]*") |
129 |
(set (make-local-variable 'comment-column) 24) |
(set (make-local-variable 'comment-column) 24) |
130 |
(set (make-local-variable 'comment-indent-function) 'nroff-comment-indent)) |
(set (make-local-variable 'comment-indent-function) 'nroff-comment-indent) |
131 |
|
(set (make-local-variable 'imenu-generic-expression) nroff-imenu-expression)) |
132 |
|
|
133 |
(defun nroff-outline-level () |
(defun nroff-outline-level () |
134 |
(save-excursion |
(save-excursion |