all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* diary-lib.el how about adding diary-schedule
@ 2021-08-20  9:57 Gijs Hillenius
  2021-08-21 13:09 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Gijs Hillenius @ 2021-08-20  9:57 UTC (permalink / raw)
  To: emacs-devel

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




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

end of thread, other threads:[~2021-08-26 19:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-20  9:57 diary-lib.el how about adding diary-schedule Gijs Hillenius
2021-08-21 13:09 ` 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

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.