summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2012-09-12 09:48:21 +0200
committerBastien Guerry <bzg@altern.org>2012-09-12 09:48:21 +0200
commitcdc1db5fda8427ecc5eead1a1be99571f71bb71f (patch)
treef79eb622831593e2c547e9b85222ff4c402e7956
parentc5977e7e9d4ccf0c9ed0dde35827dab61f48ff74 (diff)
downloadorg-mode-cdc1db5fda8427ecc5eead1a1be99571f71bb71f.tar.gz
org-agenda.el (org-agenda-bulk-action): Fix bug when bulk-shifting timestamps.
* org-agenda.el (org-agenda-bulk-action): Fix bug when bulk-shifting timestamps. Thanks to Rainer Stengele for reporting this.
-rw-r--r--lisp/org-agenda.el18
1 files changed, 10 insertions, 8 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index b7a8487..7bd7697 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -8958,20 +8958,22 @@ The prefix arg is passed through to the command if possible."
(setq cmd `(org-agenda-set-tags ,tag ,(if (eq action ?+) ''on ''off))))
((memq action '(?s ?d))
- (let* ((date (unless arg
- (or org-overriding-default-time
- (org-read-date
+ (let* ((date
+ (unless arg
+ (or org-overriding-default-time
+ (and (org-read-date
nil nil nil
- (if (eq action ?s) "(Re)Schedule to" "(Re)Set Deadline to")
- nil (format-time-string (car org-time-stamp-formats)
- (org-get-cursor-date))))))
- (ans (if arg nil org-read-date-final-answer))
+ (if (eq action ?s) "(Re)Schedule to" "(Re)Set Deadline to"))
+ (or (ignore-errors
+ (org-time-string-to-time org-read-date-final-answer))
+ (current-time))))))
+ (date (format-time-string (car org-time-stamp-formats) date))
(c1 (if (eq action ?s) 'org-agenda-schedule 'org-agenda-deadline)))
(setq cmd `(let* ((bound (fboundp 'read-string))
(old (and bound (symbol-function 'read-string))))
(unwind-protect
(progn
- (fset 'read-string (lambda (&rest ignore) ,ans))
+ (fset 'read-string (lambda (&rest ignore) ,date))
(eval '(,c1 arg)))
(if bound
(fset 'read-string old)