emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Timothy <tecosaur@gmail.com>
To: Charles Tam <me@charlest.net>
Cc: emacs-orgmode@gnu.org
Subject: [PATCH] Re: Bug: org-agenda-sort-notime-is-late is not correctly handled by timestamp comparison [9.4.6 (9.4.6-12-gdcc3a8-elpaplus @ /Users/charlestam/.emacs.d/elpa/org-plus-contrib-20210830/)]
Date: Thu, 30 Dec 2021 17:20:24 +0800	[thread overview]
Message-ID: <87r19uqwew.fsf@gmail.com> (raw)
In-Reply-To: <CAKu+9YVNPSHG4HVtPFa2L2tP6yBdjJ38Teyr8OSDmCg0ZEOe9Q@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 393 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 26003 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org-agenda-Make-timestamp-ordering-match-docs.patch --]
[-- Type: text/x-patch, Size: 1155 bytes --]

From 9ecd0a9266338d7222281c7ccb16808c319646aa Mon Sep 17 00:00:00 2001
From: TEC <tec@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 <me@charlest.net> in
https://list.orgmode.org/CAKu+9YVNPSHG4HVtPFa2L2tP6yBdjJ38Teyr8OSDmCg0ZEOe9Q@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	other threads:[~2021-12-30  9:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-02  4:47 Charles Tam
2021-12-30  9:20 ` Timothy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r19uqwew.fsf@gmail.com \
    --to=tecosaur@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=me@charlest.net \
    --subject='[PATCH] Re: Bug: org-agenda-sort-notime-is-late is not correctly handled by timestamp comparison [9.4.6 (9.4.6-12-gdcc3a8-elpaplus @ /Users/charlestam/.emacs.d/elpa/org-plus-contrib-20210830/)]' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).