diff --git a/lisp/org.el b/lisp/org.el index 99dbdc14b..500a8c8e3 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -14813,17 +14813,16 @@ If there is a specifyer for a cyclic time stamp, get the closest date to DAYNR. PREFER and SHOW-ALL are passed through to `org-closest-date'. the variable date is bound by the calendar when this is called." - (let ((today (calendar-absolute-from-gregorian (calendar-current-date)))) - (cond - ((and daynr (string-match "\\`%%\\((.*)\\)" s)) - (if (org-diary-sexp-entry (match-string 1 s) "" date) - daynr - (+ daynr 1000))) - ((and daynr (not (eq daynr today)) (string-match "\\+[0-9]+[dwmy]" s)) - (org-closest-date s (if (and (boundp 'daynr) (integerp daynr)) daynr - (time-to-days (current-time))) (match-string 0 s) - prefer show-all)) - (t (time-to-days (apply 'encode-time (org-parse-time-string s))))))) + (cond + ((and daynr (string-match "\\`%%\\((.*)\\)" s)) + (if (org-diary-sexp-entry (match-string 1 s) "" date) + daynr + (+ daynr 1000))) + ((and daynr (string-match "\\+[0-9]+[dwmy]" s)) + (org-closest-date s (if (and (boundp 'daynr) (integerp daynr)) daynr + (time-to-days (current-time))) (match-string 0 s) + prefer show-all)) + (t (time-to-days (apply 'encode-time (org-parse-time-string s)))))) (defun org-days-to-iso-week (days) "Return the iso week number."