From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marco Wahl 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: Thu, 28 Dec 2017 18:18:47 +0100 Message-ID: <84zi626aa0.fsf@gmail.com> References: <87shc3cga3.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me> <87a7y3zwhl.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eUbph-00053L-Q9 for emacs-orgmode@gnu.org; Thu, 28 Dec 2017 12:19:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eUbpc-0002hQ-HM for emacs-orgmode@gnu.org; Thu, 28 Dec 2017 12:19:05 -0500 Received: from [195.159.176.226] (port=41412 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eUbpc-0002gl-9y for emacs-orgmode@gnu.org; Thu, 28 Dec 2017 12:19:00 -0500 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1eUbna-0002er-1d for emacs-orgmode@gnu.org; Thu, 28 Dec 2017 18:16:54 +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" To: emacs-orgmode@gnu.org Hi! > '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? Thanks! I just committed your suggestion of org-inlinetask-goto-end. I also edited the respective test section. LGTM for now. Sorry for the disturbance in the Org and best regards Marco