From: Olaf Dietsche <olaf+list.orgmode@olafdietsche.de>
To: Paul <emacs-orgmode@lookmumnohands.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] org-capture, removing whitespace from new captures
Date: Wed, 14 Sep 2011 14:59:17 +0200 [thread overview]
Message-ID: <87zki7b7q2.fsf@rat.lan> (raw)
In-Reply-To: <20110914111415.GE15861@shift> (Paul's message of "Wed, 14 Sep 2011 21:14:15 +1000")
Paul <emacs-orgmode@lookmumnohands.net> 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
next prev parent reply other threads:[~2011-09-14 12:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-13 21:19 [PATCH] org-capture, removing whitespace from new captures paulusm
2011-09-14 8:44 ` Olaf Dietsche
2011-09-14 11:14 ` Paul
2011-09-14 12:59 ` Olaf Dietsche [this message]
2011-10-29 12:08 ` Bastien
2012-02-18 15:50 ` David Maus
2012-02-18 17:19 ` Bastien
2012-02-18 17:33 ` David Maus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zki7b7q2.fsf@rat.lan \
--to=olaf+list.orgmode@olafdietsche.de \
--cc=emacs-orgmode@gnu.org \
--cc=emacs-orgmode@lookmumnohands.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).