Hi Nicolas,

Nicolas Goaziou <n.goaz...@gmail.com> writes:

> 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)))

This will not work, because (org-bound-and-true-p org-indent-mode)
returns nil at the time `org-mode' is called.

> It's probably similar to what you wrote in your patch.

Here is my patch -- quite similar, except that it will disable
`org-indent-mode' for every restart once it has been activated
once, which is wrong, or at least to heavy-handed.

Maybe we can simply tell users to deactivate `org-indent-mode'
manually, but this feels wrong too.

diff --git a/lisp/org.el b/lisp/org.el
index ee7965a..f77a0e1 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5350,7 +5350,8 @@ The following commands are available:
   (modify-syntax-entry ?@ "w")
   (modify-syntax-entry ?\" "\"")
   (if org-startup-truncated (setq truncate-lines t))
-  (when org-startup-indented (require 'org-indent) (org-indent-mode 1))
+  (cond (org-startup-indented (require 'org-indent) (org-indent-mode 1))
+	((fboundp 'org-indent-initialize) (org-indent-mode 0)))
   (org-set-local 'font-lock-unfontify-region-function
 		 'org-unfontify-region)
   ;; Activate before-change-function
-- 
 Bastien

Reply via email to