From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tamas Papp Subject: capture: create or append to existing heading, by date Date: Thu, 01 Oct 2015 09:32:31 +0200 Message-ID: <878u7nyrg0.fsf@tamas.ihs.ac.at> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57040) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhYM2-0000cw-Ny for emacs-orgmode@gnu.org; Thu, 01 Oct 2015 03:32:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZhYLx-0007Te-MW for emacs-orgmode@gnu.org; Thu, 01 Oct 2015 03:32:38 -0400 Received: from mail-wi0-x22d.google.com ([2a00:1450:400c:c05::22d]:35357) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZhYLx-0007TH-Ht for emacs-orgmode@gnu.org; Thu, 01 Oct 2015 03:32:33 -0400 Received: by wicge5 with SMTP id ge5so15878242wic.0 for ; Thu, 01 Oct 2015 00:32:33 -0700 (PDT) Received: from tamas.ihs.ac.at (ext17.ihs.ac.at. [78.104.137.157]) by smtp.gmail.com with ESMTPSA id m9sm1687019wib.13.2015.10.01.00.32.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Oct 2015 00:32:32 -0700 (PDT) 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: emacs-orgmode@gnu.org Hi, I am tracking calories using tables like this: --8<---------------cut here---------------start------------->8--- ** [2015-10-01 Thu] | | food | quantity | kcal/unit | kcal | |---+----------------------+----------+-----------+-------| | | | | | | | # | pepper_bell | 100 | 57/100 | 57.0 | | # | cheese_Old_Amsterdam | 20 | 429/100 | 85.8 | | # | mustard | 15 | 105/100 | 15.8 | | # | egg | 3 | 88 | 264.0 | | # | chocolate_dark | 10 | 550/100 | 55.0 | |---+----------------------+----------+-----------+-------| | # | | | | 477.6 | #+TBLFM: $4='(diet-lookup-calories $2)::$5=$3*$4;%0.1f::@>$5=vsum(@<<<..@>>) --8<---------------cut here---------------end--------------->8--- (diet-lookup-calories is a function that looks up calories from another table). I need help with the following: the tables are organized daily, with dates in the headings as above. I would like to have a capture process where 1. if there is no table for today, create it, capture, 2. if there is a table for today, take me there and capture. Currently I have implemented 1. with the org-capture-template --8<---------------cut here---------------start------------->8--- ("f" "food diary" entry (file+olp "~/org/calories.org" "diary") "* %u | | food | quantity | kcal/unit | kcal | |---+------+-----------+-------------+-------| | | | | | | | # | | | | | |---+------+-----------+-------------+-------| | # | | | | | #+TBLFM: $4='(diet-lookup-calories $2)::$5=$3*$4;%0.1f::@>$5=vsum(@<<<..@>>) ") --8<---------------cut here---------------end--------------->8--- but it would be great if I had an automated process where tables are created for the first capture of the day, then appended to after. Thanks, Tamas