Hello,

'Ihor Radchenko' <yanta...@gmail.com> 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 <marcowahls...@gmail.com>
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

Reply via email to