Hi Charles,

Thanks for reporting this, and sorry it’s taken so long for someone to respond
(it’s been a busy year for the maintainers).

I’ve confirmed both your issue report (thanks for the detailed steps), and your
suggested fix. As such, I’ve produced a patch (attached). It would be good if
someone else could check this looks fine and apply it.

All the best,
Timothy
>From 9ecd0a9266338d7222281c7ccb16808c319646aa Mon Sep 17 00:00:00 2001
From: TEC <t...@tecosaur.com>
Date: Thu, 30 Dec 2021 17:16:29 +0800
Subject: [PATCH] org-agenda: Make timestamp ordering match docs

* lisp/org-agenda.el: When `org-agenda-sort-notime-is-late' is non-nil,
an absent timestamp is now (correctly) treated as maximal.

Bug reported by: Charles Tam <m...@charlest.net> in
https://list.orgmode.org/caku+9yvnpshg4hvtpfa2l2tp6ybdjj38teyr8osdmcg0zeo...@mail.gmail.com
---
 lisp/org-agenda.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 721ef2ced..4321a4f0b 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -7729,7 +7729,7 @@ (defsubst org-cmp-ts (a b type)
 \"timestamp_ia\", compare within each of these type.  When TYPE
 is the empty string, compare all timestamps without respect of
 their type."
-  (let* ((def (and (not org-agenda-sort-notime-is-late) -1))
+  (let* ((def (if org-agenda-sort-notime-is-late 99999999 -1))
 	 (ta (or (and (string-match type (or (get-text-property 1 'type a) ""))
 		      (get-text-property 1 'ts-date a))
 		 def))
-- 
2.34.1

Reply via email to