diff options
author | Carsten Dominik <carsten.dominik@gmail.com> | 2008-05-05 17:00:11 +0200 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2008-05-05 17:00:11 +0200 |
commit | 1ade1c7c8b91b7455459fb19798fa1edd12438dc (patch) | |
tree | a116cd68d5a59bf15c8d1f5cb8d216c712575438 | |
parent | e6b87d40b3a70718c96f2ce06a658533804b2b38 (diff) | |
download | org-mode-1ade1c7c8b91b7455459fb19798fa1edd12438dc.tar.gz |
Fix bug with relative date specification.
When there was a lone weekday abbreviation like "fri"
is was interpreted relative to the default date. I think
now this special case should always be relative to today.
This was a bug report from David Kritzberg.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lisp/org.el | 16 |
2 files changed, 14 insertions, 7 deletions
@@ -1,3 +1,8 @@ +2008-05-05 Carsten Dominik <dominik@science.uva.nl> + + * lisp/org.el (org-read-date-analyze): Catch the case where only a + weekday is given. + 2008-05-04 Carsten Dominik <dominik@science.uva.nl> * lisp/org.el (org-set-font-lock-defaults): Make the description diff --git a/lisp/org.el b/lisp/org.el index b8ca189..1335ab3 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -10379,13 +10379,15 @@ WHAT is \"d\", \"w\", \"m\", or \"y\" for day, week, month, year. N is the number of WHATs to shift. DEF-FLAG is t when a double ++ or -- indicates shift relative to the DEFAULT date rather than TODAY." - (when (string-match - (concat - "\\`[ \t]*\\([-+]\\{1,2\\}\\)" - "\\([0-9]+\\)?" - "\\([dwmy]\\|\\(" (mapconcat 'car parse-time-weekdays "\\|") "\\)\\)?" - "\\([ \t]\\|$\\)") s) - (let* ((dir (if (match-end 1) + (when (and + (string-match + (concat + "\\`[ \t]*\\([-+]\\{0,2\\}\\)" + "\\([0-9]+\\)?" + "\\([dwmy]\\|\\(" (mapconcat 'car parse-time-weekdays "\\|") "\\)\\)?" + "\\([ \t]\\|$\\)") s) + (or (> (match-end 1) (match-beginning 1)) (match-end 4))) + (let* ((dir (if (> (match-end 1) (match-beginning 1)) (string-to-char (substring (match-string 1 s) -1)) ?+)) (rel (and (match-end 1) (= 2 (- (match-end 1) (match-beginning 1))))) |