[PATCH] Accept date and time when specifying delay of a new article
Adam Sjøgren <[email protected]> Mon, 16 Mar 2026 21:13:00 +0100
| Newsgroups | gmane.emacs.gnus.general |
|---|---|
| Organization | koldfront - analysis & revolution, Copenhagen, Denmark |
| Message-ID | <[email protected]> |
* lisp/gnus/gnus-delay.el (gnus-delay-article): also accept YYYY-MM-DD
hh:mm(:ss) as a valid format.
---
lisp/gnus/gnus-delay.el | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/lisp/gnus/gnus-delay.el b/lisp/gnus/gnus-delay.el
index b8fefabacbb..33f7dc7631b 100644
--- a/lisp/gnus/gnus-delay.el
+++ b/lisp/gnus/gnus-delay.el
@@ -70,6 +70,9 @@ gnus-delay-article
* YYYY-MM-DD for a specific date. The time of day is given by the
variable `gnus-delay-default-hour', minute and second are zero.
+* YYYY-MM-DD hh:mm(:ss) for a specific date and time. If seconds are left
+ out, they will be zero.
+
* hh:mm for a specific time. Use 24h format. If it is later than this
time, then the deadline is tomorrow, else today.
@@ -84,6 +87,19 @@ gnus-delay-article
(run-hooks 'message-send-hook)
(let (num unit year month day hour minute deadline) ;; days
(cond ((string-match
+ "\\([0-9][0-9][0-9]?[0-9]?\\)-\\([0-9]+\\)-\\([0-9]+\\) \\([0-9]\\{1,2\\}\\):\\([0-9]\\{2\\}\\):?\\([0-9]\\{2\\}\\)?"
+ delay)
+ (setq year (string-to-number (match-string 1 delay))
+ month (string-to-number (match-string 2 delay))
+ day (string-to-number (match-string 3 delay))
+ hour (string-to-number (match-string 4 delay))
+ minute (string-to-number (match-string 5 delay))
+ second (if (match-string 6 delay) (string-to-number (match-string 6 delay)) 0))
+ (setq deadline
+ (message-make-date
+ (encode-time second minute hour
+ day month year))))
+ ((string-match
"\\([0-9][0-9][0-9]?[0-9]?\\)-\\([0-9]+\\)-\\([0-9]+\\)"
delay)
(setq year (string-to-number (match-string 1 delay))
--
2.47.3
--
"But even if our expectations are close to Adam Sjøgren
non-existent, we must never find ourselves reacting [email protected]
to these continuous betrayals with anything but
rage."