Browse Source

org-agenda.el (org-agenda-get-todos): Skip diary sexps when trying to sort by timestamp

* org-agenda.el (org-agenda-get-todos): Skip diary sexps when
trying to sort by timestamp.

Thanks to Kyle Machulis for reporting this problem.
Bastien Guerry 5 years ago
parent
commit
3c4847cf67
1 changed files with 3 additions and 1 deletions
  1. 3 1
      lisp/org-agenda.el

+ 3 - 1
lisp/org-agenda.el

@@ -5485,7 +5485,9 @@ the documentation of `org-diary'."
 					      (org-entry-get (point) "TIMESTAMP_IA"))
 				       ts-date-type ""))
 				(t (setq ts-date-type "")))
-			  (when ts (org-time-string-to-absolute ts))))
+			  (when ts (or (ignore-errors (org-time-string-to-absolute ts))
+				       ;; We skip diary sexp because `date' is not bound
+				       (time-to-days nil)))))
 	      category-pos (get-text-property (point) 'org-category-position)
 	      txt (org-trim
 		   (buffer-substring (match-beginning 2) (match-end 0)))