From d2200b2bede8d596119c97961aefc6e81319234c Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Thu, 16 Aug 2012 09:42:55 +0200 Subject: [PATCH] org.el: Allow both "8am Wed" and "Wed 8am" to be parsed correctly * org.el (org-read-date-analyze): Allow both "8am Wed" and "Wed 8am" to be parsed correctly with respect to possible values of `org-read-date-prefer-future'. (org-read-date-prefer-future): Update docstring to remove the restriction about inserting only the time. The user can now insert the time and the day. --- lisp/org.el | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 6f9aa6520..cc5f9f90b 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -2752,8 +2752,8 @@ This affects the following situations: If you set this variable to the symbol `time', then also the following will work: -3. If the user gives a time, but no day. If the time is before now, - to will be interpreted as tomorrow. +3. If the user gives a time. + If the time is before now, it will be interpreted as tomorrow. Currently none of this works for ISO week specifications. @@ -15557,10 +15557,11 @@ user." (setq ans "+0")) (when (setq delta (org-read-date-get-relative ans (current-time) org-def)) - (setq ans (replace-match "" t t ans) - deltan (car delta) - deltaw (nth 1 delta) - deltadef (nth 2 delta))) + (unless (save-match-data (string-match org-plain-time-of-day-regexp ans)) + (setq ans (replace-match "" t t ans) + deltan (car delta) + deltaw (nth 1 delta) + deltadef (nth 2 delta)))) ;; Check if there is an iso week date in there ;; If yes, store the info and postpone interpreting it until the rest @@ -15713,7 +15714,6 @@ user." ((equal deltaw "m") (setq month (+ month deltan))) ((equal deltaw "y") (setq year (+ year deltan))))) ((and wday (not (nth 3 tl))) - (setq futurep nil) ;; Weekday was given, but no day, so pick that day in the week ;; on or after the derived date. (setq wday1 (nth 6 (decode-time (encode-time 0 0 0 day month year))))