Hi Bastien, Hi Paul, At Sat, 29 Oct 2011 14:08:52 +0200, Bastien wrote: > > Hi Paul, > > Paul writes: > > > In fact adding whitespace-cleanup to org-capture-before-finalize-hook > > was what I tried first, but it didn't do what I wanted. This hook is > > called _after_ the buffer is widened - making whitespace-cleanup > > operate on the _entire_ buffer, not just the newly added capture. > > > > I believe the patch is still required - I should have explained > > org-capture-before-finalize-hook's behaviour more explicitly in my > > original submission. > > I'm willing to apply this patch -- could you provide it with a > well-formatted ChangeLog entry? Instead of adding the :whitespace-cleanup property to the template definition (what requires you to specify e.g. whitespace-cleanup in every single template) why not define a new hook that is run before the finalization starts? I.e. with capture buffer current and still narrowed. See attached patch that such a hook called `org-capture-prepare-finalize-hook'. Best, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber.... dmjena@jabber.org Email..... dmaus@ictsoc.de