From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Maus Subject: Re: [PATCH] org-capture, removing whitespace from new captures Date: Sat, 18 Feb 2012 16:50:11 +0100 Message-ID: <87wr7k16q4.wl%dmaus@ictsoc.de> References: <20110913211926.GB15861@shift> <87ipovcy3s.fsf@rat.lan> <20110914111415.GE15861@shift> <87bot080ff.fsf@gnu.org> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Sat_Feb_18_16:50:07_2012-1"; micalg=pgp-sha256; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:38171) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RymYE-0001UH-Ae for emacs-orgmode@gnu.org; Sat, 18 Feb 2012 10:50:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RymYC-0005Wl-PS for emacs-orgmode@gnu.org; Sat, 18 Feb 2012 10:50:18 -0500 Received: from app1a.xlhost.de ([213.202.242.161]:50056) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RymYC-0005Wc-GN for emacs-orgmode@gnu.org; Sat, 18 Feb 2012 10:50:16 -0500 In-Reply-To: <87bot080ff.fsf@gnu.org> 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: Bastien Cc: emacs-orgmode@gnu.org, Paul --pgp-sign-Multipart_Sat_Feb_18_16:50:07_2012-1 Content-Type: multipart/mixed; boundary="Multipart_Sat_Feb_18_16:50:07_2012-1" --Multipart_Sat_Feb_18_16:50:07_2012-1 Content-Type: text/plain; charset=US-ASCII 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 --Multipart_Sat_Feb_18_16:50:07_2012-1 Content-Type: text/plain; type=patch; charset=US-ASCII Content-Disposition: attachment; filename="0001-New-hook-Run-before-the-finalization-process-starts.patch" Content-Transfer-Encoding: base64 RnJvbSBmNzM3ZmJkYzZlZDFkNDVkODYyOWViMTM0N2U4YzhkODI4Zjc3ZTMyIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEYXZpZCBNYXVzIDxkbWF1c0BpY3Rzb2MuZGU+CkRhdGU6IFNh dCwgMTggRmViIDIwMTIgMTY6NDE6MzAgKzAxMDAKU3ViamVjdDogW1BBVENIXSBOZXcgaG9vazog UnVuIGJlZm9yZSB0aGUgZmluYWxpemF0aW9uIHByb2Nlc3Mgc3RhcnRzCgoqIG9yZy1jYXB0dXJl LmVsIChvcmctY2FwdHVyZS1wcmVwYXJlLWZpbmFsaXplLWhvb2spOiBOZXcgaG9vay4gUnVuCmJl Zm9yZSB0aGUgZmluYWxpemF0aW9uIHByb2Nlc3Mgc3RhcnRzLgoob3JnLWNhcHR1cmUtZmluYWxp emUpOiBSdW4gbmV3IGhvb2suCi0tLQogbGlzcC9vcmctY2FwdHVyZS5lbCB8ICAgIDkgKysrKysr KysrCiAxIGZpbGVzIGNoY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mFsaXplLWhvb2spCisKICAgOzsgRGlkIHdlIHN0YXJ0IHRoZSBjbG9j ayBpbiB0aGlzIGNhcHR1cmUgYnVmZmVyPwogICAod2hlbiAoYW5kIG9yZy1jYXB0dXJlLWNsb2Nr LXdhcy1zdGFydGVkCiAJICAgICBvcmctY2xvY2stbWFya2VyIChtYXJrZXItYnVmZmVyIG9yZy1j bG9jay1tYXJrZXIpCi0tIAoxLjcuMi41Cgo= --Multipart_Sat_Feb_18_16:50:07_2012-1-- --pgp-sign-Multipart_Sat_Feb_18_16:50:07_2012-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iF4EABEIAAYFAk8/yLMACgkQDMLgk1Evc4VX8wD/bXrzPrSP81fW9wv++gyzyHHJ dlMmE7U8j4Q6w3hLzAkA/19yLzqM3o1+y2uNkPD4e8GDdACM5lL2YbThV13WBdOc =SCjz -----END PGP SIGNATURE----- --pgp-sign-Multipart_Sat_Feb_18_16:50:07_2012-1--