Ihor Radchenko <[email protected]> writes:

>> 2) Building an Emacs-native iCalendar-to-Org *importer*
>
> That would be a big project. To make it right, maybe we even need to do
> it beyond iCalendar and build a more generate import framework that will
> work for other formats, not just iCalendar.

> Richard, in theory, we may utilize ox.el infrastructure for this. But
> that would require making iCalendar AST to be compatible with what ox.el
> expects.

I'm not sure it needs to be that big; but we would need to think in
advance about what kind of usage we want to support.

For example, we could make use of the existing capture framework and
templates, and just bind the relevant iCalendar values dynamically when
expanding the template.  This is basically what I did for the diary
importer (using skeleton.el), with the option to let users write their
own skeleton template function if they need more flexibility.  I think
this works pretty well.

But of course, this approach would mainly work well for importing single
events, or importing whole calendar files using a single predefined
template; it wouldn't work very well for a workflow where you need to
import a large calendar file but need e.g. to choose the template for
each component based on the iCalendar data, or want to do more
complicated transformations, refiling, etc.

>> 3) Displaying iCalendar data directly in Org agenda
>
> This should be doable and relatively easy. One will need to write
> something akin `org-get-entries-from-diary'.

Yes.  I think this is also probably the best approach for anyone who
just needs to display iCalendar data in the agenda.  That's why I added
this function to the diary; trying to keep data in sync by roundtripping
between incompatible formats is madness.

-- 
Best,
Richard

Reply via email to