diff options
| author | Richard M. Stallman | 1994-02-24 22:34:52 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-02-24 22:34:52 +0000 |
| commit | a62342463a333d8f6e0be00bc3b03c6082a291e2 (patch) | |
| tree | e1c83be5af1b5ff65a5441e37474ee5257cf508c | |
| parent | bd133320961b10e7abda6ffa86b3cc3fe78f981f (diff) | |
| download | emacs-a62342463a333d8f6e0be00bc3b03c6082a291e2.tar.gz emacs-a62342463a333d8f6e0be00bc3b03c6082a291e2.zip | |
(nroff-mode): Set outline-regexp and outline-level.
(nroff-outline-level): New function.
| -rw-r--r-- | lisp/textmodes/nroff-mode.el | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lisp/textmodes/nroff-mode.el b/lisp/textmodes/nroff-mode.el index 78c6a10f31c..6ee2c2bb47f 100644 --- a/lisp/textmodes/nroff-mode.el +++ b/lisp/textmodes/nroff-mode.el | |||
| @@ -62,6 +62,10 @@ closing requests for requests that are used in matched pairs." | |||
| 62 | (setq local-abbrev-table nroff-mode-abbrev-table) | 62 | (setq local-abbrev-table nroff-mode-abbrev-table) |
| 63 | (make-local-variable 'nroff-electric-mode) | 63 | (make-local-variable 'nroff-electric-mode) |
| 64 | (setq nroff-electric-mode nil) | 64 | (setq nroff-electric-mode nil) |
| 65 | (make-local-variable 'outline-regexp) | ||
| 66 | (setq outline-regexp "\\.H[ ]+[1-7]+ ") | ||
| 67 | (make-local-variable 'outline-level) | ||
| 68 | (setq outline-level 'nroff-outline-level)o | ||
| 65 | ;; now define a bunch of variables for use by commands in this mode | 69 | ;; now define a bunch of variables for use by commands in this mode |
| 66 | (make-local-variable 'page-delimiter) | 70 | (make-local-variable 'page-delimiter) |
| 67 | (setq page-delimiter "^\\.\\(bp\\|SK\\|OP\\)") | 71 | (setq page-delimiter "^\\.\\(bp\\|SK\\|OP\\)") |
| @@ -80,6 +84,12 @@ closing requests for requests that are used in matched pairs." | |||
| 80 | (setq comment-indent-function 'nroff-comment-indent) | 84 | (setq comment-indent-function 'nroff-comment-indent) |
| 81 | (run-hooks 'text-mode-hook 'nroff-mode-hook)) | 85 | (run-hooks 'text-mode-hook 'nroff-mode-hook)) |
| 82 | 86 | ||
| 87 | (defun nroff-outline-level () | ||
| 88 | (save-excursion | ||
| 89 | (looking-at outline-regexp) | ||
| 90 | (skip-chars-forward ".H ") | ||
| 91 | (string-to-int (buffer-substring (point) (+ 1 (point)))))) | ||
| 92 | |||
| 83 | ;;; Compute how much to indent a comment in nroff/troff source. | 93 | ;;; Compute how much to indent a comment in nroff/troff source. |
| 84 | ;;; By mit-erl!gildea April 86 | 94 | ;;; By mit-erl!gildea April 86 |
| 85 | (defun nroff-comment-indent () | 95 | (defun nroff-comment-indent () |