unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* sexp and icalendar-export-file
@ 2021-05-23  4:12 Andreas Gösele
  2021-05-24  4:03 ` Andreas Gösele
  0 siblings, 1 reply; 7+ messages in thread
From: Andreas Gösele @ 2021-05-23  4:12 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

in my diary file I rely heavily on expressions like

%%(and (= (calendar-day-of-week date) 3) (diary-block 20 4 2020 24 7
       2020) (not (or (diary-date 1 5 2020) (diary-date 21 5 2020)
       (diary-date 1 6 2020) (diary-date 2 6 2020) (diary-date 11 6
       2020)))) 8:00-10:00 Some important event

This works well in the Calendar.

But it doesn't work with icalendar-export-file.

I guess it is one of the "self-made sexp entries" that "are not
understood" as per icalendar.el

Is there any way I could export something like this into an icalendar
file?

Or is there any way I could achieve the same thing with another kind of
expression which can be exported? (Of course, I don't want to list the
single dates!)

Basically the expressions combines a week day, a diary block and some
exceptions. (Actually I also use sexp expressions which combine two or
three weekdays, a diary block and exceptions, but I could live without
that.)

Thanks a lot!

Andreas




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

* Re: sexp and icalendar-export-file
  2021-05-23  4:12 sexp and icalendar-export-file Andreas Gösele
@ 2021-05-24  4:03 ` Andreas Gösele
  2021-05-24  7:03   ` Jean Louis
                     ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Andreas Gösele @ 2021-05-24  4:03 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

a follow up to my last post.

I tried whether a detour through org-mode could provide a
solution. Inspired by
https://mattduck.github.io/generic-css/demo/org-demo.html I created an
org file with the following contend:

** Class 8:15am-10:00am
   <%%(org-class 2021 1 1 2021 5 30 1 14)> Class

* Weekly meeting with boss
  <2021-01-19 Tue  14:00 +1w>

** Class 7:00pm-9:00pm
   <%%(and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2021 4 20 2021))>

Executing "org-agenda a" results in an agenda view which includes the
first class entry and the Weekly meeting. The second Class entry doesn't
appear. I don't get any error messages.

When I execute "org-icalendar-export-agenda-files" I get an ics file
with only the Weekly meeting with the boss and an error message in the
*icalendar-errors* buffer:

Error in line 0 -- (end-of-file): ‘%%(and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2021 4 20 2021)) Class 7:00pm-9:00pm’

I also get 14 times the warning:

Error (diary): Bad diary sexp at line 1 in ~/.emacs.d/diary:
(= 1 (calendar-day-of-week date)
Error: (end-of-file)

This is the same kind of warning I get when I try to export my diary
file with corresponding sexps directly. Is
"org-icalendar-export-agenda-files" using or build on
icalendar-export-file?

So, do I conclude correctly, that even using org-mode and its agenda
will not allow me to export more complicated sexps (the second Class one
doesn't even work with agenda views) or an org-class entry to an ics
file?

Thanks a lot

Andreas




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

* Re: sexp and icalendar-export-file
  2021-05-24  4:03 ` Andreas Gösele
@ 2021-05-24  7:03   ` Jean Louis
  2021-05-24  7:11   ` Jean Louis
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Jean Louis @ 2021-05-24  7:03 UTC (permalink / raw)
  To: Andreas Gösele; +Cc: help-gnu-emacs

* Andreas Gösele <goesele@hfph.mwn.de> [2021-05-24 07:09]:
> Hi,
> 
> a follow up to my last post.
> 
> I tried whether a detour through org-mode could provide a
> solution. Inspired by
> https://mattduck.github.io/generic-css/demo/org-demo.html I created an
> org file with the following contend:
> 
> ** Class 8:15am-10:00am
>    <%%(org-class 2021 1 1 2021 5 30 1 14)> Class
> 
> * Weekly meeting with boss
>   <2021-01-19 Tue  14:00 +1w>
> 
> ** Class 7:00pm-9:00pm
>    <%%(and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2021
>    4 20 2021))>

Just as a side note, none of the above I find user friendly as data is
simply not enough structured, it is not easy to work with it.

In the first heading there is time specified "Class 8:15am-10:00am",
in the second it is about "meeting with the boss" without
time. Then there is the URL with org-demo.html explaining all the
anti-feature in a hype mode like it is universally useful planning
application, well I say it is as usable as any text editing
application with addition of attempts to make it structural.

I can see here:
https://mattduck.github.io/generic-css/demo/org-demo.html#automatic-reminders

** 10:00am Get dried ice at the magic store
   SCHEDULED: <2009-05-27 Wed>

So one puts time in heading, as there is no rule, but not in
scheduled? Even though SCHEDULED does allow the time as below.

** 10:00am Get dried ice at the magic store
   SCHEDULED: <2009-05-27 Wed 10:00>

Either of those should work... and user is supposed either not to to
know or to know it...

IMHO, until user comes to proper planning, so much time will pass just
to learn the fallacies of the Org mode.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/



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

* Re: sexp and icalendar-export-file
  2021-05-24  4:03 ` Andreas Gösele
  2021-05-24  7:03   ` Jean Louis
@ 2021-05-24  7:11   ` Jean Louis
  2021-05-24 10:52   ` Michael Heerdegen
  2021-05-24 19:13   ` Andreas Gösele
  3 siblings, 0 replies; 7+ messages in thread
From: Jean Louis @ 2021-05-24  7:11 UTC (permalink / raw)
  To: Andreas Gösele; +Cc: help-gnu-emacs

* Andreas Gösele <goesele@hfph.mwn.de> [2021-05-24 07:09]:

** Class 8:15am-10:00am
   <%%(org-class 2021 1 1 2021 5 30 1 14)> Class

* Weekly meeting with boss
  <2021-01-19 Tue  14:00 +1w>

** Class 7:00pm-9:00pm
   <%%(and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2021 4 20 2021))>

> Executing "org-agenda a" results in an agenda view which includes the
> first class entry and the Weekly meeting. The second Class entry doesn't
> appear. I don't get any error messages.
> 
> When I execute "org-icalendar-export-agenda-files" I get an ics file
> with only the Weekly meeting with the boss and an error message in the
> *icalendar-errors* buffer:

It is expression and thus conditional, maybe that is why it does not
appear. Your first condition is that the day of week has to be first (1).


-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/



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

* Re: sexp and icalendar-export-file
  2021-05-24  4:03 ` Andreas Gösele
  2021-05-24  7:03   ` Jean Louis
  2021-05-24  7:11   ` Jean Louis
@ 2021-05-24 10:52   ` Michael Heerdegen
  2021-05-24 11:30     ` Michael Heerdegen
  2021-05-24 19:13   ` Andreas Gösele
  3 siblings, 1 reply; 7+ messages in thread
From: Michael Heerdegen @ 2021-05-24 10:52 UTC (permalink / raw)
  To: help-gnu-emacs

Andreas Gösele <goesele@hfph.mwn.de> writes:

> ** Class 8:15am-10:00am
>    <%%(org-class 2021 1 1 2021 5 30 1 14)> Class
>
> * Weekly meeting with boss
>   <2021-01-19 Tue  14:00 +1w>
>
> ** Class 7:00pm-9:00pm
>    <%%(and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2021 4 20 2021))>
>
> Executing "org-agenda a" results in an agenda view which includes the
> first class entry and the Weekly meeting. The second Class entry doesn't
> appear. I don't get any error messages.

I can only answer that org related part of the question: if you want to
let special diary entries appear in the agenda, these _must_ evaluate to
a string (or nil), and that string will be used as headline displayed in
the agenda.  The given headline is silently ignored, AFAIK.  The
advantage is that you can generate headlines dynamically in the diary
sexp.

Org could be smarter and use the given static headline when the diary
sexp returns a non-nil value that is not a string, but that isn't the
case, unfortunately.

I only know that because I asked the question in the org mailing list,
some months ago.  You might look there for the answers I got for more
background.

I dunno whether this also effects icalendar export.


Regards,

Michael.




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

* Re: sexp and icalendar-export-file
  2021-05-24 10:52   ` Michael Heerdegen
@ 2021-05-24 11:30     ` Michael Heerdegen
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Heerdegen @ 2021-05-24 11:30 UTC (permalink / raw)
  To: help-gnu-emacs

Michael Heerdegen <michael_heerdegen@web.de> writes:

> I only know that because I asked the question in the org mailing list,
> some months ago.  You might look there for the answers I got for more
> background.

Here is a link to that discussion for reference:

  https://orgmode.org/list/878sdth8fm.fsf@web.de/

Since that I am using special diary sexps in my org files all the time
and they work perfectly - the only important thing is to remember how to
use and place them correctly.

Michael.




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

* Re: sexp and icalendar-export-file
  2021-05-24  4:03 ` Andreas Gösele
                     ` (2 preceding siblings ...)
  2021-05-24 10:52   ` Michael Heerdegen
@ 2021-05-24 19:13   ` Andreas Gösele
  3 siblings, 0 replies; 7+ messages in thread
From: Andreas Gösele @ 2021-05-24 19:13 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

thanks for the answers on the org-agenda part of the question. The
solution was very simple: In the second Class entry I used the American
calendar-date-style and should have used the European one. Changing the
diary-block to "(diary-block 16 2 2022 20 4 2022)" makes it appear at
the right times in the agenda.

But my main question of course remains: How can I export complex sexp
entries from diary or some org agenda.

Thanks again

Andreas




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

end of thread, other threads:[~2021-05-24 19:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-23  4:12 sexp and icalendar-export-file Andreas Gösele
2021-05-24  4:03 ` Andreas Gösele
2021-05-24  7:03   ` Jean Louis
2021-05-24  7:11   ` Jean Louis
2021-05-24 10:52   ` Michael Heerdegen
2021-05-24 11:30     ` Michael Heerdegen
2021-05-24 19:13   ` Andreas Gösele

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).