소스 검색

Fix: keep repeaters at rescheduling

* lisp/org.el (org--deadline-or-schedule): Removed a blank in a regexp.
* testing/lisp/test-org.el (test-org/schedule): New test.
Marco Wahl 8 년 전
부모
커밋
39682d4854
2개의 변경된 파일11개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      lisp/org.el
  2. 10 1
      testing/lisp/test-org.el

+ 1 - 1
lisp/org.el

@@ -13459,7 +13459,7 @@ TYPE is either `deadline' or `scheduled'.  See `org-deadline' or
 			    (string-match org-repeat-re time)
 			    (match-string 1 time))
 		       (and (org-string-nw-p old-date)
-			    (string-match "\\([.+-]+[0-9]+ [hdwmy]\
+			    (string-match "\\([.+-]+[0-9]+[hdwmy]\
 \\(?:[/ ][-+]?[0-9]+[hdwmy]\\)?\\)"
 					  old-date)
 			    (match-string 1 old-date)))))

+ 10 - 1
testing/lisp/test-org.el

@@ -4227,7 +4227,16 @@ Paragraph<point>"
 	      (goto-char (point-max))
 	      (org-schedule nil "2012-03-29"))
 	    (replace-regexp-in-string
-	     "\\( [.A-Za-z]+\\)>" "" (buffer-string) nil nil 1)))))
+	     "\\( [.A-Za-z]+\\)>" "" (buffer-string) nil nil 1))))
+  (should
+   ;; check if a repeater survives re-scheduling.
+   (string-match-p
+    "\\* H\nSCHEDULED: <2017-02-01 [.A-Za-z]* \\+\\+7d>\n"
+    (org-test-with-temp-text "* H\nSCHEDULED: <2017-01-19 ++7d>\n"
+			     (let ((org-adapt-indentation nil)
+				   (org-last-inserted-timestamp nil))
+			       (org-schedule nil "2017-02-01"))
+			     (buffer-string)))))
 
 
 ;;; Property API