Fix repeated tasks in certain languages

* lisp/org.el (org-timestamp-change): Handle `after' position.

`after' position needs to take into consideration changes in time-stamp
length.  Some time locales have variable lengths for abbreviated day
names throughout the week.

Reported-by: "Bruce V. Chiarelli" <mano155@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/109951>
This commit is contained in:
Nicolas Goaziou 2016-11-01 09:38:56 +01:00
parent 82c98e3caf
commit 58dbdb25a1
1 changed files with 15 additions and 11 deletions

View File

@ -18188,17 +18188,21 @@ When SUPPRESS-TMP-DELAY is non-nil, suppress delays like \"--2d\"."
(goto-char pos))
(save-match-data
(looking-at org-ts-regexp3)
(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) (1- (match-end 5))) 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))))
(goto-char
(pcase origin-cat
;; `day' category ends before `hour' if any, or at the end
;; of the day name.
(`day (min (or (match-beginning 7) (1- (match-end 5))) origin))
(`hour (min (match-end 7) origin))
(`minute (min (1- (match-end 8)) origin))
((pred integerp) (min (1- (match-end 0)) origin))
;; Point was right after the time-stamp. However, the
;; time-stamp length might have changed, so refer to
;; (match-end 0) instead.
(`after (match-end 0))
;; `year' and `month' have both fixed size: point couldn't
;; have moved into another part.
(_ origin))))
;; Update clock if on a CLOCK line.
(org-clock-update-time-maybe)
;; Maybe adjust the closest clock in `org-clock-history'