Re: [misc] Formatting options

On Mon, 01 Jan 2018 at 12:28:30, Lars Henriksen wrote:
> Calcurse has five formatting options, two of which are for recurring
> appointments/events: --format-recur-apt and format-recur-event. In the man
> page it is stated that the available fields (format specifiers) depend
> on the item type.
> The recurring items have some extra properties (e.g. a stop time), but
> as far as formatting fields are concerned, there are no differences.
> So why the special formatting options?

The main reason is convenience. We often want a different formatting for
recurrent appointments.

> Why not use the formatting options --format-apt and --format-event for
> the recurring ones as well? A separate format for recurring appointments
> may then be accomplished by combining --filter-type and --format-apt.
> Eliminating the two recurring formats would simplify the internal interfaces
> (long argument lists).
> What I miss is another format option, --format-inst-apt, for instant
> appointments, i.e. appointments with zero duration, or otherwise put, with
> end time equal to start time. At the moment it is not possible to format
> the command line output from queries as done in the appointment panel for
> instant appointments.

I like the general idea. However, there are some things to keep in mind.

Firstly, having to use --filter-type to format different item types
differently means that calcurse needs to be invoked multiple times for
basics things like printing all appointments/events of a given day.
Sometimes, this is inconvenient (wrapper scripts need to be created
where a single command did the job before) and there is a small
performance impact. Secondly, and more importantly, I do not see how we
can make appointments appear in the correct order (without any
additional post-processing).

Maybe, we can add conditional formatting elements? Something like
%(if-recur) and %(end-if)? And then also something like %(if-punctual)?
Not sure how convenient that would be.