# HG changeset patch # User Richard M. Stallman # Date 762129292 0 # Node ID b23452652292d0f6a29528ddb390e842f8e95b5a # Parent 33f42f5f74483a9e3c4beb751e395b31fc881002 (nroff-mode): Set outline-regexp and outline-level. (nroff-outline-level): New function. diff -r 33f42f5f7448 -r b23452652292 lisp/textmodes/nroff-mode.el --- a/lisp/textmodes/nroff-mode.el Thu Feb 24 22:34:24 1994 +0000 +++ b/lisp/textmodes/nroff-mode.el Thu Feb 24 22:34:52 1994 +0000 @@ -62,6 +62,10 @@ (setq local-abbrev-table nroff-mode-abbrev-table) (make-local-variable 'nroff-electric-mode) (setq nroff-electric-mode nil) + (make-local-variable 'outline-regexp) + (setq outline-regexp "\\.H[ ]+[1-7]+ ") + (make-local-variable 'outline-level) + (setq outline-level 'nroff-outline-level)o ;; now define a bunch of variables for use by commands in this mode (make-local-variable 'page-delimiter) (setq page-delimiter "^\\.\\(bp\\|SK\\|OP\\)") @@ -80,6 +84,12 @@ (setq comment-indent-function 'nroff-comment-indent) (run-hooks 'text-mode-hook 'nroff-mode-hook)) +(defun nroff-outline-level () + (save-excursion + (looking-at outline-regexp) + (skip-chars-forward ".H ") + (string-to-int (buffer-substring (point) (+ 1 (point)))))) + ;;; Compute how much to indent a comment in nroff/troff source. ;;; By mit-erl!gildea April 86 (defun nroff-comment-indent ()