From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Rose Subject: Re: Bug in org-inlinetask - was: Re: Feature suggestion: highlights Date: Fri, 16 Apr 2010 23:47:20 +0200 Message-ID: <87eiifxe6v.fsf@gmx.de> References: <87tyrce1zc.fsf@gmx.de> <87r5mfxkl0.fsf@gmx.de> <87vdbrmaus.fsf@gollum.intra.norang.ca> <87mxx3xg25.fsf_-_@gmx.de> <87mxx3m69y.fsf@gollum.intra.norang.ca> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O2tNx-0007ct-Hi for emacs-orgmode@gnu.org; Fri, 16 Apr 2010 17:47:37 -0400 Received: from [140.186.70.92] (port=42088 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O2tNu-0007ck-Aj for emacs-orgmode@gnu.org; Fri, 16 Apr 2010 17:47:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O2tNs-00032w-N4 for emacs-orgmode@gnu.org; Fri, 16 Apr 2010 17:47:34 -0400 Received: from mail.gmx.net ([213.165.64.20]:55135) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1O2tNs-00032T-AK for emacs-orgmode@gnu.org; Fri, 16 Apr 2010 17:47:32 -0400 In-Reply-To: <87mxx3m69y.fsf@gollum.intra.norang.ca> (Bernt Hansen's message of "Fri, 16 Apr 2010 17:33:45 -0400") 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: Bernt Hansen Cc: emacs-orgmode , Ali Tofigh , carsten.dominik@gmail.com --=-=-= This patch fixes the odd odd/even behaviour. I.e., it makes `org-inlinetask-insert-task' regard `org-odd-levels-only'. Diffed against `origin/master': --=-=-= Content-Type: text/x-diff Content-Disposition: inline diff --git a/lisp/org-inlinetask.el b/lisp/org-inlinetask.el index aac338b..46a7a7e 100644 --- a/lisp/org-inlinetask.el +++ b/lisp/org-inlinetask.el @@ -109,9 +109,13 @@ When nil, they will not be exported." "Insert an inline task." (interactive) (or (bolp) (newline)) - (insert (make-string org-inlinetask-min-level ?*) " \n" - (make-string org-inlinetask-min-level ?*) " END\n") + (let ((indent org-inlinetask-min-level)) + (if org-odd-levels-only + (setq indent (- (* 2 indent) 1))) + (insert (make-string indent ?*) " \n" + (make-string indent ?*) " END\n")) (end-of-line -1)) + (define-key org-mode-map "\C-c\C-xt" 'org-inlinetask-insert-task) (defvar htmlp) ; dynamically scoped into the next function --=-=-= Diffed against branch `remove-compatibility-code': --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=org-inlinetasks-odd-even.patch Content-Description: Diffed against branch `remove-compatibility-code' diff --git a/lisp/org-inlinetask.el b/lisp/org-inlinetask.el index aac338b..6c4e397 100644 --- a/lisp/org-inlinetask.el +++ b/lisp/org-inlinetask.el @@ -109,8 +109,11 @@ When nil, they will not be exported." "Insert an inline task." (interactive) (or (bolp) (newline)) - (insert (make-string org-inlinetask-min-level ?*) " \n" - (make-string org-inlinetask-min-level ?*) " END\n") + (let ((indent org-inlinetask-min-level)) + (if org-odd-levels-only + (setq indent (- (* 2 indent) 1))) + (insert (make-string indent ?*) " \n" + (make-string indent ?*) " END\n")) (end-of-line -1)) (define-key org-mode-map "\C-c\C-xt" 'org-inlinetask-insert-task) --=-=-= Sebastian --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --=-=-=--