branch: externals/logos commit 5f1d8a423ea3d751c8d1f82f139202942a80aed5 Author: Protesilaos Stavrou <i...@protesilaos.com> Commit: Protesilaos Stavrou <i...@protesilaos.com>
Clarify logos-focus-mode-extra-functions docs --- README.org | 18 +++++++++--------- logos.el | 8 ++++++-- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/README.org b/README.org index f5cdfc5f97..eff15d6ec6 100644 --- a/README.org +++ b/README.org @@ -476,15 +476,15 @@ result can look like this: #+vindex: logos-focus-mode-extra-functions The ~logos-focus-mode-extra-functions~ is a normal hook that runs when -~logos-focus-mode~ is enabled. It gives users the power to write their -own extensions that change how the buffer works when that mode is -toggled on/off. - -The hook is designed to call functions without an argument. An example -function that sets a variable is ~logos--buffer-read-only~; one that -sets a mode is ~logos--scroll-lock~; another that sets the mode of an -external package is ~logos--olivetti~; while ~logos--hide-fringe~ -provides yet another useful sample. +~logos-focus-mode~ is enabled. Each function is run without an argument +and looks like those in =logos.el=. An example that sets a variable is +~logos--buffer-read-only~; one that sets a mode is ~logos--scroll-lock~; +another that sets the mode of an external package is ~logos--olivetti~; +while ~logos--hide-fringe~ provides yet another useful sample. + +If a function cannot be like the aforementioned though still needs to +set its state both when ~logos-focus-mode~ is enabled and disabled, then +use the ~logos-focus-mode-hook~ instead. *** Conditionally toggle org-indent-mode :PROPERTIES: diff --git a/logos.el b/logos.el index c2d98ebfdf..3e350f7b56 100644 --- a/logos.el +++ b/logos.el @@ -191,7 +191,7 @@ This is only relevant when `logos-focus-mode' is enabled." :local t) (defcustom logos-focus-mode-extra-functions nil - "List of functions to execute when `logos-focus-mode' is toggled. + "List of functions to execute when `logos-focus-mode' is enabled. Each function is run without an argument. An example that sets a variable is `logos--buffer-read-only'; one that sets a mode is @@ -199,7 +199,11 @@ variable is `logos--buffer-read-only'; one that sets a mode is package is `logos--olivetti'; while `logos--hide-fringe' provides yet another useful sample. -Consult the Logos manual for concrete do-it-yourself examples." +Consult the Logos manual for concrete do-it-yourself examples. + +If a function cannot be like the aforementioned though still +needs to set its state both when `logos-focus-mode' is enabled +and disabled, then use the `logos-focus-mode-hook' instead." :type 'hook :package-version '(logos . "0.4.0") :group 'logos)