Hello, Bastien <b...@gnu.org> writes:
> With a file like > > ,---- > | #+STARTUP: indent > | > | * Heading > | ** Subheading > `---- > > org-mode will correctly use org-indent-mode when displaying it. > > Now edit the file to deactivate org-indent: > > ,---- > | #+STARTUP: noindent > | > | * Heading > | ** Subheading > `---- > > Go to #+STARTUP and hit C-c C-c : org-indent-mode will not be > activated, but it will not be properly deactivated, leaving a > confusing whitespace before indented headlines. > > The attached patch fixes the problem, but it is wrong, because it > "actively" deactivates org-indent-mode each time a buffer is not > using org-indent-mode, in sessions where org-indent-mode has been > used at least once. There is no attached patch in your mail. Though, I don't understand why you think your approach is wrong. In `org-mode' mode definition, we can change: (when org-startup-indented (require 'org-indent) (org-indent-mode 1)) into: (cond (org-startup-indented (require 'org-indent) (org-indent-mode 1)) ((org-bound-and-true-p org-indent-mode) (org-indent-mode -1))) It's probably similar to what you wrote in your patch. Regards, -- Nicolas Goaziou