Variable: hs-cycle-filter

hs-cycle-filter is a customizable variable defined in hideshow.el.gz.

Value

nil

Documentation

Control where typing a \TAB cycles the visibility.

This option determines on which parts of a line where a block begins \TAB will be bound to visibility-cycling commands such as hs-toggle-hiding. The value t means you can type \TAB anywhere on a headline. The value nil means \TAB always has its usual binding. The value can also be a function of no arguments, then \TAB will invoke the visibility-cycling commands where that function returns non-nil. For example, if the value is bolp, those commands will be invoked at the headline's beginning. This allows to preserve the usual bindings, as determined by the major mode, elsewhere on the headlines. Currently it affects only the command hs-toggle-hiding by default, but it can be easily replaced with the command hs-cycle.

This variable was added, or its default value changed, in Emacs 31.1.

View in manual

Probably introduced at or before Emacs version 31.1.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/hideshow.el.gz
(defcustom hs-cycle-filter nil
  "Control where typing a \\`TAB' cycles the visibility.
This option determines on which parts of a line where a block
begins \\`TAB' will be bound to visibility-cycling commands such
as `hs-toggle-hiding'.  The value t means you can type \\`TAB'
anywhere on a headline.  The value nil means \\`TAB' always has its
usual binding.  The value can also be a function of no arguments,
then \\`TAB' will invoke the visibility-cycling commands where that
function returns non-nil.  For example, if the value is `bolp',
those commands will be invoked at the headline's beginning.
This allows to preserve the usual bindings, as determined by the
major mode, elsewhere on the headlines.
Currently it affects only the command `hs-toggle-hiding' by default,
but it can be easily replaced with the command `hs-cycle'."
  :type `(choice (const :tag "Nowhere" nil)
                 (const :tag "Everywhere on the headline" t)
                 (const :tag "At block beginning"
                        ,(lambda ()
                           (pcase-let ((`(,beg ,end) (hs-block-positions)))
                             (and beg (hs-hideable-region-p beg end)))))
                 (const :tag "At line beginning" bolp)
                 (const :tag "Not at line beginning"
                        ,(lambda () (not (bolp))))
                 (const :tag "At line end" eolp)
                 (function :tag "Custom filter function"))
  :version "31.1")