2016-10-31 17:04 GMT-07:00 Nicolas Goaziou <m...@nicolasgoaziou.fr>: > "Bruce V. Chiarelli" <mano...@gmail.com> writes: > >> org-todo calls org-auto-repeat-maybe, which sees the ".+" style >> repeater. It calls org-timestamp-change to move the timestamp up to >> today. Point is left at the closing bracket. So far, so good. >> >> org-timestamp-change sets origin-cat to 'after and origin to (point). >> It then changes the timestamp to today as advertized. >> >> Now these lines get evaluated >> >> (goto-char (cond >> ;; `day' category ends before `hour' if any, or at >> ;; the end of the day name. >> ((eq origin-cat 'day) >> (min (or (match-beginning 7) (- (match-end 5) 2)) origin)) >> ((eq origin-cat 'hour) (min (match-end 7) origin)) >> ((eq origin-cat 'minute) (min (1- (match-end 8)) origin)) >> ((integerp origin-cat) (min (1- (match-end 0)) origin)) >> ;; `year' and `month' have both fixed size: point >> ;; couldn't have moved into another part. >> (t origin)))) >> >> The since origin-cat is 'after, matching nothing else, we get >> (goto-char origin). >> >> This seems to be where the problem lies. When "<2016-10-29 szo .+1>" >> becomes "<2016-10-31 h .+1>" (today), origin is now two characters >> ahead of where it should be, now on the next line in fact. > > I see. Thank you for the analysis. > > Does adding the following branch in the `cond' above, before the > catch-all one, solves the issue? > > ((eq origin-cat 'after) (match-end 0))
It does! Wonderful. -BC