From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: [BUG, PATCH] org-indent-mode not correctly deactivated Date: Wed, 15 Jan 2014 17:34:38 +0100 Message-ID: <87txd5ryox.fsf@bzg.ath.cx> References: <87fvoqh7tf.fsf@bzg.ath.cx> <877ga1s8s1.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48128) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3TQa-00087c-E3 for emacs-orgmode@gnu.org; Wed, 15 Jan 2014 11:35:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W3TQQ-0003wZ-R2 for emacs-orgmode@gnu.org; Wed, 15 Jan 2014 11:34:52 -0500 Received: from mail-wi0-x22b.google.com ([2a00:1450:400c:c05::22b]:52626) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3TQQ-0003wI-K6 for emacs-orgmode@gnu.org; Wed, 15 Jan 2014 11:34:42 -0500 Received: by mail-wi0-f171.google.com with SMTP id cc10so4345113wib.4 for ; Wed, 15 Jan 2014 08:34:41 -0800 (PST) In-Reply-To: <877ga1s8s1.fsf@gmail.com> (Nicolas Goaziou's message of "Wed, 15 Jan 2014 13:56:46 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Goaziou Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Hi Nicolas, Nicolas Goaziou 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. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=fix-org-indent.patch 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 --=-=-= Content-Type: text/plain -- Bastien --=-=-=--