emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Repeated tasks repeats even if the time stamp is commented


From: Nicolas Goaziou
Subject: Re: [O] Repeated tasks repeats even if the time stamp is commented
Date: Fri, 18 Jul 2014 12:32:48 +0200

Hello,

Samuel Loury <address@hidden> writes:

> In baa2c5943a4afce71a6336cbd957139e840bd952,
>
> If the user toggles the TODO to DONE, the tasks repeats even though the
> scheduled item is commented.
> * TODO Test # SCHEDULED: <2014-07-18 Fri ++1d>
> My first though is that this behavior is unexpected, but I guess this
> needs discussion.

This is a long standing bug. It could be fixed if the part of Org
handling planning lines used the parser.

> I dug a bit and found two issues with this:
> 1. In org-add-planning-info, file lisp/org.el line 13446, the following
>    code may be seen:
>           (if (and (not (looking-at org-outline-regexp))
>                    (looking-at (concat "[^\r\n]*?" org-keyword-time-regexp
>                                        "[^\r\n]*"))
>                    (not (equal (match-string 1) org-clock-string)))
>               (narrow-to-region (match-beginning 0) (match-end 0))
>             (insert-before-markers "\n")
>             (backward-char 1)
>             (narrow-to-region (point) (point))
>             (and org-adapt-indentation (org-indent-to-column col)))
>   It assumes that (concat "[^\r\n]*?" org-keyword-time-regexp
>   "[^\r\n]*") is a suitable regexp for time entry. It then make the
>   buffer look like
> * DONE Test
>   CLOSED: [2014-07-18 Fri 11:13] #  SCHEDULED: <2014-07-21 Mon ++1d>
> 2. afterward, into the org-get-repeat function, in the same file, line
>    13094, the code is
>       (and (re-search-forward (if tagline
>                                 (concat tagline "\\s-*" org-repeat-re)
>                               org-repeat-re)
>                             (org-entry-end-position) t)
>          (match-string-no-properties 1)))))
>   This assumes also ignores a line starting with a #.
>
> This case is a bit tricky to fix since if string matching org-repeat-re
> is commented, then one has to search till the remaining of the entry to
> find another one.

The search should use `org-element-context' in order to know if point is
really at a timestamp.


Regards,

-- 
Nicolas Goaziou



reply via email to

[Prev in Thread] Current Thread [Next in Thread]