Re: Highlight all lines that begin with a "*"

"Stephen J. Turnbull" <[email protected]> Wed, 18 Feb 2004 14:03:54 +0900
Newsgroups gmane.emacs.xemacs.general
Organization The XEmacs Project
Message-ID <[email protected]>
>>>>> "David" == David E <David> writes:

    David> I separate the subjects using lines that begin with a "*",
    David> until now I've used vim, where I just had these two lines:

      syn region MyHeader start="^*" skip="\\$" end="$" keepend
      hi MyHeader gui=none guifg=yellow ctermfg=yellow

Sounds like a job for outline-mode to me.  Try M-x outline-minor-mode,
then do C-h m to get an introduction to outline mode.  M-x
font-lock-mode should font-lock the headers (I dislike fontlocking
most of the time, so dunno exactly how it works offhand).

What outline-mode provides is the ability to hide subheaders and
non-header text.  The header hierarchy is determined by the length of
the match to the header regexp, which just happens to be "^\*+".  If
it doesn't match, it's not a header.


-- 
Institute of Policy and Planning Sciences     http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba                    Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
               Ask not how you can "do" free software business;
              ask what your business can "do for" free software.