From: Paul Eggert <eggert@cs.ucla.edu>
To: Mark Barton <mbarton98@gmail.com>,
emacs-devel@gnu.org, emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: master 4a1f69ebca 2/2: Use (TICKS . HZ) for current-time etc.
Date: Wed, 27 Apr 2022 00:39:01 -0700 [thread overview]
Message-ID: <f200c9ab-d1d4-d5a8-24cf-4e1082528fe7@cs.ucla.edu> (raw)
In-Reply-To: <BF5B9308-3FEF-4DC6-98C9-BFF36F19D36C@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 246 bytes --]
Thanks for reporting that. Fixed in Emacs master via the attached.
For the more general issue I'm planning to add a builtin boolean
variable current-time-list soon, that is t for (HIGH LOW MICROSEC
PICOSEC) format, nil for (TICKS . HZ) format.
[-- Attachment #2: 0001-Use-org-time-convert-to-integer-instead-of-by-hand.patch --]
[-- Type: text/x-patch, Size: 1623 bytes --]
From 3abb3681b57d7c8ca7fa808addb0a10b6b109cab Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Wed, 27 Apr 2022 00:29:26 -0700
Subject: [PATCH] Use org-time-convert-to-integer instead of by hand
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* lisp/org/org-macs.el (org-file-newer-than-p):
Don’t assume list-format timestamps, by using
org-time-convert-to-integer instead of doing it by hand.
---
lisp/org/org-macs.el | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/lisp/org/org-macs.el b/lisp/org/org-macs.el
index b10725bd52..92591b5bb7 100644
--- a/lisp/org/org-macs.el
+++ b/lisp/org/org-macs.el
@@ -257,15 +257,16 @@ org-fit-window-to-buffer
(defun org-file-newer-than-p (file time)
"Non-nil if FILE is newer than TIME.
-FILE is a filename, as a string, TIME is a list of integers, as
+FILE is a filename, as a string, TIME is a Lisp time value, as
returned by, e.g., `current-time'."
(and (file-exists-p file)
;; Only compare times up to whole seconds as some file-systems
;; (e.g. HFS+) do not retain any finer granularity. As
;; a consequence, make sure we return non-nil when the two
;; times are equal.
- (not (time-less-p (cl-subseq (nth 5 (file-attributes file)) 0 2)
- (cl-subseq time 0 2)))))
+ (not (time-less-p (org-time-convert-to-integer
+ (nth 5 (file-attributes file)))
+ (org-time-convert-to-integer time)))))
(defun org-compile-file (source process ext &optional err-msg log-buf spec)
"Compile a SOURCE file using PROCESS.
--
2.32.0
next prev parent reply other threads:[~2022-04-27 7:41 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-27 6:37 master 4a1f69ebca 2/2: Use (TICKS . HZ) for current-time etc Mark Barton
2022-04-27 7:20 ` Po Lu
2022-04-27 7:39 ` Paul Eggert [this message]
2022-04-27 16:55 ` Stefan Monnier
2022-04-28 22:27 ` Paul Eggert
2022-04-29 14:22 ` Max Nikulin
2022-04-29 18:10 ` Paul Eggert
2022-04-30 10:56 ` Max Nikulin
2022-05-06 16:56 ` [PATCH] org-macs.el: Do not compare wall time and file modification time Max Nikulin
2022-05-11 12:28 ` Max Nikulin
2022-05-11 16:24 ` Paul Eggert
2022-05-12 16:55 ` Max Nikulin
2022-05-12 22:52 ` Paul Eggert
2022-05-13 12:28 ` Max Nikulin
2022-05-13 18:00 ` Paul Eggert
2022-10-02 3:49 ` Ihor Radchenko
2022-10-09 8:18 ` [PATCH v2] " Max Nikulin
2022-10-21 3:27 ` Ihor Radchenko
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=f200c9ab-d1d4-d5a8-24cf-4e1082528fe7@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=emacs-devel@gnu.org \
--cc=emacs-orgmode@gnu.org \
--cc=mbarton98@gmail.com \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public 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).