summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2017-01-17 21:22:11 -0500
committerKyle Meyer <kyle@kyleam.com>2017-01-17 21:22:11 -0500
commitc3d67b3556c8184cdaf2e8ac999acc702e9d2c5f (patch)
treef5d5699d7b7c475c85b27a2b6034e5785c7f7013
parent69b22b6590357ab0bdd8a90793b2322d4a789bbd (diff)
parent1fbc7a424f703f86235c4c5b30caab6604b8feb7 (diff)
downloadorg-mode-c3d67b3556c8184cdaf2e8ac999acc702e9d2c5f.tar.gz
Merge branch 'maint'
-rw-r--r--lisp/org.el8
-rw-r--r--testing/lisp/test-org.el10
2 files changed, 13 insertions, 5 deletions
diff --git a/lisp/org.el b/lisp/org.el
index c8efe24..9e993e3 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -8903,10 +8903,10 @@ with the original repeater."
"Date shift per clone (e.g. +1w, empty to copy unchanged): ")
""))) ;No time shift
(doshift
- (or (not (org-string-nw-p shift))
- (string-match "\\`[ \t]*\\+?\\([0-9]+\\)\\([dwmy]\\)[ \t]*\\'"
- shift)
- (user-error "Invalid shift specification %s" shift))))
+ (and (org-string-nw-p shift)
+ (or (string-match "\\`[ \t]*\\+?\\([0-9]+\\)\\([dwmy]\\)[ \t]*\\'"
+ shift)
+ (user-error "Invalid shift specification %s" shift)))))
(goto-char end-of-tree)
(unless (bolp) (insert "\n"))
(let* ((end (point))
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index 1de9bf0..49e9477 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -1376,6 +1376,14 @@
(replace-regexp-in-string
"\\( [.A-Za-z]+\\)\\( \\+[0-9][hdmwy]\\)?>" "" (buffer-string)
nil nil 1))))
+ ;; Clone with blank SHIFT argument.
+ (should
+ (string-prefix-p
+ "* H <2012-03-29"
+ (org-test-with-temp-text "* H <2012-03-29 Thu><point>"
+ (org-clone-subtree-with-time-shift 1 "")
+ (buffer-substring-no-properties (line-beginning-position 2)
+ (line-end-position 2)))))
;; Find time stamps before point. If SHIFT is not specified, ask
;; for a time shift.
(should
@@ -1391,7 +1399,7 @@
(org-test-with-temp-text "* H <2014-03-04 Tue><point>"
(cl-letf (((symbol-function 'read-from-minibuffer)
(lambda (&rest args) "+1d")))
- (org-clone-subtree-with-time-shift 1 "+1d"))
+ (org-clone-subtree-with-time-shift 1))
(buffer-substring-no-properties (line-beginning-position 2)
(line-end-position 2))))))