bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#50195: [PATCH] Adding diary-offset, a diary-sexp offsetting another


From: Michael Heerdegen
Subject: bug#50195: [PATCH] Adding diary-offset, a diary-sexp offsetting another diary-sexp.
Date: Thu, 26 Aug 2021 12:26:46 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Yuchen Pei <hi@ypei.me> writes:

> A bit like diary-remind, as a diary-sexp rather than reminder, and
> also support both positive and negative offsets.

Because we are just talking about it: my personal solution for this kind
of problem: I extended the diary language with some date arithmetic
functions and a `date-let' macro, that allows you to solve the same task
like

  (date-let ((date+ date 2))
    SEXP)

An advantage is that this saves one layer of `eval', and it allows the
delta of days to be an expression (that might depend on the DATE).

I also worked on finer grained solutions for the problems of the kind
"every Nth Xday of the month unless it's a day that fulfills some TEST
(e.g., it's a holiday), then use an alternative date.  Useful for
specifying rules for garbage collection (real-life garbage, not Emacs
gc).

I planned to provide these things as a separate library, and I'm not
against what has been supposed here, just wanted to mention an
alternative view on the problem.

Michael.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]