Skip to content

Commit 9da744e

Browse files
committed
Fix documentation of Outline minor mode options
* lisp/outline.el (outline-minor-mode-cycle-filter) (outline-minor-mode-cycle, outline-minor-mode-highlight) (outline-cycle, outline-cycle-buffer): Doc fixes. (Bug#54967)
1 parent a8bb12a commit 9da744e

File tree

1 file changed

+49
-24
lines changed

1 file changed

+49
-24
lines changed

lisp/outline.el

Lines changed: 49 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,22 @@ in the file it applies to.")
176176
map))
177177

178178
(defcustom outline-minor-mode-cycle-filter nil
179-
"Filter out positions on the heading available for cycling."
179+
"Control where on a heading the visibility-cycling commands are bound to keys.
180+
This option controls, in Outline minor mode, where on a heading typing
181+
the key sequences bound to visibility-cycling commands like `outline-cycle'
182+
and `outline-cycle-buffer' will invoke those commands. By default, you can
183+
invoke these commands by typing `TAB' and `S-TAB' anywhere on a heading line,
184+
but customizing this option can make those bindings be in effect only at
185+
specific positions on the heading, like only at the line's beginning or
186+
line's end. This allows these keys to be bound to their usual commands,
187+
as determined by the major mode, elsewhere on the heading lines.
188+
This option is only in effect when `outline-minor-mode-cycle' is non-nil."
180189
:type '(choice (const :tag "Everywhere" nil)
181190
(const :tag "At line beginning" bolp)
182191
(const :tag "Not at line beginning"
183192
(lambda () (not (bolp))))
184193
(const :tag "At line end" eolp)
185-
(function :tag "Custom filter"))
194+
(function :tag "Custom filter function"))
186195
:version "28.1")
187196

188197
(defun outline-minor-mode-cycle--bind (map key binding &optional filter)
@@ -349,28 +358,33 @@ After that, changing the prefix key requires manipulating keymaps."
349358
(set-default sym val)))
350359

351360
(defcustom outline-minor-mode-cycle nil
352-
"Enable cycling of headings in `outline-minor-mode'.
353-
When enabled, it puts a keymap with cycling keys on heading lines.
354-
When point is on a heading line, then typing `TAB' cycles between `hide all',
355-
`headings only' and `show all' (`outline-cycle'). Typing `S-TAB' on
356-
a heading line cycles the whole buffer (`outline-cycle-buffer').
357-
Typing these keys anywhere outside heading lines uses their default bindings."
361+
"Enable visibility-cycling commands on headings in `outline-minor-mode'.
362+
If enabled, typing `TAB' on a heading line cycles the visibility
363+
state of that heading's body between `hide all', `headings only'
364+
and `show all' (`outline-cycle'), and typing `S-TAB' on a heading
365+
line likewise cycles the visibility state of the whole buffer
366+
\(`outline-cycle-buffer').
367+
Typing these keys anywhere outside heading lines invokes their default
368+
bindings, per the current major mode."
358369
:type 'boolean
359370
:version "28.1")
360371
;;;###autoload(put 'outline-minor-mode-cycle 'safe-local-variable 'booleanp)
361372

362373
(defcustom outline-minor-mode-highlight nil
363-
"Highlight headings in `outline-minor-mode' using font-lock keywords.
364-
Non-nil value works well only when outline font-lock keywords
365-
don't conflict with the major mode's font-lock keywords.
366-
When t, it puts outline faces only if there are no major mode's faces
367-
on headings. When `override', it completely overwrites major mode's
368-
faces with outline faces. When `append', it tries to append outline
369-
faces to major mode's faces."
370-
:type '(choice (const :tag "No highlighting" nil)
371-
(const :tag "Overwrite major mode faces" override)
372-
(const :tag "Append outline faces to major mode faces" append)
373-
(const :tag "Highlight separately from major mode faces" t))
374+
"Whether to highlight headings in `outline-minor-mode' using font-lock keywords.
375+
This option controles whether `outline-minor-mode' will use its font-lock
376+
keywords to highlight headings, which could potentially conflict with
377+
font-lock faces defined by the major mode. Thus, a non-nil value will
378+
work well only when there's no such conflict.
379+
If the value is t, use outline faces only if there are no major mode's
380+
font-lock faces on headings. When `override', completely overwrite major
381+
mode's font-lock faces with outline faces. When `append', try to append
382+
outline font-lock faces to those of major mode."
383+
:type '(choice (const :tag "Do not use outline font-lock highlighting" nil)
384+
(const :tag "Overwrite major mode font-lock faces" override)
385+
(const :tag "Append outline font-lock faces to major mode's"
386+
append)
387+
(const :tag "Highlight with outline font-lock faces only if major mode doesn't" t))
374388
:version "28.1")
375389
;;;###autoload(put 'outline-minor-mode-highlight 'safe-local-variable 'symbolp)
376390

@@ -1244,11 +1258,14 @@ Return either 'hide-all, 'headings-only, or 'show-all."
12441258
(save-excursion (outline-end-of-subtree) (point)))))
12451259

12461260
(defun outline-cycle ()
1247-
"Cycle between `hide all', `headings only' and `show all'.
1261+
"Cycle visibility state of the current heading line's body.
12481262
1249-
`Hide all' means hide all subheadings and their bodies.
1250-
`Headings only' means show sub headings but not their bodies.
1251-
`Show all' means show all subheadings and their bodies."
1263+
This cycles the visibility of the current heading line's subheadings
1264+
and body between `hide all', `headings only' and `show all'.
1265+
1266+
`Hide all' means hide all the subheadings and their bodies.
1267+
`Headings only' means show the subheadings, but not their bodies.
1268+
`Show all' means show all the subheadings and their bodies."
12521269
(interactive)
12531270
(condition-case nil
12541271
(pcase (outline--cycle-state)
@@ -1270,7 +1287,15 @@ Return either 'hide-all, 'headings-only, or 'show-all."
12701287
"Internal variable used for tracking buffer cycle state.")
12711288

12721289
(defun outline-cycle-buffer ()
1273-
"Cycle the whole buffer like in `outline-cycle'."
1290+
"Cycle visibility state of the body lines of the whole buffer.
1291+
1292+
This cycles the visibility of all the subheadings and bodies of all
1293+
the heading lines in the buffer. It cycles them between `hide all',
1294+
`headings only' and `show all'.
1295+
1296+
`Hide all' means hide all the buffer's subheadings and their bodies.
1297+
`Headings only' means show all the subheadings, but not their bodies.
1298+
`Show all' means show all the buffer's subheadings and their bodies."
12741299
(interactive)
12751300
(let (has-top-level)
12761301
(save-excursion

0 commit comments

Comments
 (0)