Re: Headline generation as in diary?

2020-10-28 Thread Michael Heerdegen
I wrote: > With diary, I can use arbitrary Lisp expressions to generate dates, and > those expressions can also return a string to use as non-nil return > value to generate non-constant headlines including certain numbers for > example. [...] My solution so far: I've set up my

Re: Headline generation as in diary?

2020-09-03 Thread Michael Heerdegen
Ihor Radchenko writes: > > I didn't know that eval specs support multi-line sexps, but seems that > > works, so I can indeed use this. Thanks for the suggestion. > > Hmm. According to manual, it should support multi-line string. Not sure > about sexps. AFAIR it didn't work in the past. I

Re: Headline generation as in diary?

2020-09-03 Thread Ihor Radchenko
> I didn't know that eval specs support multi-line sexps, but seems that > works, so I can indeed use this. Thanks for the suggestion. Hmm. According to manual, it should support multi-line string. Not sure about sexps. In the worst case when you absolutely want multi-line sexp to be really

Re: Headline generation as in diary?

2020-09-03 Thread Michael Heerdegen
Ihor Radchenko writes: > I do not think there is support of multi-line planning everywhere. I see. > You can always use file-local definition at the beginning or end of your > org file. Below is an example of local definition at the end of an org > file. > > # Local Variables: > # eval: (defun

Re: Headline generation as in diary?

2020-09-03 Thread Ihor Radchenko
> Multi-line sexps in time stamps work would just be nice to have. Would > it be hard to achieve? I mean, since multi-line %%(...) entries already > work... The problem is that org-mode assumes that planning line must be a single line and a lot of internal logic hard-code this assumption. For

Re: Headline generation as in diary?

2020-09-03 Thread Ihor Radchenko
> It can? Thatʼs not documented, as far as I can tell. It is literally called "diary sexp". You can use any elisp sexp there, like (let ...) or (or ...) or (function-name ...) Robert Pluim writes: >> On Thu, 03 Sep 2020 21:35:54 +0800, Ihor Radchenko >> said: > > >> When dealing

Re: Headline generation as in diary?

2020-09-03 Thread Robert Pluim
> On Thu, 03 Sep 2020 16:46:48 +0200, Michael Heerdegen > said: Michael> Robert Pluim writes: >> It can? Thatʼs not documented, as far as I can tell. Michael> As a user, I read "Diary-style expression entries" in the org manual as Michael> including my own defined

Re: Headline generation as in diary?

2020-09-03 Thread Michael Heerdegen
Robert Pluim writes: > It can? Thatʼs not documented, as far as I can tell. As a user, I read "Diary-style expression entries" in the org manual as including my own defined diary sexps - excluding them would be a surprise that should be documented (no, I don't want that to happen!). Michael.

Re: Headline generation as in diary?

2020-09-03 Thread Robert Pluim
> On Thu, 03 Sep 2020 21:35:54 +0800, Ihor Radchenko > said: >> When dealing with complicated date rules it can likely happen that a >> diary sexp doesn't fit into one line. Ihor> Diary sexp can be a user-defined function. If your sexp needs to span Ihor> multiple

Re: Headline generation as in diary?

2020-09-03 Thread Michael Heerdegen
Ihor Radchenko writes: > > When dealing with complicated date rules it can likely happen that a > > diary sexp doesn't fit into one line. > > Diary sexp can be a user-defined function. If your sexp needs to span > multiple lines, it is probably worth defining a function and simply > using

Re: Headline generation as in diary?

2020-09-03 Thread Ihor Radchenko
> When dealing with complicated date rules it can likely happen that a > diary sexp doesn't fit into one line. Diary sexp can be a user-defined function. If your sexp needs to span multiple lines, it is probably worth defining a function and simply using <%%(your-function)> as a timestamp. Best,

Re: Headline generation as in diary?

2020-09-03 Thread Michael Heerdegen
Robert Pluim writes: > I can push my change to org, but Iʼm not a regular org contributor, so > Iʼd prefer to hear from one of the maintainers first. Sorry - I meant, I see no reason to touch the existing code. No need to change anything for what I want. > Michael> This doesn't work: > >

Re: Headline generation as in diary?

2020-09-02 Thread Michael Heerdegen
Robert Pluim writes: > OK. Thatʼs as far as my org-hacking knowledge goes, so perhaps someone > else here has an idea of the right way to invoke "tell me what heading > Iʼm in, as a string". The situation is actually like this: the empty string issue doesn't happen with time stamps <%%(...)>,

Re: Headline generation as in diary?

2020-09-02 Thread Robert Pluim
> On Wed, 02 Sep 2020 15:45:36 +0200, Michael Heerdegen > said: Michael> Robert Pluim writes: >> How about: >> >> diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el >> index 78fe13303..9049b3a42 100644 >> --- a/lisp/org-agenda.el >> +++

Re: Headline generation as in diary?

2020-09-02 Thread Michael Heerdegen
Robert Pluim writes: > How about: > > diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el > index 78fe13303..9049b3a42 100644 > --- a/lisp/org-agenda.el > +++ b/lisp/org-agenda.el > @@ -5772,7 +5772,7 @@ displayed in agenda view." > r (replace-match "" nil nil r))) >

Re: Headline generation as in diary?

2020-09-02 Thread Robert Pluim
> On Tue, 01 Sep 2020 23:56:55 +0200, Michael Heerdegen > said: Michael> Robert Pluim writes: >> Itʼs triggered by the %%(, I believe, but not in headlines. Michael> Yes, I see that in the code. Michael> But actually I seem to have the opposite problem: I can't make

Re: Headline generation as in diary?

2020-09-01 Thread Michael Heerdegen
Robert Pluim writes: > Itʼs triggered by the %%(, I believe, but not in headlines. Yes, I see that in the code. But actually I seem to have the opposite problem: I can't make the original headline appear in the agenda. When the sexp doesn't return a string the agenda will contain a line

Re: Headline generation as in diary?

2020-09-01 Thread Robert Horn
Eric S Fraga writes: > On Tuesday, 1 Sep 2020 at 18:10, Robert Pluim wrote: > * Birthdays > > and then a number of %%(diary-anniversary ...) entries all under this > headline. > Note that you can also use %%(org-anniversary ...) with slightly different dependencies. I also use modifications

Re: Headline generation as in diary?

2020-09-01 Thread Eric S Fraga
On Tuesday, 1 Sep 2020 at 18:10, Robert Pluim wrote: >> On Tue, 01 Sep 2020 17:18:42 +0200, Michael Heerdegen >> said: > Michael> Where in an entry do you specify such specifications? > > Below the headline, after the properties. Yes, exactly. I have one headline which says

Re: Headline generation as in diary?

2020-09-01 Thread Robert Pluim
> On Tue, 01 Sep 2020 17:18:42 +0200, Michael Heerdegen > said: Michael> Eric S Fraga writes: >> No, not necessarily. I have entries like this: >> >> %%(diary-anniversary 1981 03 17) Somebody's birthday (%d years) >> >> and the agenda view shows "Somebody's

Re: Headline generation as in diary?

2020-09-01 Thread Michael Heerdegen
Michael Heerdegen writes: > > [1] https://github.com/m-cat/org-recur > > Thanks for the hint, I'll have a look. Nice to have definitely. I want to stick to diary sexp expressions for some complicated dates. I have already extended the diary language to fit my needs to specify the dates of

Re: Headline generation as in diary?

2020-09-01 Thread Michael Heerdegen
Eric S Fraga writes: > No, not necessarily. I have entries like this: > > %%(diary-anniversary 1981 03 17) Somebody's birthday (%d years) > > and the agenda view shows "Somebody's birthday (19 years)"; the actual > heading for this entry is ignored. Where in an entry do you specify such

Re: Headline generation as in diary?

2020-09-01 Thread Eric S Fraga
On Tuesday, 1 Sep 2020 at 16:34, Michael Heerdegen wrote: > I would like to use my org file to specify those things instead of > maintaining a second file (the diary file). But AFAIK the dynamically > created headline part is tricky: what appears in the agenda is always > the org headline as it