From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Dietsche Subject: Re: [PATCH] org-capture, removing whitespace from new captures Date: Wed, 14 Sep 2011 14:59:17 +0200 Message-ID: <87zki7b7q2.fsf@rat.lan> References: <20110913211926.GB15861@shift> <87ipovcy3s.fsf@rat.lan> <20110914111415.GE15861@shift> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([140.186.70.92]:52870) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3p3s-00050k-E4 for emacs-orgmode@gnu.org; Wed, 14 Sep 2011 08:59:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R3p3n-000281-TF for emacs-orgmode@gnu.org; Wed, 14 Sep 2011 08:59:32 -0400 Received: from www85.your-server.de ([213.133.104.85]:42024) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3p3n-00027u-L2 for emacs-orgmode@gnu.org; Wed, 14 Sep 2011 08:59:27 -0400 In-Reply-To: <20110914111415.GE15861@shift> (Paul's message of "Wed, 14 Sep 2011 21:14:15 +1000") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Paul Cc: emacs-orgmode@gnu.org Paul writes: > # olaf+list.orgmode@olafdietsche.de, Wed, 14 Sep 2011 18:44:07 +1000: >> paulusm@telstra.com writes: >> >> > I found myself manually "cleaning" most CAPTURE buffers of whitespace >> > prior to committing them with C-c C-c. The attached patch adds a new >> > property :whitespace-cleanup to the org-capture-templates. >> >> Thanks for pointing to whitespace-cleanup, I've done this manually >> cleaning as well. > > My pleasure. I just had it pointed out to me a couple of days ago! > >> You could use org-capture-before-finalize-hook for this: >> >> (add-hook 'org-capture-before-finalize-hook 'whitespace-cleanup) > > 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. > > Further to this, can anybody suggest a better documentation string for > org-capture-before-finalize-hook? (Preferably in tandem with my > proposed patch.) Currently it is: > > Hook that is run right before a capture process is finalized. > The capture buffer is still current when this hook runs. > > I feel the "finalized" part is somewhat ambiguous. What it means is > "after the capture buffer is widened, and before it is saved". I > expected it to mean "BEFORE the capture buffer is widened". > > Maybe: > Hook that is run after the capture buffer is widened and prior to > being finalized. The capture buffer is still current when this > hook runs. Thanks again for this explanation. I haven't noticed this. For me this isn't bad though, since I capture everything into an inbox.org. Regards, Olaf