[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [PATCH] org-closest-date: Don't accept canceled repeater
From: |
Kyle Meyer |
Subject: |
Re: [O] [PATCH] org-closest-date: Don't accept canceled repeater |
Date: |
Wed, 15 Jul 2015 21:50:13 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Rasmus <address@hidden> wrote:
> Kyle Meyer <address@hidden> writes:
>> ** TODO h
>> DEADLINE: <2015-07-13 Mon +3w>
>>
>> and I run org-todo with a numeric prefix of -1, the repeater is canceled
>> by changing it to +0w:
>
> I see. Shouldn't org-todo rather remove the repeater?
That seems fine to me. I wonder if there was a particular reason the
original code set it to 0 instead.
>> (+ daynr 1000)))
>> - ((and daynr (string-match "\\+[0-9]+[hdwmy]" s))
>> + ((and daynr (not (string-match "\\+0[hdwmy]" s))
>> + (string-match "\\+[0-9]+[hdwmy]" s))
>
> for no particular reason I prefer:
>
> (and daynr (string-match "\\+\\([0-9]+\\)[hdwmy]" s)
> (> (string-to-number (match-string 1)) 0))
I do too (though I think s should be added to the match-string call).
>> - (setq dn (string-to-number (match-string 1 change))
>> - dw (cdr (assoc (match-string 2 change) a1)))
>> + (when (string-match "\\(\\+[0-9]+\\)\\([hdwmy]\\)" change)
>> + (setq dn (string-to-number (match-string 1 change))
>> + dw (cdr (assoc (match-string 2 change) a1))))
>> + (unless (wholenump dn)
>
> Shouldn'it it also test that dn > 0?
Doh, it should.
I've attached an updated patch. Thanks for your comments.
0001-org-closest-date-Don-t-accept-canceled-repeater.patch
Description: Text Data
--
Kyle