summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2017-02-01 22:36:29 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2017-02-01 22:36:29 +0100
commit32972979c75ac991545a4467832084a93d79cd5d (patch)
tree69a1cd66ee0b4fa47ce2356b07291ec329921d57
parent73330079c0ef4d7294500155a8df061398915e7b (diff)
downloadorg-mode-32972979c75ac991545a4467832084a93d79cd5d.tar.gz
org-agenda: Fix scheduled and deadline S-exp entries display
* lisp/org-agenda.el (org-agenda-get-deadlines): (org-agenda-get-scheduled): Properly handle S-exp entries. Reported-by: Ken Mankoff <mankoff@gmail.com> <http://permalink.gmane.org/gmane.emacs.orgmode/111805>
-rw-r--r--lisp/org-agenda.el42
1 files changed, 25 insertions, 17 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 9df854a..b17efe8 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -6069,19 +6069,24 @@ specification like [h]h:mm."
(show-all (or (eq org-agenda-repeating-timestamp-show-all t)
(member todo-state
org-agenda-repeating-timestamp-show-all)))
+ (sexp? (string-prefix-p "%%" s))
;; DEADLINE is the bare deadline date, i.e., without
;; any repeater, or the last repeat if SHOW-ALL is
;; non-nil. REPEAT is closest repeat after CURRENT, if
;; all repeated time stamps are to be shown, or after
;; TODAY otherwise. REPEAT only applies to future
;; dates.
- (deadline (if show-all (org-agenda--timestamp-to-absolute s)
- (org-agenda--timestamp-to-absolute
- s today 'past (current-buffer) pos)))
- (repeat
- (if (< current today) deadline
- (org-agenda--timestamp-to-absolute
- s (if show-all current today) 'future (current-buffer) pos)))
+ (deadline (cond
+ (sexp? (org-agenda--timestamp-to-absolute s current))
+ (show-all (org-agenda--timestamp-to-absolute s))
+ (t (org-agenda--timestamp-to-absolute
+ s today 'past (current-buffer) pos))))
+ (repeat (cond (sexp? deadline)
+ ((< current today) deadline)
+ (t
+ (org-agenda--timestamp-to-absolute
+ s (if show-all current today) 'future
+ (current-buffer) pos))))
(diff (- deadline current))
(suppress-prewarning
(let ((scheduled
@@ -6234,22 +6239,25 @@ scheduled items with an hour specification like [h]h:mm."
(show-all (or (eq org-agenda-repeating-timestamp-show-all t)
(member todo-state
org-agenda-repeating-timestamp-show-all)))
+ (sexp? (string-prefix-p "%%" s))
;; SCHEDULE is the bare scheduled date, i.e., without
;; any repeater if non-nil, or last repeat if SHOW-ALL
;; is nil. REPEAT is the closest repeat after CURRENT,
;; if all repeated time stamps are to be shown, or
;; after TODAY otherwise. REPEAT only applies to
;; future dates.
- (schedule (if show-all (org-agenda--timestamp-to-absolute s)
- (org-agenda--timestamp-to-absolute
- s today 'past (current-buffer) pos)))
- (repeat (cond ((< current today) schedule)
- (show-all
- (org-agenda--timestamp-to-absolute
- s current 'future (current-buffer) pos))
- (t
- (org-agenda--timestamp-to-absolute
- s today 'future (current-buffer) pos))))
+ (schedule (cond
+ (sexp? (org-agenda--timestamp-to-absolute s current))
+ (show-all (org-agenda--timestamp-to-absolute s))
+ (t (org-agenda--timestamp-to-absolute
+ s today 'past (current-buffer) pos))))
+ (repeat (cond
+ (sexp? schedule)
+ ((< current today) schedule)
+ (t
+ (org-agenda--timestamp-to-absolute
+ s (if show-all current today) 'future
+ (current-buffer) pos))))
(diff (- current schedule))
(warntime (get-text-property (point) 'org-appt-warntime))
(pastschedp (< schedule today))