branch: externals/logos commit d618202372ea49b566ef875a60670d5fe34ad4b0 Author: Protesilaos Stavrou <i...@protesilaos.com> Commit: Protesilaos Stavrou <i...@protesilaos.com>
Simplify the example with org-indent-mode --- README.org | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/README.org b/README.org index 97398d7919..3e810d3c6d 100644 --- a/README.org +++ b/README.org @@ -499,32 +499,14 @@ use the ~logos-focus-mode-hook~ instead. Here is a snippet that relies on the ~logos-focus-mode-hook~ to extend the functionality of ~logos-focus-mode~ ([[#h:a2540f2f-1159-4e5c-a486-e1f2cb63fee8][Leverage logos-focus-mode-hook]]). -#+begin_src emacs-lisp -(defvar my-logos-org-indent nil - "When t, disable `org-indent-mode' during `logos-focus-mode'.") - -(defun my-logos-org-indent () - "Set `my-logos-org-indent' in `logos-focus-mode'." - (when my-logos-org-indent - ;; Disable `org-indent-mode' when `logos-focus-mode' is enabled and - ;; restore it when `logos-focus-mode' is disabled. The - ;; `logos-set-mode-arg' function takes care of the technicalities. - (logos-set-mode-arg 'org-indent-mode -1))) - -(add-hook 'logos-focus-mode-hook #'my-logos-org-indent) -#+end_src - -The ~my-logos-org-indent~ variable lets the user opt in and out of this -feature, by setting it to t or nil, respectively. If such a toggle is -not needed, the following will suffice: +It disables ~org-indent-mode~ when ~logos-focus-mode~ is enabled and +restores it when ~logos-focus-mode~ is disabled. The +~logos-set-mode-arg~ function takes care of the technicalities. #+begin_src emacs-lisp (defun my-logos-org-indent () - "Set `my-logos-org-indent' in `logos-focus-mode'." - ;; Disable `org-indent-mode' when `logos-focus-mode' is enabled and - ;; restore it when `logos-focus-mode' is disabled. The - ;; `logos-set-mode-arg' function takes care of the technicalities. - (logos-set-mode-arg 'org-indent-mode -1)) + (when logos-focus-mode + (logos-set-mode-arg 'org-indent-mode -1))) (add-hook 'logos-focus-mode-hook #'my-logos-org-indent) #+end_src