Re: org-capture-template with changing heading (including a TIMESTAMP)

2021-10-04 Thread Uwe Brauer

> Uwe Brauer  writes:

> Because you did not supply a function. The docstring says:
> (file+function "path/to/file" function-finding-location)


Oops I read

 (file+function "path/to/file" function-finding-location)
 A function to find the right location in the file

 (clock)
File to the entry that is currently being clocked

And took the entry (clock) for that function-finding-location 

My bad.

I have to read and understand the role of that function better.


smime.p7s
Description: S/MIME cryptographic signature


Re: org-capture-template with changing heading (including a TIMESTAMP)

2021-10-03 Thread Ihor Radchenko
Uwe Brauer  writes:

> I tried 
>
> ("mg" "Ejercicios Annu21: hechos, solicitados y asignados"
>  table-line (file+function 
> "~/ALLES/HGs/tex/vorlesungen/HGAnnu/Ejercios-Alumnos-Grupos/2021/Ejercios-Teoria21.org"
>  "Ejercicios Annu21: hechos, solicitados y asignados" (clock))
>  "| |%^{Grp|1|2|3|4|5|6|7|8}  |%^{Hj|1|2|3|4|5|6|7} 
> |%^{Ej-As|1|2|3|4|5} |%^{Tit}| | [] | |   | %:fromname| |%:fromaddress |  
> %(my-extract-cc)  |%:subject | %:date |%a | "  :prepend t :empty-lines 1 
> :unnarrowed t
>  )
>
> But it does not work, I receive the error 

Because you did not supply a function. The docstring says:
(file+function "path/to/file" function-finding-location)

function-finding-location should be a valid Elisp function that will
need to take care about moving point to target heading.  What you have
in your template is
(key description table-line (file+function file-name
!some-string-that-should-not-be-there! 
!(clock)-which-is-a-third-element-and-also-should-not-be-there!) ...


Best,
Ihor



Re: org-capture-template with changing heading (including a TIMESTAMP)

2021-10-03 Thread Uwe Brauer
>>> "IR" == Ihor Radchenko  writes:

> Uwe Brauer  writes:
>> ("mg" "Exercicios Annu21: asignados"
>> table-line (file+headline "~/somefile.org" "Exercicios Annu21: asignados")
>> 
>> However in that file I also want a header of the form 
>> 
>> * Exercicios Annu21: asignados <2021-03-19 vie 09:48>
>> 
>> That is a changing timestamp in the heading. How can I achieve that for
>> my template?

> If you want to create a new heading with the timestamp, you can use
> file+function as your target in the template (see org-capture-templates
> docstring).

Thanks

I tried 

("mg" "Ejercicios Annu21: hechos, solicitados y asignados"
 table-line (file+function 
"~/ALLES/HGs/tex/vorlesungen/HGAnnu/Ejercios-Alumnos-Grupos/2021/Ejercios-Teoria21.org"
 "Ejercicios Annu21: hechos, solicitados y asignados" (clock))
 "| |%^{Grp|1|2|3|4|5|6|7|8}  |%^{Hj|1|2|3|4|5|6|7} 
|%^{Ej-As|1|2|3|4|5} |%^{Tit}| | [] | |   | %:fromname| |%:fromaddress |  
%(my-extract-cc)  |%:subject | %:date |%a | "  :prepend t :empty-lines 1 
:unnarrowed t
 )

But it does not work, I receive the error 


org-capture-set-target-location: Invalid capture target specification: 
(file+function 
"~/ALLES/HGs/tex/vorlesungen/HGAnnu/Ejercios-Alumnos-Grupos/2021/Ejercios-Teoria21.org"
 "Ejercicios Annu21: hechos, solicitados y asignados" (clock))

I also tried clock instead of clock.

I most likely misunderstood you.


> If you want to change the existing heading, you can use file+regexp as
> target and add a function modifying your heading to
> org-capture-before-finalize-hook

> You may also try https://github.com/progfolio/doct to make the above a
> little simpler.

I try that thanks

Uwe 


smime.p7s
Description: S/MIME cryptographic signature


Re: org-capture-template with changing heading (including a TIMESTAMP)

2021-10-03 Thread Ihor Radchenko
Uwe Brauer  writes:

> ("mg" "Exercicios Annu21: asignados"
> table-line (file+headline "~/somefile.org" "Exercicios Annu21: asignados")
>
> However in that file I also want a header of the form 
>
> * Exercicios Annu21: asignados <2021-03-19 vie 09:48>
>
> That is a changing timestamp in the heading. How can I achieve that for
> my template?

If you want to create a new heading with the timestamp, you can use
file+function as your target in the template (see org-capture-templates
docstring).

If you want to change the existing heading, you can use file+regexp as
target and add a function modifying your heading to
org-capture-before-finalize-hook

You may also try https://github.com/progfolio/doct to make the above a
little simpler.

Hope it helps.

Best,
Ihor



org-capture-template with changing heading (including a TIMESTAMP)

2021-03-19 Thread Uwe Brauer


Hi

For an org-capture-template I have a setting of the form

("mg" "Exercicios Annu21: asignados"
table-line (file+headline "~/somefile.org" "Exercicios Annu21: asignados")

However in that file I also want a header of the form 

* Exercicios Annu21: asignados <2021-03-19 vie 09:48>

That is a changing timestamp in the heading. How can I achieve that for
my template?

Thanks

Uwe Brauer