emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* empty lines in datetree capture templates
@ 2010-12-28  8:50 Suvayu Ali
  2011-01-09 14:31 ` David Maus
  0 siblings, 1 reply; 5+ messages in thread
From: Suvayu Ali @ 2010-12-28  8:50 UTC (permalink / raw)
  To: emacs-org

Hi everyone,

I am having some problems with a capture template for datetrees.

(setq org-capture-templates
      '(("m" "Select meeting templates")
	("ms" "Schedule a meeting" entry (file+headline "~/org/meetings.org" "Meetings")
	 "** %? %^t%^{CATEGORY}p\n" 
	 :empty-lines 1)
	("mm" "Meeting minutes w/ clock" entry (file+datetree "~/org/meetings.org")
	 "**** %^{prompt} %U%^{CATEGORY}p\n\n     %?"
	 :prepend t :clock-in :empty-lines 1 :immediate-finish)
	))

I prefer to have empty lines between two headlines and headlines and
text. When I use the above "Meeting minutes w/ clock" template, the new
entry to the date tree is inserted as below despite the ":empty-lines 1"
argument. If I try to end the older entry with a blank line, the empty
like is removed and the new entry is placed like this again.

Any one knows what I am doing wrong? Thank you in advance,


e.g. entry from above template

* 2010
** 2010-12 December
*** 2010-12-16 Thursday

**** Some meeting [2010-12-16 Thu] 				  :tag1:
     :PROPERTIES:
     :CATEGORY: bla
     :END:

     1. some notes
     2. and pointers
<-- I am expecting an empty line here -->
*** 2010-12-28 Tuesday
<-- and preferably here too -->
**** Some new meeting [2010-12-28 Tue 00:34]
     :LOGBOOK:
     CLOCK: [2010-12-28 Tue 00:34]--[2010-12-28 Tue 00:35] =>  0:01
     :END:
     :PROPERTIES:
     :CATEGORY: test
     :END:

     + some pointers
     + some thoughts

-- 
Suvayu

Open source is the future. It sets us free.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: empty lines in datetree capture templates
  2010-12-28  8:50 empty lines in datetree capture templates Suvayu Ali
@ 2011-01-09 14:31 ` David Maus
  2011-01-09 18:05   ` Suvayu Ali
  2011-01-11 19:58   ` Carsten Dominik
  0 siblings, 2 replies; 5+ messages in thread
From: David Maus @ 2011-01-09 14:31 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: emacs-org


[-- Attachment #1.1: Type: text/plain, Size: 2276 bytes --]

At Tue, 28 Dec 2010 00:50:00 -0800,
Suvayu Ali wrote:
>
> Hi everyone,
>
> I am having some problems with a capture template for datetrees.
>
> (setq org-capture-templates
>       '(("m" "Select meeting templates")
> 	("ms" "Schedule a meeting" entry (file+headline "~/org/meetings.org" "Meetings")
> 	 "** %? %^t%^{CATEGORY}p\n"
> 	 :empty-lines 1)
> 	("mm" "Meeting minutes w/ clock" entry (file+datetree "~/org/meetings.org")
> 	 "**** %^{prompt} %U%^{CATEGORY}p\n\n     %?"
> 	 :prepend t :clock-in :empty-lines 1 :immediate-finish)
> 	))
>
> I prefer to have empty lines between two headlines and headlines and
> text. When I use the above "Meeting minutes w/ clock" template, the new
> entry to the date tree is inserted as below despite the ":empty-lines 1"
> argument. If I try to end the older entry with a blank line, the empty
> like is removed and the new entry is placed like this again.
>
> Any one knows what I am doing wrong? Thank you in advance,

I can confirm that :emtpy-lines 1 seems to have no effect in a
datetree capture template.  I filed two with the template

,----
| (setq org-capture-templates
|       '(("X" "FOO" entry (file+datetree "/tmp/org/datetree.org" "Place table here" "" :empty-lines 1))))
`----

And ended up with:

,----
| * 2011
| ** 2011-01 Januar
| *** 2011-01-09 Sonntag
| **** Fofofof
|      [[file:~/projects/org-mode/minimal.el::'(("X"%20"FOO"%20entry%20(file%2Bdatetree%20"/tmp/org/datetree.org"%20"Table%20here"%20""%20:empty-lines%201))))][file:~/projects/org-mode/minimal.el::'(("X" "FOO" entry (file+datetree "/tmp/org/datetree.org" "Table here" "" :empty-lines 1))))]]
| **** Another one
|      [[file:~/projects/org-mode/minimal.el::'(("X"%20"FOO"%20entry%20(file%2Bdatetree%20"/tmp/org/datetree.org"%20"Table%20here"%20""%20:empty-lines%201))))d][file:~/projects/org-mode/minimal.el::'(("X" "FOO" entry (file+datetree "/tmp/org/datetree.org" "Table here" "" :empty-lines 1))))d]]
`----

While I expected an empty line between "Fofofof" and "Another one".

Using

Org-mode version 7.4 (release_7.4.135.g84087)

GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.0)
 of 2010-12-11 on raven, modified by Debian

Best,
  -- David
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

[-- Attachment #1.2: Type: application/pgp-signature, Size: 230 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: empty lines in datetree capture templates
  2011-01-09 14:31 ` David Maus
@ 2011-01-09 18:05   ` Suvayu Ali
  2011-01-11 19:58   ` Carsten Dominik
  1 sibling, 0 replies; 5+ messages in thread
From: Suvayu Ali @ 2011-01-09 18:05 UTC (permalink / raw)
  To: David Maus; +Cc: emacs-org

Hi David,

On Sun, 09 Jan 2011 15:31:10 +0100
David Maus <dmaus@ictsoc.de> wrote:

> At Tue, 28 Dec 2010 00:50:00 -0800,
> Suvayu Ali wrote:
> >
> > Hi everyone,
> >
> > I am having some problems with a capture template for datetrees.
> >
> > (setq org-capture-templates
> >       '(("m" "Select meeting templates")
> > 	("ms" "Schedule a meeting" entry (file+headline
> > "~/org/meetings.org" "Meetings") "** %? %^t%^{CATEGORY}p\n"
> > 	 :empty-lines 1)
> > 	("mm" "Meeting minutes w/ clock" entry (file+datetree
> > "~/org/meetings.org") "**** %^{prompt} %U%^{CATEGORY}p\n\n     %?"
> > 	 :prepend t :clock-in :empty-lines 1 :immediate-finish)
> > 	))
> >
> > When I use the above "Meeting minutes w/ clock" template, the
> > new entry to the date tree is inserted as below despite the
> > ":empty-lines 1" argument. 

...
> I can confirm that :emtpy-lines 1 seems to have no effect in a
> datetree capture template.  I filed two with the template
> 
> ,----
> | (setq org-capture-templates
> |       '(("X" "FOO" entry (file+datetree "/tmp/org/datetree.org"
> "Place table here" "" :empty-lines 1)))) `----
> 
> And ended up with:
...
> Using
> 
> Org-mode version 7.4 (release_7.4.135.g84087)
> 
> GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.0)
>  of 2010-12-11 on raven, modified by Debian
> 

Thanks a lot for confirming this, its reassuring to know it wasn't
a fault on my part. :)

Emacs and org-mode version:

Org-mode version 7.4 (release_7.4.135.g84087.dirty)
GNU Emacs 24.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.20.1) of 2011-01-06

> Best,
>   -- David


-- 
Suvayu

Open source is the future. It sets us free.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: empty lines in datetree capture templates
  2011-01-09 14:31 ` David Maus
  2011-01-09 18:05   ` Suvayu Ali
@ 2011-01-11 19:58   ` Carsten Dominik
  2011-01-11 20:37     ` Suvayu Ali
  1 sibling, 1 reply; 5+ messages in thread
From: Carsten Dominik @ 2011-01-11 19:58 UTC (permalink / raw)
  To: David Maus; +Cc: emacs-org


On Jan 9, 2011, at 3:31 PM, David Maus wrote:

> At Tue, 28 Dec 2010 00:50:00 -0800,
> Suvayu Ali wrote:
>>
>> Hi everyone,
>>
>> I am having some problems with a capture template for datetrees.
>>
>> (setq org-capture-templates
>>      '(("m" "Select meeting templates")
>> 	("ms" "Schedule a meeting" entry (file+headline "~/org/ 
>> meetings.org" "Meetings")
>> 	 "** %? %^t%^{CATEGORY}p\n"
>> 	 :empty-lines 1)
>> 	("mm" "Meeting minutes w/ clock" entry (file+datetree "~/org/ 
>> meetings.org")
>> 	 "**** %^{prompt} %U%^{CATEGORY}p\n\n     %?"
>> 	 :prepend t :clock-in :empty-lines 1 :immediate-finish)


After clock-in and after :immediate-finish, t is missing - all these  
keys need a value!
The way you write it, :clock-in has the value :empty lines, and from  
then on the property list is broken.

>> 	))
>>
>> I prefer to have empty lines between two headlines and headlines and
>> text. When I use the above "Meeting minutes w/ clock" template, the  
>> new
>> entry to the date tree is inserted as below despite the ":empty- 
>> lines 1"
>> argument. If I try to end the older entry with a blank line, the  
>> empty
>> like is removed and the new entry is placed like this again.
>>
>> Any one knows what I am doing wrong? Thank you in advance,
>
> I can confirm that :emtpy-lines 1 seems to have no effect in a
> datetree capture template.  I filed two with the template
>
> ,----
> | (setq org-capture-templates
> |       '(("X" "FOO" entry (file+datetree "/tmp/org/datetree.org"  
> "Place table here" "" :empty-lines 1))))
> `----

Also this looks like a buggy template definition to me.  If I fix it to:

  (setq org-capture-templates
        '(("X" "FOO" entry (file+datetree "~/org/xxxx.org") "* Place  
table here" :empty-lines 1)))

I do get empty lines.

If you make the templates with customize, it is much harder to make  
mistakes in a complex variable like this.

Best wishes

- Carsten

>
> And ended up with:
>
> ,----
> | * 2011
> | ** 2011-01 Januar
> | *** 2011-01-09 Sonntag
> | **** Fofofof
> |      [[file:~/projects/org-mode/minimal.el::'(("X"%20"FOO"%20entry 
> %20(file%2Bdatetree%20"/tmp/org/datetree.org"%20"Table 
> %20here"%20""%20:empty-lines%201))))][file:~/projects/org-mode/ 
> minimal.el::'(("X" "FOO" entry (file+datetree "/tmp/org/ 
> datetree.org" "Table here" "" :empty-lines 1))))]]
> | **** Another one
> |      [[file:~/projects/org-mode/minimal.el::'(("X"%20"FOO"%20entry 
> %20(file%2Bdatetree%20"/tmp/org/datetree.org"%20"Table 
> %20here"%20""%20:empty-lines%201))))d][file:~/projects/org-mode/ 
> minimal.el::'(("X" "FOO" entry (file+datetree "/tmp/org/ 
> datetree.org" "Table here" "" :empty-lines 1))))d]]
> `----
>
> While I expected an empty line between "Fofofof" and "Another one".
>
> Using
>
> Org-mode version 7.4 (release_7.4.135.g84087)
>
> GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.0)
> of 2010-12-11 on raven, modified by Debian
>
> Best,
>  -- David
> --
> OpenPGP... 0x99ADB83B5A4478E6
> Jabber.... dmjena@jabber.org
> Email..... dmaus@ictsoc.de
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: empty lines in datetree capture templates
  2011-01-11 19:58   ` Carsten Dominik
@ 2011-01-11 20:37     ` Suvayu Ali
  0 siblings, 0 replies; 5+ messages in thread
From: Suvayu Ali @ 2011-01-11 20:37 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: David Maus, emacs-org

Hi Carsten,

On Tue, 11 Jan 2011 20:58:01 +0100
Carsten Dominik <carsten.dominik@gmail.com> wrote:

> 
> On Jan 9, 2011, at 3:31 PM, David Maus wrote:
> 
> > At Tue, 28 Dec 2010 00:50:00 -0800,
> > Suvayu Ali wrote:
> >> 	("mm" "Meeting minutes w/ clock" entry (file+datetree
> >> "~/org/ meetings.org")
> >> 	 "**** %^{prompt} %U%^{CATEGORY}p\n\n     %?"
> >> 	 :prepend t :clock-in :empty-lines 1 :immediate-finish)
> 
> 
> After clock-in and after :immediate-finish, t is missing - all these  
> keys need a value!
> The way you write it, :clock-in has the value :empty lines, and from  
> then on the property list is broken.
> 

Thank you for catching this, don't know how I missed that.

> If you make the templates with customize, it is much harder to make  
> mistakes in a complex variable like this.
> 

Yes I agree and I tried that, but customise doesn't handle newlines very
well. I would prefer the newlines show up as \n rather than actual
newlines in my custom-set-variables. I don't mind editing it later to
fix it either. But when I customise some other variable and save,
customize saves it again with newlines instead of keeping my edited
value with \n.

> Best wishes
> 

Thanks

> - Carsten

-- 
Suvayu

Open source is the future. It sets us free.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-01-11 20:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-28  8:50 empty lines in datetree capture templates Suvayu Ali
2011-01-09 14:31 ` David Maus
2011-01-09 18:05   ` Suvayu Ali
2011-01-11 19:58   ` Carsten Dominik
2011-01-11 20:37     ` Suvayu Ali

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).