emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: 'Ihor Radchenko' <yantar92@gmail.com>
Cc: Marco Wahl <marcowahlsoft@gmail.com>, emacs-orgmode@gnu.org
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	[thread overview]
Message-ID: <87a7y3zwhl.fsf@nicolasgoaziou.fr> (raw)
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")

Hello,

'Ihor Radchenko' <yantar92@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 <marcowahlsoft@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

  parent reply	other threads:[~2017-12-27 21:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-22  8:34 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/)] 'Ihor Radchenko'
2017-12-22  8:40 ` Ihor Radchenko
2017-12-27 21:33 ` Nicolas Goaziou [this message]
2017-12-28 17:18   ` Marco Wahl
2017-12-28 21:49     ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a7y3zwhl.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=marcowahlsoft@gmail.com \
    --cc=yantar92@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).