From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Loury Subject: Re: Repeated tasks repeats even if the time stamp is commented Date: Fri, 18 Jul 2014 13:37:10 +0200 Message-ID: <87iomuyk2h.fsf@konixwork.incubateur.ens-lyon.fr> References: <87silzxbvx.fsf@konixwork.incubateur.ens-lyon.fr> <87r41jlzxr.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33092) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X86Ta-0004JO-Uz for emacs-orgmode@gnu.org; Fri, 18 Jul 2014 07:37:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X86TV-00011z-8j for emacs-orgmode@gnu.org; Fri, 18 Jul 2014 07:37:22 -0400 Received: from mail-wg0-x22c.google.com ([2a00:1450:400c:c00::22c]:60954) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X86TV-00011s-0B for emacs-orgmode@gnu.org; Fri, 18 Jul 2014 07:37:17 -0400 Received: by mail-wg0-f44.google.com with SMTP id m15so3384410wgh.15 for ; Fri, 18 Jul 2014 04:37:16 -0700 (PDT) In-Reply-To: <87r41jlzxr.fsf@nicolasgoaziou.fr> 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Goaziou Cc: OrgMode ML --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Nicolas Goaziou writes: > Samuel Loury 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. Thank you for the answer, do you know where I should look at to start investigating to fix the issue? >> 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. I totally agree. =2D-=20 Konubinix GPG Key : 7439106A Fingerprint: 5993 BE7A DA65 E2D9 06CE 5C36 75D2 3CED 7439 106A --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJTyQbmAAoJEHXSPO10ORBqyWgH/0iZA2I9jALESJcQZuTcbOVE R89RSZKC1RCXvw4V74FyZVbcBUoPqh5Y1cp7Dferl3DnkaFRRxotjn6V6aTwsHq1 WgimqionQOLRe43HL2gXz/W/c7Ougf26D+VmkdLRfka5gCllI4QhtNUlmxRHvQfU EW20v7vEPiQ8ZRgUe9bCfta9YsZ4685S9NSShaM5sYR5h2pqc2wkAh8uVZvf1MKH rCoPRvKX1dwu0xDycJ6etWSGZgo+1Y891vb0xFUgh2e52HCYEf7dEh5Wu4bSgbvH UVPtRx7JBDp7Vql724NAAi4ovzLVC3DpWj66SdclPWVcxA0UK5HcimJpR+RFxgQ= =VEeK -----END PGP SIGNATURE----- --=-=-=--