Rasmus wrote: > Kyle Meyer 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.