Function: outline-mode
outline-mode is an autoloaded, interactive and byte-compiled function
defined in outline.el.gz.
Signature
(outline-mode)
Documentation
Set major mode for editing outlines with selective display.
Headings are lines which start with asterisks: one for major headings, two for subheadings, etc. Lines not starting with asterisks are body lines.
Body text or subheadings under a heading can be made temporarily invisible, or visible again. Invisible lines are attached to the end of the heading, so they move with it, if the line is killed and yanked back. A heading with text hidden under it is marked with an ellipsis (...).
<backtab> outline-cycle-buffer
C-M-<down-mouse-1> foldout-mouse-zoom
C-M-<down-mouse-2> foldout-mouse-show
C-M-<down-mouse-3> foldout-mouse-hide-or-exit
C-c / h outline-hide-by-heading-regexp
C-c / s outline-show-by-heading-regexp
C-c @ outline-mark-subtree
C-c C-< outline-promote
C-c C-> outline-demote
C-c C-^ outline-move-subtree-up
C-c C-a outline-show-all
C-c C-b outline-backward-same-level
C-c C-c outline-hide-entry
C-c C-d outline-hide-subtree
C-c C-e outline-show-entry
C-c C-f outline-forward-same-level
C-c C-k outline-show-branches
C-c C-l outline-hide-leaves
C-c C-n outline-next-visible-heading
C-c C-o outline-hide-other
C-c C-p outline-previous-visible-heading
C-c C-q outline-hide-sublevels
C-c C-s outline-show-subtree
C-c C-t outline-hide-body
C-c C-u outline-up-heading
C-c C-v outline-move-subtree-down
C-c C-x foldout-exit-fold
C-c C-z foldout-zoom-subtree
C-c RET outline-insert-heading
C-c TAB outline-show-children
The commands outline-hide-subtree, outline-show-subtree,
outline-show-children, outline-hide-entry,
outline-show-entry, outline-hide-leaves, and outline-show-branches
are used when point is on a heading line.
The variable outline-regexp can be changed to control what is a heading.
A line is a heading if outline-regexp matches something at the
beginning of the line. The longer the match, the deeper the level.
Turning on outline mode calls the value of text-mode-hook and then of
outline-mode-hook, if they are non-nil.
Probably introduced at or before Emacs version 1.1.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/outline.el.gz
;;;###autoload
(define-derived-mode outline-mode text-mode "Outline"
"Set major mode for editing outlines with selective display.
Headings are lines which start with asterisks: one for major headings,
two for subheadings, etc. Lines not starting with asterisks are body lines.
Body text or subheadings under a heading can be made temporarily
invisible, or visible again. Invisible lines are attached to the end
of the heading, so they move with it, if the line is killed and yanked
back. A heading with text hidden under it is marked with an ellipsis (...).
\\{outline-mode-map}
The commands `outline-hide-subtree', `outline-show-subtree',
`outline-show-children', `outline-hide-entry',
`outline-show-entry', `outline-hide-leaves', and `outline-show-branches'
are used when point is on a heading line.
The variable `outline-regexp' can be changed to control what is a heading.
A line is a heading if `outline-regexp' matches something at the
beginning of the line. The longer the match, the deeper the level.
Turning on outline mode calls the value of `text-mode-hook' and then of
`outline-mode-hook', if they are non-nil."
(setq-local line-move-ignore-invisible t)
;; Cause use of ellipses for invisible text.
(add-to-invisibility-spec '(outline . t))
(setq-local paragraph-start
(concat paragraph-start "\\|\\(?:" outline-regexp "\\)"))
;; Inhibit auto-filling of header lines.
(setq-local auto-fill-inhibit-regexp outline-regexp)
(setq-local paragraph-separate
(concat paragraph-separate "\\|\\(?:" outline-regexp "\\)"))
(setq-local font-lock-defaults
'(outline-font-lock-keywords t nil nil backward-paragraph))
(setq-local imenu-generic-expression outline-imenu-generic-expression)
(add-hook 'change-major-mode-hook #'outline-show-all nil t)
(add-hook 'hack-local-variables-hook #'outline-apply-default-state nil t))