From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [BUG, PATCH] org-indent-mode not correctly deactivated Date: Wed, 15 Jan 2014 13:56:46 +0100 Message-ID: <877ga1s8s1.fsf@gmail.com> References: <87fvoqh7tf.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35622) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3Q1U-00054I-R9 for emacs-orgmode@gnu.org; Wed, 15 Jan 2014 07:56:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W3Q1O-0007HJ-K3 for emacs-orgmode@gnu.org; Wed, 15 Jan 2014 07:56:44 -0500 In-Reply-To: <87fvoqh7tf.fsf@bzg.ath.cx> (Bastien's message of "Tue, 14 Jan 2014 17:00:44 +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: Bastien Cc: emacs-orgmode@gnu.org Hello, Bastien 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