* how to exclude several single dates from a diary block
@ 2022-04-22 14:15 Rainer Thiel
2022-04-22 14:23 ` Eric S Fraga
2022-04-24 8:00 ` Ihor Radchenko
0 siblings, 2 replies; 5+ messages in thread
From: Rainer Thiel @ 2022-04-22 14:15 UTC (permalink / raw)
To: org-mode-email
I use Org-Mode to schedule most everything, including my lectures
which typically are recurring events. I have learnt that I can
exclude a certain range of days or weeks where no lectures take place.
For this, I use:
* TODO 12:15--13:45 Lecture: Aristotle
<%%(unless (diary-block 12 20 2021 12 31 2021) (and (= 3
(calendar-day-of-week date)) (diary-block 10 18 2021 02 11 2022)))>
which means that the lecture on Aristotle is scheduled for every
Wednesday between October 18th, 2021 and February 11th, 2022 – except
for the time between December 20th, 2021 and December 31st, 2021.
What I need to do for this year is to exclude single dates such as
April 26th, 2022 and June 21st, 2022. Can someone please help me how
to achieve this?
Many thanks in advance,
Rainer
--
Prof. Dr. Rainer Thiel
Institut für Altertumswissenschaften
07737 Jena, Germany (EU)
r.thiel@uni-jena.de
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: how to exclude several single dates from a diary block
2022-04-22 14:15 how to exclude several single dates from a diary block Rainer Thiel
@ 2022-04-22 14:23 ` Eric S Fraga
2022-04-22 15:24 ` Rainer Thiel
2022-04-24 8:00 ` Ihor Radchenko
1 sibling, 1 reply; 5+ messages in thread
From: Eric S Fraga @ 2022-04-22 14:23 UTC (permalink / raw)
To: Rainer Thiel; +Cc: org-mode-email
On Friday, 22 Apr 2022 at 16:15, Rainer Thiel wrote:
> I use Org-Mode to schedule most everything, including my lectures
> which typically are recurring events.
Instead of using diary s-expressions, what I do is create one entry for
the first lecture, say, and then use org-clone-subtree-with-time-shift
to create the copies, typically shifted by 1 week. Then I go through
the created entries and delete those weeks that need to be omitted.
Maybe not as elegant but works very well and it's what I've been doing
for years now for my own lectures.
--
: Eric S Fraga, with org release_9.5.3-397-g81289b in Emacs 29.0.50
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: how to exclude several single dates from a diary block
2022-04-22 14:23 ` Eric S Fraga
@ 2022-04-22 15:24 ` Rainer Thiel
0 siblings, 0 replies; 5+ messages in thread
From: Rainer Thiel @ 2022-04-22 15:24 UTC (permalink / raw)
To: Org Mode List
Thanks for the answer. I used to do this, too, and am aware of this
possibility. I find it kind of clutters up the org file and was happy
to find a way to avoid this. I will return to this if I need to, but
would prefer to adapt the more elegant way to do it, if there is a
way.
Many thanks again
Rainer
Am Fr., 22. Apr. 2022 um 16:23 Uhr schrieb Eric S Fraga <e.fraga@ucl.ac.uk>:
>
> On Friday, 22 Apr 2022 at 16:15, Rainer Thiel wrote:
> > I use Org-Mode to schedule most everything, including my lectures
> > which typically are recurring events.
>
> Instead of using diary s-expressions, what I do is create one entry for
> the first lecture, say, and then use org-clone-subtree-with-time-shift
> to create the copies, typically shifted by 1 week. Then I go through
> the created entries and delete those weeks that need to be omitted.
>
> Maybe not as elegant but works very well and it's what I've been doing
> for years now for my own lectures.
>
> --
> : Eric S Fraga, with org release_9.5.3-397-g81289b in Emacs 29.0.50
--
Prof. Dr. Rainer Thiel
Institut für Altertumswissenschaften
07737 Jena, Germany (EU)
r.thiel@uni-jena.de
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: how to exclude several single dates from a diary block
2022-04-22 14:15 how to exclude several single dates from a diary block Rainer Thiel
2022-04-22 14:23 ` Eric S Fraga
@ 2022-04-24 8:00 ` Ihor Radchenko
[not found] ` <CADqAsTkg8skMOUOaoLt7DZHtbxQurFm4J49QB6Qw59Ya8rTTyw@mail.gmail.com>
1 sibling, 1 reply; 5+ messages in thread
From: Ihor Radchenko @ 2022-04-24 8:00 UTC (permalink / raw)
To: r.thiel; +Cc: org-mode-email
Rainer Thiel <r.thiel@uni-jena.de> writes:
> I use Org-Mode to schedule most everything, including my lectures
> which typically are recurring events. I have learnt that I can
> exclude a certain range of days or weeks where no lectures take place.
> For this, I use:
>
> * TODO 12:15--13:45 Lecture: Aristotle
> <%%(unless (diary-block 12 20 2021 12 31 2021) (and (= 3
> (calendar-day-of-week date)) (diary-block 10 18 2021 02 11 2022)))>
>
> What I need to do for this year is to exclude single dates such as
> April 26th, 2022 and June 21st, 2022. Can someone please help me how
> to achieve this?
You can just change
<%%(unless (diary-block 12 20 2021 12 31 2021) ...)>
to
<%%(unless (or (diary-date 04 26 2022) (diary-date 06 21 2022) (diary-block 12 20 2021 12 31 2021)) ...)>
Best,
ihor
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-04-24 15:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-22 14:15 how to exclude several single dates from a diary block Rainer Thiel
2022-04-22 14:23 ` Eric S Fraga
2022-04-22 15:24 ` Rainer Thiel
2022-04-24 8:00 ` Ihor Radchenko
[not found] ` <CADqAsTkg8skMOUOaoLt7DZHtbxQurFm4J49QB6Qw59Ya8rTTyw@mail.gmail.com>
2022-04-24 15:12 ` Fwd: solved: how to exclude several single dates from a diary block (was: how to exclude several single dates from a diary block) Rainer Thiel
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).