summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2016-11-29 23:55:15 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2016-11-29 23:55:15 +0100
commitba06303016ef84ca21311201478393e695a9dc3f (patch)
tree16dfdf47324f578abf5f6b115da3874c02af132f
parentf5916c4fbb6cd859b179b90489f2eb5b8da65e33 (diff)
downloadorg-mode-ba06303016ef84ca21311201478393e695a9dc3f.tar.gz
org-agenda: Fix time of day presence
* lisp/org-agenda.el (org-agenda-get-deadlines): Small refactoring. (org-agenda-get-scheduled): Do no insert a time of day when current entry is only a reminder of a previously scheduled task. Reported-by: Matt Lundin <mdl@imapmail.org> <http://permalink.gmane.org/gmane.emacs.orgmode/110517>
-rw-r--r--lisp/org-agenda.el28
1 files changed, 18 insertions, 10 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index aed19e2..f7af31b 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -6128,10 +6128,14 @@ specification like [h]h:mm."
(memq 'agenda
org-agenda-use-tag-inheritance)))))
(tags (org-get-tags-at nil (not inherited-tags)))
- (timestr
- (if (string-match " \\([012]?[0-9]:[0-9][0-9]\\)" s)
- (concat (substring s (match-beginning 1)) " ")
- 'time))
+ (time
+ (cond
+ ;; No time of day designation if it is only
+ ;; a reminder.
+ ((and (/= current deadline) (/= current repeat)) nil)
+ ((string-match " \\([012]?[0-9]:[0-9][0-9]\\)" s)
+ (concat (substring s (match-beginning 1)) " "))
+ (t 'time)))
(item
(org-agenda-format-item
;; Insert appropriate suffixes before deadlines.
@@ -6149,7 +6153,7 @@ specification like [h]h:mm."
(t (format future diff))))
head level category tags
(and (or (= repeat current) (= deadline current))
- timestr)))
+ time)))
(face (org-agenda-deadline-face
(- 1 (/ (float (- deadline current)) (max wdays 1)))))
(upcoming? (and today? (> deadline today)))
@@ -6329,10 +6333,14 @@ scheduled items with an hour specification like [h]h:mm."
(level
(make-string (org-reduced-level (org-outline-level)) ?\s))
(head (buffer-substring (point) (line-end-position)))
- (timestr
- (if (string-match " \\([012]?[0-9]:[0-9][0-9]\\)" s)
- (concat (substring s (match-beginning 1)) " ")
- 'time))
+ (time
+ (cond
+ ;; No time of day designation if it is only
+ ;; a reminder.
+ ((and (/= current schedule) (/= current repeat)) nil)
+ ((string-match " \\([012]?[0-9]:[0-9][0-9]\\)" s)
+ (concat (substring s (match-beginning 1)) " "))
+ (t 'time)))
(item
(org-agenda-format-item
(pcase-let ((`(,first ,next) org-agenda-scheduled-leaders))
@@ -6350,7 +6358,7 @@ scheduled items with an hour specification like [h]h:mm."
;; Subsequent reminders. Count from base
;; schedule.
(t (format next (1+ diff)))))
- head level category tags timestr nil habitp))
+ head level category tags time nil habitp))
(face (cond ((and (not habitp) (< current today))
'org-scheduled-previously)
(todayp 'org-scheduled-today)