From mboxrd@z Thu Jan 1 00:00:00 1970 From: William Henney Subject: Re: Two bugs in org-indent (plus a fix to correct one of them) Date: Tue, 15 Jun 2010 18:10:50 -0500 Message-ID: References: <871vc8ftjl.wl%dmaus@ictsoc.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=50195 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OOfHU-0002Cm-D3 for emacs-orgmode@gnu.org; Tue, 15 Jun 2010 19:10:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OOfHQ-00058t-D6 for emacs-orgmode@gnu.org; Tue, 15 Jun 2010 19:10:53 -0400 Received: from mail-iw0-f169.google.com ([209.85.214.169]:61257) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OOfHQ-00058d-9z for emacs-orgmode@gnu.org; Tue, 15 Jun 2010 19:10:52 -0400 Received: by iwn35 with SMTP id 35so32220iwn.0 for ; Tue, 15 Jun 2010 16:10:50 -0700 (PDT) In-Reply-To: <871vc8ftjl.wl%dmaus@ictsoc.de> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: David Maus Cc: emacs-org Hi David Thanks for looking at this. On Tue, Jun 15, 2010 at 6:02 AM, David Maus wrote: > William Henney wrote: >>Hi all > >>1. If one sets org-indent-indentation-per-level to any value other >>than the default of 2, then the indentation of lines following a >>heading is not correct. I seem to have managed to fix this by changing >>line 231 of org-indent.el from > >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0n (* (or level 0) org-indent-indentation-= per-level)))))))) > >>to > >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0n (+ 2 (* (1- (or level 0)) org-indent-in= dentation-per-level))))))))) > >>Tested with org-indent-indentation-per-level =3D 0, 1, 2, and 3. > > I don't understand this: The original formula sets the indentation > level of n times org-indent-indentation-per-level with n being the > outline level. =A0Why do you consider this not being correct?[1] > Consider what one would want to happen when org-indent-indentation-per-level =3D 1 (which is what I prefer): Indentation of 0 * Level one heading Indentation of 2 ** Level two heading Indentation of 3 *** Level three heading Indentation of 4 So, the desired sequence of indentation is [0, 2, 3, 4, ...] whereas the original formula gives the sequence [0, 1, 2, 3, ...] > [1] Besides, the suggested function does not consider no outline > level. =A0I.e. returns negative indentation. Yes, you are quite right -- my function does indeed return garbage if you are before the first headline. However, in practice this is not a problem since the line-prefix and wrap-prefix text properties only seem to get applied to text after headlines. But I am sure that the lisp experts on the list can come up with a more elegant function than mine. Cheers Will --=20 Dr William Henney, Centro de Radioastronom=EDa y Astrof=EDsica, Universidad Nacional Aut=F3noma de M=E9xico, Campus Morelia