Re: [PATCH] Accept date and time when specifying delay of a new article

Sean Whitton <[email protected]> Wed, 18 Mar 2026 18:58:26 +0000
Newsgroups gmane.emacs.gnus.general
Message-ID <[email protected]>
You need to send this attached to a bug report to [email protected]

Adam Sj=C3=B8gren <[email protected]> [16/Mar  9:13pm +01] wrote:
> * 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.
>=20=20
> +* 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.
>=20=20
> @@ -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 (ma=
tch-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))
> --=20
> 2.47.3

--=20
Sean Whitton