diff options
author | Bastien Guerry <bzg@altern.org> | 2012-08-16 09:42:55 +0200 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2012-08-16 09:42:55 +0200 |
commit | d2200b2bede8d596119c97961aefc6e81319234c (patch) | |
tree | 15e708e93fa8b735a8f5e5672a4c80fa8db807ea | |
parent | 76b0d582b8733f63685b441ec8124d6b33e267e1 (diff) | |
download | org-mode-d2200b2bede8d596119c97961aefc6e81319234c.tar.gz |
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.
-rw-r--r-- | lisp/org.el | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lisp/org.el b/lisp/org.el index 6f9aa65..cc5f9f9 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)))) |