* org-capture-template: table lines including newline of sorts
@ 2021-03-13 7:24 Uwe Brauer
2021-03-14 17:00 ` TRS-80
2021-03-14 23:28 ` David Masterson
0 siblings, 2 replies; 16+ messages in thread
From: Uwe Brauer @ 2021-03-13 7:24 UTC (permalink / raw)
To: emacs-orgmode
Hi
Currently I have the following setting for one org-capture-template:
("mu" "Stat+Num:Exercises English"
table-line (file+headline "~/Somefile.org" "Exercise Group-E")
"| %:fromname|%:fromaddress | %(my-extract-cc)|%^{Sheet|1|2|3|4|5|6}|%^{Exercise|1|} | %a|%:date | " :prepend t
)
That line is too long, I'd like something like this
("mu" "Stat+Num:Exercises English"
table-line (file+headline "~/Somefile.org" "Exercise Group-E")
"| %:fromname|%:fromaddress\n %(my-extract-cc)|%^{Sheet|1|2|3|4|5|6}|%^{Exercise|1|} | %a|%:date | " :prepend t
)
Or
("mu" "Stat+Num:Exercises English"
table-line (file+headline "~/Somefile.org" "Exercise Group-E")
"| %:fromname|%:fromaddress\n %(my-extract-cc)|%^{Sheet|1|2|3|4|5|6}|%^{Exercise|1|} | %a|%:date | " :prepend t
"| | %(my-extract-cc) | | | | | | | | | | | | | " :prepend t
)
But nothing worked, any ideas?
Thanks and regards
Uwe Brauer
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: org-capture-template: table lines including newline of sorts
2021-03-13 7:24 org-capture-template: table lines including newline of sorts Uwe Brauer
@ 2021-03-14 17:00 ` TRS-80
2021-03-14 20:41 ` Uwe Brauer
2021-03-14 22:12 ` Charles Millar
2021-03-14 23:28 ` David Masterson
1 sibling, 2 replies; 16+ messages in thread
From: TRS-80 @ 2021-03-14 17:00 UTC (permalink / raw)
To: emacs-orgmode
On 2021-03-13 02:24, Uwe Brauer wrote:
> Hi
>
> Currently I have the following setting for one org-capture-template:
>
>
> ("mu" "Stat+Num:Exercises English"
> table-line (file+headline "~/Somefile.org" "Exercise Group-E")
> "| %:fromname|%:fromaddress |
> %(my-extract-cc)|%^{Sheet|1|2|3|4|5|6}|%^{Exercise|1|} | %a|%:date |
> " :prepend t
> )
>
> That line is too long, I'd like something like this
> ("mu" "Stat+Num:Exercises English"
> table-line (file+headline "~/Somefile.org" "Exercise Group-E")
> "| %:fromname|%:fromaddress\n
> %(my-extract-cc)|%^{Sheet|1|2|3|4|5|6}|%^{Exercise|1|} | %a|%:date |
> " :prepend t
> )
>
> Or
>
> ("mu" "Stat+Num:Exercises English"
> table-line (file+headline "~/Somefile.org" "Exercise Group-E")
> "| %:fromname|%:fromaddress\n
> %(my-extract-cc)|%^{Sheet|1|2|3|4|5|6}|%^{Exercise|1|} | %a|%:date |
> " :prepend t
> "| | %(my-extract-cc) | | | | | | | | | | | |
> | " :prepend t
> )
>
>
> But nothing worked, any ideas?
>
> Thanks and regards
>
> Uwe Brauer
Do you need to add more pipes to keep the table structure on the line
after the newline?
Cheers,
TRS-80
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: org-capture-template: table lines including newline of sorts
2021-03-14 17:00 ` TRS-80
@ 2021-03-14 20:41 ` Uwe Brauer
2021-03-21 15:01 ` Maxim Nikulin
2021-03-14 22:12 ` Charles Millar
1 sibling, 1 reply; 16+ messages in thread
From: Uwe Brauer @ 2021-03-14 20:41 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 156 bytes --]
> On 2021-03-13 02:24, Uwe Brauer wrote:
> Do you need to add more pipes to keep the table structure on the line
> after the newline?
I don't think so.
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: org-capture-template: table lines including newline of sorts
2021-03-14 17:00 ` TRS-80
2021-03-14 20:41 ` Uwe Brauer
@ 2021-03-14 22:12 ` Charles Millar
2021-03-15 14:13 ` Uwe Brauer
1 sibling, 1 reply; 16+ messages in thread
From: Charles Millar @ 2021-03-14 22:12 UTC (permalink / raw)
To: emacs-orgmode
Hi,
On 3/14/21 1:00 PM, TRS-80 wrote:
> On 2021-03-13 02:24, Uwe Brauer wrote:
>> Hi
>>
>> Currently I have the following setting for one org-capture-template:
>>
>>
>> ("mu" "Stat+Num:Exercises English"
>> table-line (file+headline "~/Somefile.org" "Exercise Group-E")
>> "| %:fromname|%:fromaddress |
>> %(my-extract-cc)|%^{Sheet|1|2|3|4|5|6}|%^{Exercise|1|} | %a|%:date |
>> " :prepend t
>> )
>>
>> That line is too long, I'd like something like this
>> ("mu" "Stat+Num:Exercises English"
>> table-line (file+headline "~/Somefile.org" "Exercise Group-E")
>> "| %:fromname|%:fromaddress\n
>> %(my-extract-cc)|%^{Sheet|1|2|3|4|5|6}|%^{Exercise|1|} | %a|%:date |
>> " :prepend t
>> )
>>
>> Or
>>
>> ("mu" "Stat+Num:Exercises English"
>> table-line (file+headline "~/Somefile.org" "Exercise Group-E")
>> "| %:fromname|%:fromaddress\n
>> %(my-extract-cc)|%^{Sheet|1|2|3|4|5|6}|%^{Exercise|1|} | %a|%:date |
>> " :prepend t
>> "| | %(my-extract-cc) | | | | | | | | | | | |
>> | " :prepend t
>> )
>>
>>
>> But nothing worked, any ideas?
>>
>> Thanks and regards
>>
>> Uwe Brauer
>
> Do you need to add more pipes to keep the table structure on the line
> after the newline?
>
> Cheers,
> TRS-80
>
You may have to escape the pipes. I did that in a similar capture template.
Charlie Millar
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: org-capture-template: table lines including newline of sorts
2021-03-13 7:24 org-capture-template: table lines including newline of sorts Uwe Brauer
2021-03-14 17:00 ` TRS-80
@ 2021-03-14 23:28 ` David Masterson
2021-03-15 14:14 ` Uwe Brauer
1 sibling, 1 reply; 16+ messages in thread
From: David Masterson @ 2021-03-14 23:28 UTC (permalink / raw)
To: emacs-orgmode
Uwe Brauer <oub@mat.ucm.es> writes:
> Currently I have the following setting for one org-capture-template:
>
>
> ("mu" "Stat+Num:Exercises English"
> table-line (file+headline "~/Somefile.org" "Exercise Group-E")
> "| %:fromname|%:fromaddress | %(my-extract-cc)|%^{Sheet|1|2|3|4|5|6}|%^{Exercise|1|} | %a|%:date | " :prepend t
> )
>
> That line is too long, I'd like something like this
> ("mu" "Stat+Num:Exercises English"
> table-line (file+headline "~/Somefile.org" "Exercise Group-E")
> "| %:fromname|%:fromaddress\n %(my-extract-cc)|%^{Sheet|1|2|3|4|5|6}|%^{Exercise|1|} | %a|%:date | " :prepend t
> )
>
> Or
>
> ("mu" "Stat+Num:Exercises English"
> table-line (file+headline "~/Somefile.org" "Exercise Group-E")
> "| %:fromname|%:fromaddress\n %(my-extract-cc)|%^{Sheet|1|2|3|4|5|6}|%^{Exercise|1|} | %a|%:date | " :prepend t
> "| | %(my-extract-cc) | | | | | | | | | | | | | " :prepend t
> )
>
>
> But nothing worked, any ideas?
Break up the line however you wish into quoted substrings and concat
them together..?
--
David Masterson
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: org-capture-template: table lines including newline of sorts
2021-03-14 22:12 ` Charles Millar
@ 2021-03-15 14:13 ` Uwe Brauer
2021-03-15 14:49 ` Charles Millar
0 siblings, 1 reply; 16+ messages in thread
From: Uwe Brauer @ 2021-03-15 14:13 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 158 bytes --]
> Hi,
> On 3/14/21 1:00 PM, TRS-80 wrote:
> You may have to escape the pipes. I did that in a similar capture template.
Can you give me an example, please?
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: org-capture-template: table lines including newline of sorts
2021-03-14 23:28 ` David Masterson
@ 2021-03-15 14:14 ` Uwe Brauer
2021-03-19 18:12 ` TRS-80
0 siblings, 1 reply; 16+ messages in thread
From: Uwe Brauer @ 2021-03-15 14:14 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 229 bytes --]
> Uwe Brauer <oub@mat.ucm.es> writes:
> Break up the line however you wish into quoted substrings and concat
> them together..?
No entirely sure that you mean by quoted substrings, can you give me an
example, please?
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: org-capture-template: table lines including newline of sorts
2021-03-15 14:13 ` Uwe Brauer
@ 2021-03-15 14:49 ` Charles Millar
2021-03-15 21:00 ` Uwe Brauer
0 siblings, 1 reply; 16+ messages in thread
From: Charles Millar @ 2021-03-15 14:49 UTC (permalink / raw)
To: emacs-orgmode
On 3/15/21 10:13 AM, Uwe Brauer wrote:
>
>> Hi,
>> On 3/14/21 1:00 PM, TRS-80 wrote:
>> You may have to escape the pipes. I did that in a similar capture template.
>
> Can you give me an example, please?
>
HTH
("s" "timeslip" table-line
(file "/mnt/Data/ActiveFiles/timeslips.org")
"\| %(org-read-date)\| %^{FileName} %i\| %^{Narrative}
%i\| %^{Time} %i\| %^{Expense} %i"
Charlie Millar
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: org-capture-template: table lines including newline of sorts
2021-03-15 14:49 ` Charles Millar
@ 2021-03-15 21:00 ` Uwe Brauer
2021-03-16 0:04 ` Charles Millar
0 siblings, 1 reply; 16+ messages in thread
From: Uwe Brauer @ 2021-03-15 21:00 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 768 bytes --]
>>> "CM" == Charles Millar <millarc@verizon.net> writes:
> On 3/15/21 10:13 AM, Uwe Brauer wrote:
>>
>>> Hi,
>>> On 3/14/21 1:00 PM, TRS-80 wrote:
>>> You may have to escape the pipes. I did that in a similar capture template.
>> Can you give me an example, please?
>>
> HTH
> ("s" "timeslip" table-line
> (file "/mnt/Data/ActiveFiles/timeslips.org")
> "\| %(org-read-date)\| %^{FileName} %i\|
> %^{Narrative} %i\| %^{Time} %i\| %^{Expense} %i"
There is a ) missing, no?
I tried
("s" "timeslip" table-line
(file "/home/oub/timeslips.org")
"\| \| %fromname\|
:%subject\| %a \| %:date")
But I obtain bad template when executing the code
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: org-capture-template: table lines including newline of sorts
2021-03-15 21:00 ` Uwe Brauer
@ 2021-03-16 0:04 ` Charles Millar
2021-03-16 7:34 ` Uwe Brauer
0 siblings, 1 reply; 16+ messages in thread
From: Charles Millar @ 2021-03-16 0:04 UTC (permalink / raw)
To: emacs-orgmode
On 3/15/21 5:00 PM, Uwe Brauer wrote:
>>>> "CM" == Charles Millar <millarc@verizon.net> writes:
>
> > On 3/15/21 10:13 AM, Uwe Brauer wrote:
> >>
> >>> Hi,
> >>> On 3/14/21 1:00 PM, TRS-80 wrote:
> >>> You may have to escape the pipes. I did that in a similar capture template.
> >> Can you give me an example, please?
> >>
>
> > HTH
>
> > ("s" "timeslip" table-line
> > (file "/mnt/Data/ActiveFiles/timeslips.org")
> > "\| %(org-read-date)\| %^{FileName} %i\|
> > %^{Narrative} %i\| %^{Time} %i\| %^{Expense} %i"
>
> There is a ) missing, no?
>
> I tried
>
> ("s" "timeslip" table-line
> (file "/home/oub/timeslips.org")
> "\| \| %fromname\|
> :%subject\| %a \| %:date")
>
> But I obtain bad template when executing the code
>
My bad; I did not pay attention to a four line comment, so here it is
again, with the comment and final line for the template, etc.
(setq org-capture-template '(
. . . some capture templates
("s" "timeslip" table-line
(file "/mnt/Data/ActiveFiles/timeslips.org")
;; (file "d:/ActiveFiles/timeslips.org")
"\| %(org-read-date)\| %^{FileName} %i\| %^{Narrative}
%i\| %^{Time} %i\| %^{Expense} %i"
;; Note that there is no escape and pipe after the final content input
expansion
;; if there were a \| then an empty column is added
;; (org-read-date) added 2013-07-12; see Sacha Chua's use of same as in
;; the ledger templates below.
:empty-lines 1)
, , , some more capture templates
))
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: org-capture-template: table lines including newline of sorts
2021-03-16 0:04 ` Charles Millar
@ 2021-03-16 7:34 ` Uwe Brauer
2021-03-16 11:17 ` Charles Millar
0 siblings, 1 reply; 16+ messages in thread
From: Uwe Brauer @ 2021-03-16 7:34 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 1054 bytes --]
> On 3/15/21 5:00 PM, Uwe Brauer wrote:
> My bad; I did not pay attention to a four line comment, so here it is
> again, with the comment and final line for the template, etc.
> (setq org-capture-template '(
> . . . some capture templates
> ("s" "timeslip" table-line
> (file "/mnt/Data/ActiveFiles/timeslips.org")
> ;; (file "d:/ActiveFiles/timeslips.org")
> "\| %(org-read-date)\| %^{FileName} %i\|
> %^{Narrative} %i\| %^{Time} %i\| %^{Expense} %i"
> ;; Note that there is no escape and pipe after the final content input
> expansion
> ;; if there were a \| then an empty column is added
> ;; (org-read-date) added 2013-07-12; see Sacha Chua's use of same as in
> ;; the ledger templates below.
> :empty-lines 1)
> , , , some more capture templates
> ))
I still obtain
| Bad template
Even copying your code without any modifications! I am running org
9.3.7
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: org-capture-template: table lines including newline of sorts
2021-03-16 7:34 ` Uwe Brauer
@ 2021-03-16 11:17 ` Charles Millar
2021-03-18 7:38 ` Uwe Brauer
0 siblings, 1 reply; 16+ messages in thread
From: Charles Millar @ 2021-03-16 11:17 UTC (permalink / raw)
To: emacs-orgmode
On 3/16/21 3:34 AM, Uwe Brauer wrote:
>
> > On 3/15/21 5:00 PM, Uwe Brauer wrote:
> > My bad; I did not pay attention to a four line comment, so here it is
> > again, with the comment and final line for the template, etc.
>
> > (setq org-capture-template '(
>
> > . . . some capture templates
>
> > ("s" "timeslip" table-line
> > (file "/mnt/Data/ActiveFiles/timeslips.org")
> > ;; (file "d:/ActiveFiles/timeslips.org")
> > "\| %(org-read-date)\| %^{FileName} %i\|
> > %^{Narrative} %i\| %^{Time} %i\| %^{Expense} %i"
>
> > ;; Note that there is no escape and pipe after the final content input
> > expansion
> > ;; if there were a \| then an empty column is added
> > ;; (org-read-date) added 2013-07-12; see Sacha Chua's use of same as in
> > ;; the ledger templates below.
> > :empty-lines 1)
>
> > , , , some more capture templates
>
> > ))
>
>
> I still obtain
>
> | Bad template
>
>
> Even copying your code without any modifications! I am running org
> 9.3.7
>
I'm running org 9.4.4 and emacs 28.0.50, (both from source) on Debian
testing. According to my notes in my init file I created the template in
early July 2011, modified it slightly two years later. I do not recall
any problems with it.
Just to make sure that there is no problem with the timeslips template,
at least on my system, I commented out all of the capture templates
before and after the timeslips template and reloaded my init file. I ran
org-capture (bound to C-cm). The timeslips came up in the dispatcher and
it ran OK.
I notice that I was off by a key and typed periods and not semicolons in
the two lines "some capture templates," and, "some more capture templates."
Charlie Millar
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: org-capture-template: table lines including newline of sorts
2021-03-16 11:17 ` Charles Millar
@ 2021-03-18 7:38 ` Uwe Brauer
2021-03-19 18:15 ` TRS-80
0 siblings, 1 reply; 16+ messages in thread
From: Uwe Brauer @ 2021-03-18 7:38 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 1434 bytes --]
> On 3/16/21 3:34 AM, Uwe Brauer wrote:
> I'm running org 9.4.4 and emacs 28.0.50, (both from source) on Debian
> testing. According to my notes in my init file I created the template
> in early July 2011, modified it slightly two years later. I do not
> recall any problems with it.
> Just to make sure that there is no problem with the timeslips
> template, at least on my system, I commented out all of the capture
> templates before and after the timeslips template and reloaded my init
> file. I ran org-capture (bound to C-cm). The timeslips came up in the
> dispatcher and it ran OK.
> I notice that I was off by a key and typed periods and not semicolons
> in the two lines "some capture templates," and, "some more capture
> templates."
I commented out all my templates
So the only entry is
("s" "timeslip" table-line
(file "/home/oub/timeslips.org")
;; (file "d:/ActiveFiles/timeslips.org")
"\| %(org-read-date)\| %^{FileName} %i\|
%^{Narrative} %i\| %^{Time} %i\| %^{Expense} %i"
Timeslips.org is empty.
I mark a line in my org-init file and fire up org-capture using your
template, I insert as file name org-init,
narrative I insert blabla
time I insert 10:00
Expense I insert 10
And I obtain
| Bad template
What do I miss here?
Thanks
Uwe
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: org-capture-template: table lines including newline of sorts
2021-03-15 14:14 ` Uwe Brauer
@ 2021-03-19 18:12 ` TRS-80
0 siblings, 0 replies; 16+ messages in thread
From: TRS-80 @ 2021-03-19 18:12 UTC (permalink / raw)
To: emacs-orgmode
On 2021-03-15 10:14, Uwe Brauer wrote:
>> Uwe Brauer <oub@mat.ucm.es> writes:
>
>> Break up the line however you wish into quoted substrings and
>> concat them together..?
>
> No entirely sure that you mean by quoted substrings, can you give me
> an example, please?
I am not same guy you were replying to, but:
#+begin_src emacs-lisp
(concat "Add "
"all "
"these "
"strings "
"together!")
;; result:
"Add all these strings together!"
#+end_src
I use it a lot when:
- things start to get complicated (some regexp)
- I want to maintain lines in source that will match output
- in some other cases, too.
Really helpful!
Cheers,
TRS-80
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: org-capture-template: table lines including newline of sorts
2021-03-18 7:38 ` Uwe Brauer
@ 2021-03-19 18:15 ` TRS-80
0 siblings, 0 replies; 16+ messages in thread
From: TRS-80 @ 2021-03-19 18:15 UTC (permalink / raw)
To: emacs-orgmode
On 2021-03-18 03:38, Uwe Brauer wrote:
> I commented out all my templates
>
> So the only entry is
>
> ("s" "timeslip" table-line
> (file "/home/oub/timeslips.org")
> ;; (file "d:/ActiveFiles/timeslips.org")
> "\| %(org-read-date)\| %^{FileName} %i\|
> %^{Narrative} %i\| %^{Time} %i\| %^{Expense} %i"
>
> Timeslips.org is empty.
>
> I mark a line in my org-init file and fire up org-capture using your
> template, I insert as file name org-init,
> narrative I insert blabla
> time I insert 10:00
> Expense I insert 10
>
> And I obtain
>
> | Bad template
>
> What do I miss here?
Maybe try a minimal Emacs, just to make sure something else isn't
affecting it?
Cheers,
TRS-80
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: org-capture-template: table lines including newline of sorts
2021-03-14 20:41 ` Uwe Brauer
@ 2021-03-21 15:01 ` Maxim Nikulin
0 siblings, 0 replies; 16+ messages in thread
From: Maxim Nikulin @ 2021-03-21 15:01 UTC (permalink / raw)
To: emacs-orgmode
On 15/03/2021 03:41, Uwe Brauer wrote:
>
>> On 2021-03-13 02:24, Uwe Brauer wrote:
>
>> Do you need to add more pipes to keep the table structure on the line
>> after the newline?
>
>
> I don't think so.
I am afraid, then you should significantly modify implementation for
table-line capture type.
Your examples are hardly could be considered as minimal that anyone
could easily try. I admit that you need namely the template for exams
that could be quickly filled from email, but still...
("w" "Table - works" table-line
(file+headline "" "Table")
"| %U | It |\n| | Works |" :prepend t)
("b" "Table - broken" table-line
(file+headline "" "Table")
"| %U | Broken\nmultiline |" :prepend t)
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2021-03-21 15:03 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-13 7:24 org-capture-template: table lines including newline of sorts Uwe Brauer
2021-03-14 17:00 ` TRS-80
2021-03-14 20:41 ` Uwe Brauer
2021-03-21 15:01 ` Maxim Nikulin
2021-03-14 22:12 ` Charles Millar
2021-03-15 14:13 ` Uwe Brauer
2021-03-15 14:49 ` Charles Millar
2021-03-15 21:00 ` Uwe Brauer
2021-03-16 0:04 ` Charles Millar
2021-03-16 7:34 ` Uwe Brauer
2021-03-16 11:17 ` Charles Millar
2021-03-18 7:38 ` Uwe Brauer
2021-03-19 18:15 ` TRS-80
2021-03-14 23:28 ` David Masterson
2021-03-15 14:14 ` Uwe Brauer
2021-03-19 18:12 ` TRS-80
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
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).