From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shaun Johnson Subject: Capturing tables and a small proposal for a capture enhancement Date: Wed, 05 Oct 2011 19:55:51 +0100 Message-ID: <4E8CA837.7020908@slugfest.demon.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:58847) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBWdS-0006ox-5n for emacs-orgmode@gnu.org; Wed, 05 Oct 2011 14:56:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RBWdP-0000Ay-OZ for emacs-orgmode@gnu.org; Wed, 05 Oct 2011 14:56:06 -0400 Received: from anchor-post-2.mail.demon.net ([195.173.77.133]:60455) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBWdP-0000An-Iz for emacs-orgmode@gnu.org; Wed, 05 Oct 2011 14:56:03 -0400 Received: from slugfest.demon.co.uk ([80.177.204.141] helo=[192.168.100.4]) by anchor-post-2.mail.demon.net with esmtp (Exim 4.69) id 1RBWdN-0004xA-l7 for emacs-orgmode@gnu.org; Wed, 05 Oct 2011 18:56:01 +0000 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: Org Mode I am trying to use org-capture with a template that contains an org table. The value of org-capture-templates is: (("b" "Blood pressure" entry (file "~/Org/bp.org") (file "~/Org/CaptureTemplates/b.org") :prepend t :immediate-finish t :post-process)) The file ~/Org/CaptureTemplates/b.org contains: * %U | Systolic | Diastolic | Pulse | |--------------+---------------+-----------| | %^{Systolic} | %^{Diastolic} | %^{Pulse} | | %^{Systolic} | %^{Diastolic} | %^{Pulse} | | %^{Systolic} | %^{Diastolic} | %^{Pulse} | (without the leading white space). This works but the resulting table is not aligned, obviously I can align it manually after capture but it would be nice if this could be automated. I am unable to find any way to do this, am I missing something or is this currently not possible? A general solution to this could be to add a new :post-process property to the template definition whose value should be a function which is called immediately before org-capture-before-finalize-hook. My problem would be solved with a template like: (("b" "Blood pressure" entry (file "~/Org/bp.org") (file "~/Org/CaptureTemplates/b.org") :prepend t :immediate-finish t :post-process (lambda nil (goto-char (point-min)) (search-forward "|-") (org-table-align)))) If there is any interest I can submit a patch. Shaun Johnson.