@@ -176,13 +176,22 @@ in the file it applies to.")
176
176
map))
177
177
178
178
(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."
180
189
:type '(choice (const :tag " Everywhere" nil )
181
190
(const :tag " At line beginning" bolp)
182
191
(const :tag " Not at line beginning"
183
192
(lambda () (not (bolp ))))
184
193
(const :tag " At line end" eolp)
185
- (function :tag " Custom filter" ))
194
+ (function :tag " Custom filter function " ))
186
195
:version " 28.1" )
187
196
188
197
(defun outline-minor-mode-cycle--bind (map key binding &optional filter )
@@ -349,28 +358,33 @@ After that, changing the prefix key requires manipulating keymaps."
349
358
(set-default sym val)))
350
359
351
360
(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."
358
369
:type 'boolean
359
370
:version " 28.1" )
360
371
;;;### autoload (put 'outline-minor-mode-cycle 'safe-local-variable 'booleanp)
361
372
362
373
(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 ))
374
388
:version " 28.1" )
375
389
;;;### autoload (put 'outline-minor-mode-highlight 'safe-local-variable 'symbolp)
376
390
@@ -1244,11 +1258,14 @@ Return either 'hide-all, 'headings-only, or 'show-all."
1244
1258
(save-excursion (outline-end-of-subtree ) (point )))))
1245
1259
1246
1260
(defun outline-cycle ()
1247
- " Cycle between `hide all', `headings only' and `show all' .
1261
+ " Cycle visibility state of the current heading line's body .
1248
1262
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."
1252
1269
(interactive )
1253
1270
(condition-case nil
1254
1271
(pcase (outline--cycle-state)
@@ -1270,7 +1287,15 @@ Return either 'hide-all, 'headings-only, or 'show-all."
1270
1287
" Internal variable used for tracking buffer cycle state." )
1271
1288
1272
1289
(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."
1274
1299
(interactive )
1275
1300
(let (has-top-level)
1276
1301
(save-excursion
0 commit comments