emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] lisp/org-expiry.el: Account for org-time-stamp-formats
@ 2022-12-04 19:08 Tom Gillespie
  2022-12-08 11:42 ` Ihor Radchenko
  0 siblings, 1 reply; 8+ messages in thread
From: Tom Gillespie @ 2022-12-04 19:08 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 192 bytes --]

Hi,
   Here is a patch for org-contrib/lisp/org-expiry.el to account for
recent changes to org-time-stamp-formats. Best,
Tom

PS is this list still the best place to send org-contrib patches?

[-- Attachment #2: 0001-lisp-org-expiry.el-Account-for-org-time-stamp-format.patch --]
[-- Type: text/x-patch, Size: 2671 bytes --]

From 2408e92a9c5e155b55a374462d1314aabbe50fe0 Mon Sep 17 00:00:00 2001
From: Tom Gillespie <tgbugs@gmail.com>
Date: Sun, 4 Dec 2022 01:02:35 -0800
Subject: [PATCH] lisp/org-expiry.el: Account for org-time-stamp-formats
 refactor

* lisp/org-expiry.el (org-expiry-insert-created)
(org-expiry-insert-expiry): timestamp formats dropped delimiters so a
slight modification is required following org commit
e3a7c01874c9bb80e04ffa58c578619faf09e7f0, also bump version to 0.3 and
add a dependency on org 9.6 to ensure that the new version of
org-time-stamp-formats is present and users of older versions of org
will not accidentally load the new version
---
 lisp/org-expiry.el | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/lisp/org-expiry.el b/lisp/org-expiry.el
index 98ad58a..d8d604b 100644
--- a/lisp/org-expiry.el
+++ b/lisp/org-expiry.el
@@ -3,9 +3,10 @@
 ;; Copyright 2007-2021 Free Software Foundation, Inc.
 ;;
 ;; Author: Bastien Guerry <bzg@gnu.org>
-;; Version: 0.2
+;; Version: 0.3
 ;; Keywords: org, expiry
 ;; Homepage: https://git.sr.ht/~bzg/org-contrib
+;; Package-Requires: ((org "9.6"))
 
 ;; This file is not part of GNU Emacs.
 
@@ -299,10 +300,11 @@ update the date."
       (setq d-hour (format-time-string "%H:%M" d-time))
       (setq timestr
 	    ;; two C-u prefixes will call org-read-date
-	    (if (equal arg '(16))
-		(concat "<" (org-read-date
-			     nil nil nil nil d-time d-hour) ">")
-	      (format-time-string (cdr org-time-stamp-formats))))
+            (concat "<"
+                    (if (equal arg '(16))
+                        (org-read-date nil nil nil nil d-time d-hour)
+                      (format-time-string (cdr org-time-stamp-formats)))
+                    ">"))
       ;; maybe transform to inactive timestamp
       (if org-expiry-inactive-timestamps
 	  (setq timestr (concat "[" (substring timestr 1 -1) "]")))
@@ -320,10 +322,11 @@ and insert today's date."
     (setq d-time (if d (org-time-string-to-time d)
 		   (current-time)))
     (setq d-hour (format-time-string "%H:%M" d-time))
-    (setq timestr (if today
-		      (format-time-string (cdr org-time-stamp-formats))
-		    (concat "<" (org-read-date
-				 nil nil nil nil d-time d-hour) ">")))
+    (setq timestr (concat "<"
+                          (if today
+                              (format-time-string (cdr org-time-stamp-formats))
+                            (org-read-date nil nil nil nil d-time d-hour))
+                          ">"))
     ;; maybe transform to inactive timestamp
     (if org-expiry-inactive-timestamps
 	(setq timestr (concat "[" (substring timestr 1 -1) "]")))
-- 
2.37.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-12-13  9:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-04 19:08 [PATCH] lisp/org-expiry.el: Account for org-time-stamp-formats Tom Gillespie
2022-12-08 11:42 ` Ihor Radchenko
2022-12-10 21:00   ` Tom Gillespie
2022-12-11  9:21     ` Ihor Radchenko
2022-12-11 21:04       ` Tom Gillespie
2022-12-12  9:40         ` Ihor Radchenko
2022-12-13  1:23           ` Tom Gillespie
2022-12-13  8:59             ` Ihor Radchenko

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).