From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Bug: List does not fold correctly with inline tasks in the middle [9.1.4 (9.1.4-13-g84cb63-elpa @ /home/yantar92/.emacs.d/elpa/org-20171218/)] Date: Wed, 27 Dec 2017 22:33:58 +0100 Message-ID: <87a7y3zwhl.fsf@nicolasgoaziou.fr> References: <87shc3cga3.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46271) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eUJKz-0005DI-4O for emacs-orgmode@gnu.org; Wed, 27 Dec 2017 16:34:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eUJKu-0008TO-1l for emacs-orgmode@gnu.org; Wed, 27 Dec 2017 16:34:09 -0500 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:40669) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eUJKt-0008Qs-De for emacs-orgmode@gnu.org; Wed, 27 Dec 2017 16:34:03 -0500 In-Reply-To: <87shc3cga3.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me> (Ihor Radchenko's message of "Fri, 22 Dec 2017 16:34:28 +0800") 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" To: 'Ihor Radchenko' Cc: Marco Wahl , emacs-orgmode@gnu.org Hello, 'Ihor Radchenko' writes: > 1. Create the following same org file: > * Test > - blah > - a > - b > - c > *************** List folding stops here > :PROPERTIES: > :ID: 27eb85b6-114f-437f-9424-b28d400f6aa9 > :END: > *************** END > - everything here and below folds on tab at =**...END= > - f > > 2. Try to fold at =-blah=. Everything started from inline task is not > folded, while should. > > 3. Try to fold at =*... END=. Everything below *is* folded, while should > not. Confirmed. This is related to: commit a426abffa55f3b74d0c5fb09e148c1dd0d2a0e7a Author: Marco Wahl Date: Fri Dec 4 19:25:36 2015 +0100 org-inlinetask: Fix folding inlinetask children * org-inlinetask.el(org-inlinetask-goto-end): Position point just at the end. Do not forward-line. Fixes org-cycle for state CHILDREN when the children are inlinetasks which have immediate neigbors. Marco, I think there is something wrong in the patch above. `org-inlinetask-goto-end' should move point to the beginning of the next line, not to the end of the last one. IOW, it should something like this: (defun org-inlinetask-goto-end () "Go to the end of the inline task at point. Return point." (save-match-data (beginning-of-line) (let* ((case-fold-search t) (inlinetask-re (org-inlinetask-outline-regexp)) (task-end-re (concat inlinetask-re "END[ \t]*$"))) (cond ((looking-at-p task-end-re) (forward-line)) ((looking-at-p inlinetask-re) (forward-line) (cond ((looking-at-p task-end-re) (forward-line)) ((looking-at-p inlinetask-re)) ((org-inlinetask-in-task-p) (re-search-forward inlinetask-re nil t) (forward-line)) (t nil))) (t (re-search-forward inlinetask-re nil t) (forward-line))))) (point)) The bug your patch is fixing probably lies in `org-cycle'. WDYT? Regards, -- Nicolas Goaziou