]> git.eshelyaron.com Git - emacs.git/commitdiff
(nroff-mode): Set outline-regexp and outline-level.
authorRichard M. Stallman <rms@gnu.org>
Thu, 24 Feb 1994 22:34:52 +0000 (22:34 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 24 Feb 1994 22:34:52 +0000 (22:34 +0000)
(nroff-outline-level): New function.

lisp/textmodes/nroff-mode.el

index 78c6a10f31c0be1d65aff8a2489afc41e10ca482..6ee2c2bb47fc1c4e8fcb509354846be5615b7497 100644 (file)
@@ -62,6 +62,10 @@ closing requests for requests that are used in matched pairs."
   (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 @@ closing requests for requests that are used in matched pairs."
   (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 ()