Xref: utzoo gnu.emacs.help:1262 comp.emacs:10180 Path: utzoo!utgpu!watserv1!watmath!uunet!shelby!agate!bionet!uwm.edu!zaphod.mps.ohio-state.edu!magnus.ircc.ohio-state.edu!tut.cis.ohio-state.edu!unreplyable!garbage From: bob@MORNINGSTAR.COM (Bob Sutterfield) Newsgroups: gnu.emacs.help,comp.emacs Subject: outline-minor-mode with *roff -me Message-ID: <9102182215.AA10369@volitans.morningstar.com> Date: 18 Feb 91 22:15:18 GMT Sender: daemon@tut.cis.ohio-state.edu Reply-To: bob@morningstar.com (Bob Sutterfield) Followup-To: gnu.emacs.help Organization: Gatewayed from the GNU Project mailing list help-gnu-emacs@prep.ai.mit.edu Lines: 64 I'm using Per Abrahamsen 's outline-minor-mode with *roff. I have made the following adaptations to the LaTeX support which seem to work well enough with *roff and the -me macro set: (defvar Nroff-outline-regexp "\.sh[ ]+") (defun Nroff-outline-level () "Find the level of current outline heading in a Nroff document." , (save-excursion (skip-chars-forward " \n") (forward-char 1) (cond ((looking-at ".sh 9") 9) ((looking-at ".sh 8") 8) ((looking-at ".sh 7") 7) ((looking-at ".sh 6") 6) ((looking-at ".sh 5") 5) ((looking-at ".sh 4") 4) ((looking-at ".sh 3") 3) ((looking-at ".sh 2") 2) ((looking-at ".sh ") 1) ((looking-at ".sh 1") 1)))) (setq Nroff-mode-hook ;Use of Outline '(lambda () (setq outline-regexp Nroff-outline-regexp) (setq outline-level-function 'Nroff-outline-level))) My *roff source file starts and ends like: .sh 1 "first section" some text .sh 2 "first subsection" some text .sh 3 "first subsubsection" .sh 4 "first subsubsubsection" .sh 4 "second subsubsubsection" .sh 2 "second subsection" .sh 3 "first subsubsection" .\" Local Variables: .\" mode: electric-nroff .\" minor-mode: outline .\" outline-regexp: "\.sh[ ]+" .\" compile-command: "groff -me -TX75 design.me" .\" End: One problem is that I must still say "M-X outline-minor-mode" upon visiting the file. That is, the "minor-mode: outline" specified in the Local Variables part of the visited file doesn't seem to be happening. Any suggestions? Also, I have tried using the looking-at strings as above to find the outline level, rather than the gross length-of-the-regexp trick with the variable number of spaces, but I seem not to be recognizing what I'm looking at. I'd certainly prefer not to depend upon getting the number of spaces just right every time. What am I doing wrong? Brought to you by Super Global Mega Corp .com