I want to have all text files (esp. org files) display with olivetti mode. I have the fo;llowing in my config:

(add-hook 'text-mode-hook (lambda ()
                            (setq bidi-paragraph-direction nil)
                            (flyspell-mode 1)
                            (visual-fill-column-mode 1)
                            (olivetti-mode 1)
                            (face-remap-add-relative 'default :family "alef")))

but when I open any text file, it's not centered as it's supposed to. when I M-x olivetti-mode I get "olivetti mode disabled for current buffer" suggsting it was enabled, but only after re-enabling it I get the actual effect...

any ideas will be welcome :)

  • There is an "olv" indicator in the mode line if the mode is active: check that. Also check the value of the hook with C-h v text-mode-hook to make sure it is set correctly. If there are still problems, I would make the function a named function so I can set edebug on it, add it to the hook with its name and then try opening a text file. That should make it absolutely unambiguous whether the function is called or not. – NickD Oct 27 '20 at 18:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.