all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Gijs Hillenius" <gijs@hillenius.net>
To: emacs-devel@gnu.org
Subject: diary-lib.el how about adding diary-schedule
Date: Fri, 20 Aug 2021 11:57:31 +0200	[thread overview]
Message-ID: <87tujkfng4.fsf@hillenius.net> (raw)

Hello

On the emacs wiki¹ I found a useful bit of code that allows adding an
weekly appointment in the diary file between two dates. Something that I
can't do with diary-block or diary-cyclic.

The code on the wiki seems out of date, so I reworked it a tiny bit.


Example:

%%(diary-schedule 15 7 2020 30 6 2021 3) 14:00 some weekly meeting



(defun diary-schedule (m1 d1 y1 m2 d2 y2 dayname)
  "Schedule diary entry.
Entry applies if date is between, or on one of, two dates on
DAYNAME.  The order of the input parameters changes according to
`calendar-date-style' \(e.g. to D1, M1, Y1, D2, M2, Y2 in the
European style)."
  (let ((date1 (calendar-absolute-from-gregorian
                  (diary-make-date m1 d1 y1)) )
        (date2 (calendar-absolute-from-gregorian
                  (diary-make-date m2 d2 y2)))
        (d (calendar-absolute-from-gregorian date)))
    (if (and 
         (<= date1 d) (<= d date2) (= (calendar-day-of-week date) dayname))
        entry)))



Would it be useful to add this to diary-lib.el?




1) https://www.emacswiki.org/emacs/DiaryMode




             reply	other threads:[~2021-08-20  9:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-20  9:57 Gijs Hillenius [this message]
2021-08-21 13:09 ` diary-lib.el how about adding diary-schedule Lars Ingebrigtsen
2021-08-22  7:33   ` Gijs Hillenius
2021-08-22 21:59     ` Lars Ingebrigtsen
2021-08-24 14:37     ` Michael Heerdegen
2021-08-25  7:39       ` Gijs Hillenius
2021-08-25 10:55         ` Michael Heerdegen
2021-08-26 15:22         ` Michael Heerdegen
2021-08-26 19:48           ` Lars Ingebrigtsen

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tujkfng4.fsf@hillenius.net \
    --to=gijs@hillenius.net \
    --cc=emacs-devel@gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.