* lisp/org.el (org-get-repeat): Wrap call to save match data against side effects. * testing/lisp/test-org.el (test-org/get-repeat): New test for `org-get-repeat'.
@@ -13204,7 +13204,7 @@ on INACTIVE-OK."
org-repeat-re)))
(catch :repeat
(while (re-search-forward regexp end t)
- (when (org-at-timestamp-p)
+ (when (save-match-data (org-at-timestamp-p))
(throw :repeat (match-string-no-properties 1)))))))))
(defvar org-last-changed-timestamp)
@@ -400,6 +400,11 @@
(org-test-with-temp-text "* DONE Heading"
(should-not (org-deadline-close-p "2016-06-03"))))))
+(ert-deftest test-org/get-repeat ()
+ (org-test-with-temp-text
+ "* H\nSCHEDULED: <2017-02-03 Fri .+23d>"
+ (should (string= ".+23d" (org-get-repeat)))))
+
;;; Drawers