From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Bruce V. Chiarelli" Subject: Re: Tasks don't repeat correctly if system-time-locale is set to certain languages Date: Mon, 31 Oct 2016 17:29:20 -0700 Message-ID: References: <87a8dkfsou.fsf@nicolasgoaziou.fr> <87wpgodq0q.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49271) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c1MxA-0006st-4o for emacs-orgmode@gnu.org; Mon, 31 Oct 2016 20:29:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c1Mx9-00077I-30 for emacs-orgmode@gnu.org; Mon, 31 Oct 2016 20:29:24 -0400 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]:35246) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c1Mx8-00076c-Re for emacs-orgmode@gnu.org; Mon, 31 Oct 2016 20:29:23 -0400 Received: by mail-wm0-x22e.google.com with SMTP id a197so50598430wmd.0 for ; Mon, 31 Oct 2016 17:29:22 -0700 (PDT) In-Reply-To: <87wpgodq0q.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" To: "Bruce V. Chiarelli" , emacs-orgmode@gnu.org 2016-10-31 17:04 GMT-07:00 Nicolas Goaziou : > "Bruce V. Chiarelli" 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