Преглед изворни кода

org-agenda.el (org-agenda-bulk-action): Always read the date through `org-read-date'

* org-agenda.el (org-agenda-bulk-action): Always read the date
through `org-read-date'.  When possible, use the date at point
as the default date.

The previous behavior was trying to mimik the previous behavior
we had with `k m' (to mark the item at point) followed by ̀k s'
(to rescheduled it to the date at point, with no question.)

The current behavior always ask for a date/time interactively,
but takes the date at point as the current date, which makes it
fast enough.

Thanks to Nick Dokos for raising concerns about this.
Bastien Guerry пре 12 година
родитељ
комит
795b578ec1
1 измењених фајлова са 6 додато и 18 уклоњено
  1. 6 18
      lisp/org-agenda.el

+ 6 - 18
lisp/org-agenda.el

@@ -8958,26 +8958,14 @@ 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
+	  (let* ((time
 		  (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"))
-			     (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))
+		    (org-read-date
+		     nil nil nil
+		     (if (eq action ?s) "(Re)Schedule to" "(Re)Set Deadline to")
+		     org-overriding-default-time)))
 		 (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) ,date))
-			       (eval '(,c1 arg)))
-			   (if bound
-			       (fset 'read-string old)
-			     (fmakunbound 'read-string)))))))
+	    (setq cmd `(eval '(,c1 arg ,time)))))
 
 	 ((equal action ?S)
 	  (if (not (org-agenda-check-type nil 'agenda 'timeline 'todo))