Not too clear what you're asking. Are you asking how to use 1
instead of *
, 2
instead of **
, and so on? If so, have a look at variable outline-regexp
. C-h v
tells you:
Regular expression to match the beginning of a heading.
Any line whose beginning matches this regexp is considered to start a heading.
Note that Outline mode only checks this regexp at the start of a line,
so the regexp need not (and usually does not) start with ^
.
The recommended way to set this is with a Local Variables:
list
in the file it applies to. See also outline-heading-end-regexp
.
And from the Emacs manual, node Outline Format:
The length of the matching text determines the level of the heading;
longer matches make a more deeply nested level. Thus, for example, if a
text formatter has commands @chapter
, @section
and @subsection
to
divide the document into chapters and sections, you could make those
lines count as heading lines by setting outline-regexp
to
"@chap\\|@\\(sub\\)*section"
.
Note the trick: the two words chapter
and section
are equally long, but by defining the regexp to match only
chap
we ensure that the length of the text matched on a chapter
heading is shorter, so that Outline mode will know that sections are
contained in chapters. This works as long as no other command starts
with @chap
.
You can explicitly specify a rule for calculating the level of a
heading line by setting the variable outline-level
. The value of
outline-level
should be a function that takes no arguments and returns
the level of the current heading. The recommended ways to set this
variable are in a major mode command or with a file local variable.