Improve and clarify documentation of Outline Mode

* doc/emacs/text.texi (Outline Visibility): Use the outline-*
names instead of the obsolete aliases.  (Bug#24890)

* lisp/outline.el (outline-hide-sublevels, outline-hide-other)
(outline-hide-body): Doc fixes.  (Bug#24890)
This commit is contained in:
Eli Zaretskii 2016-11-07 17:55:42 +02:00
parent 31d93aa1d5
commit 16f700702c
2 changed files with 66 additions and 50 deletions

View file

@ -1078,92 +1078,101 @@ header line.
@table @kbd @table @kbd
@item C-c C-c @item C-c C-c
Make the current heading line's body invisible (@code{hide-entry}). Make the current heading line's body invisible
(@code{outline-hide-entry}).
@item C-c C-e @item C-c C-e
Make the current heading line's body visible (@code{show-entry}). Make the current heading line's body visible
(@code{outline-show-entry}).
@item C-c C-d @item C-c C-d
Make everything under the current heading invisible, not including the Make everything under the current heading invisible, not including the
heading itself (@code{hide-subtree}). heading itself (@code{outline-hide-subtree}).
@item C-c C-s @item C-c C-s
Make everything under the current heading visible, including body, Make everything under the current heading visible, including body,
subheadings, and their bodies (@code{show-subtree}). subheadings, and their bodies (@code{outline-show-subtree}).
@item C-c C-l @item C-c C-l
Make the body of the current heading line, and of all its subheadings, Make the body of the current heading line, and of all its subheadings,
invisible (@code{hide-leaves}). invisible (@code{outline-hide-leaves}).
@item C-c C-k @item C-c C-k
Make all subheadings of the current heading line, at all levels, Make all subheadings of the current heading line, at all levels,
visible (@code{show-branches}). visible (@code{outline-show-branches}).
@item C-c C-i @item C-c C-i
Make immediate subheadings (one level down) of the current heading Make immediate subheadings (one level down) of the current heading
line visible (@code{show-children}). line visible (@code{outline-show-children}).
@item C-c C-t @item C-c C-t
Make all body lines in the buffer invisible (@code{hide-body}). Make all body lines in the buffer invisible
(@code{outline-hide-body}).
@item C-c C-a @item C-c C-a
Make all lines in the buffer visible (@code{show-all}). Make all lines in the buffer visible (@code{outline-show-all}).
@item C-c C-q @item C-c C-q
Hide everything except the top @var{n} levels of heading lines Hide everything except the top @var{n} levels of heading lines
(@code{hide-sublevels}). (@code{outline-hide-sublevels}).
@item C-c C-o @item C-c C-o
Hide everything except for the heading or body that point is in, plus Hide everything except for the heading or body that point is in, plus
the headings leading up from there to the top level of the outline the headings leading up from there to the top level of the outline
(@code{hide-other}). (@code{outline-hide-other}).
@end table @end table
@findex hide-entry @findex outline-hide-entry
@findex show-entry @findex outline-show-entry
@kindex C-c C-c @r{(Outline mode)} @kindex C-c C-c @r{(Outline mode)}
@kindex C-c C-e @r{(Outline mode)} @kindex C-c C-e @r{(Outline mode)}
The simplest of these commands are @kbd{C-c C-c} The simplest of these commands are @kbd{C-c C-c}
(@code{hide-entry}), which hides the body lines directly following the (@code{outline-hide-entry}), which hides the body lines directly
current heading line, and @kbd{C-c C-e} (@code{show-entry}), which following the current heading line, and @kbd{C-c C-e}
reveals them. Subheadings and their bodies are not affected. (@code{outline-show-entry}), which reveals them. Subheadings and
their bodies are not affected.
@findex hide-subtree @findex outline-hide-subtree
@findex show-subtree @findex outline-show-subtree
@kindex C-c C-s @r{(Outline mode)} @kindex C-c C-s @r{(Outline mode)}
@kindex C-c C-d @r{(Outline mode)} @kindex C-c C-d @r{(Outline mode)}
@cindex subtree (Outline mode) @cindex subtree (Outline mode)
The commands @kbd{C-c C-d} (@code{hide-subtree}) and @kbd{C-c C-s} The commands @kbd{C-c C-d} (@code{outline-hide-subtree}) and
(@code{show-subtree}) are more powerful. They apply to the current @kbd{C-c C-s} (@code{outline-show-subtree}) are more powerful. They
heading line's @dfn{subtree}: its body, all of its subheadings, both apply to the current heading line's @dfn{subtree}: its body, all of
direct and indirect, and all of their bodies. its subheadings, both direct and indirect, and all of their bodies.
@findex hide-leaves @findex outline-hide-leaves
@findex show-branches @findex outline-show-branches
@findex show-children @findex outline-show-children
@kindex C-c C-l @r{(Outline mode)} @kindex C-c C-l @r{(Outline mode)}
@kindex C-c C-k @r{(Outline mode)} @kindex C-c C-k @r{(Outline mode)}
@kindex C-c C-i @r{(Outline mode)} @kindex C-c C-i @r{(Outline mode)}
The command @kbd{C-c C-l} (@code{hide-leaves}) hides the body of the The command @kbd{C-c C-l} (@code{outline-hide-leaves}) hides the
current heading line as well as all the bodies in its subtree; the body of the current heading line as well as all the bodies in its
subheadings themselves are left visible. The command @kbd{C-c C-k} subtree; the subheadings themselves are left visible. The command
(@code{show-branches}) reveals the subheadings, if they had previously @kbd{C-c C-k} (@code{outline-show-branches}) reveals the subheadings,
been hidden (e.g., by @kbd{C-c C-d}). The command @kbd{C-c C-i} if they had previously been hidden (e.g., by @kbd{C-c C-d}). The
(@code{show-children}) is a weaker version of this; it reveals just command @kbd{C-c C-i} (@code{outline-show-children}) is a weaker
the direct subheadings, i.e., those one level down. version of this; it reveals just the direct subheadings, i.e., those
one level down.
@findex hide-other @findex outline-hide-other
@kindex C-c C-o @r{(Outline mode)} @kindex C-c C-o @r{(Outline mode)}
The command @kbd{C-c C-o} (@code{hide-other}) hides everything The command @kbd{C-c C-o} (@code{outline-hide-other}) hides
except the entry that point is in, plus its parents (the headers everything except the entry that point is in, plus its parents (the
leading up from there to top level in the outline) and the top level headers leading up from there to top level in the outline) and the top
headings. level headings. It also reveals body lines preceding the first
heading in the buffer.
@findex hide-body @findex outline-hide-body
@findex show-all @findex outline-show-all
@kindex C-c C-t @r{(Outline mode)} @kindex C-c C-t @r{(Outline mode)}
@kindex C-c C-a @r{(Outline mode)} @kindex C-c C-a @r{(Outline mode)}
@findex hide-sublevels @findex hide-sublevels
@kindex C-c C-q @r{(Outline mode)} @kindex C-c C-q @r{(Outline mode)}
The remaining commands affect the whole buffer. @kbd{C-c C-t} The remaining commands affect the whole buffer. @kbd{C-c C-t}
(@code{hide-body}) makes all body lines invisible, so that you see (@code{outline-hide-body}) makes all body lines invisible, so that you
just the outline structure (as a special exception, it will not hide see just the outline structure (as a special exception, it will not
lines at the top of the file, preceding the first header line, even hide lines at the top of the file, preceding the first header line,
though these are technically body lines). @kbd{C-c C-a} even though these are technically body lines). @kbd{C-c C-a}
(@code{show-all}) makes all lines visible. @kbd{C-c C-q} (@code{outline-show-all}) makes all lines visible. @kbd{C-c C-q}
(@code{hide-sublevels}) hides all but the top level headings; with a (@code{outline-hide-sublevels}) hides all but the top level headings
numeric argument @var{n}, it hides everything except the top @var{n} at and above the level of the current heading line (defaulting to 1 if
levels of heading lines. point is not on a heading); with a numeric argument @var{n}, it hides
everything except the top @var{n} levels of heading lines. Note that
it completely reveals all the @var{n} top levels and the body lines
before the first heading.
@anchor{Outline Search} @anchor{Outline Search}
@findex reveal-mode @findex reveal-mode

View file

@ -788,7 +788,8 @@ Show the heading too, if it is currently invisible."
'show-entry 'outline-show-entry "25.1") 'show-entry 'outline-show-entry "25.1")
(defun outline-hide-body () (defun outline-hide-body ()
"Hide all body lines in buffer, leaving all headings visible." "Hide all body lines in buffer, leaving all headings visible.
Note that this does not hide the lines preceding the first heading line."
(interactive) (interactive)
(outline-hide-region-body (point-min) (point-max))) (outline-hide-region-body (point-min) (point-max)))
@ -868,7 +869,12 @@ Show the heading too, if it is currently invisible."
nil)) nil))
(defun outline-hide-sublevels (levels) (defun outline-hide-sublevels (levels)
"Hide everything but the top LEVELS levels of headers, in whole buffer." "Hide everything but the top LEVELS levels of headers, in whole buffer.
This also unhides the top heading-less body, if any.
Interactively, the prefix argument supplies the value of LEVELS.
When invoked without a prefix argument, LEVELS defaults to the level
of the current heading, or to 1 if the current line is not a heading."
(interactive (list (interactive (list
(cond (cond
(current-prefix-arg (prefix-numeric-value current-prefix-arg)) (current-prefix-arg (prefix-numeric-value current-prefix-arg))
@ -909,7 +915,8 @@ Show the heading too, if it is currently invisible."
'hide-sublevels 'outline-hide-sublevels "25.1") 'hide-sublevels 'outline-hide-sublevels "25.1")
(defun outline-hide-other () (defun outline-hide-other ()
"Hide everything except current body and parent and top-level headings." "Hide everything except current body and parent and top-level headings.
This also unhides the top heading-less body, if any."
(interactive) (interactive)
(outline-hide-sublevels 1) (outline-hide-sublevels 1)
(let (outline-view-change-hook) (let (outline-view-change-hook)