From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stinky Wizzleteet Subject: capture template: help w table-line target. Date: Sun, 24 Apr 2011 22:31:51 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:37136) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QE5yV-0004Lr-CN for emacs-orgmode@gnu.org; Sun, 24 Apr 2011 16:32:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QE5yU-0005V0-Ds for emacs-orgmode@gnu.org; Sun, 24 Apr 2011 16:32:11 -0400 Received: from lo.gmane.org ([80.91.229.12]:51557) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QE5yU-0005Uu-1f for emacs-orgmode@gnu.org; Sun, 24 Apr 2011 16:32:10 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QE5yT-0005pm-An for emacs-orgmode@gnu.org; Sun, 24 Apr 2011 22:32:09 +0200 Received: from archx.demon.nl ([83.160.190.30]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 24 Apr 2011 22:32:09 +0200 Received: from wizzleteet by archx.demon.nl with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 24 Apr 2011 22:32:09 +0200 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 all, Christopher Allan Webber was so gracious to share his personal org setup for dieting, now I'm adapting his org-remember-template: (setq org-capture-templates '(("w" "weigh-in" entry (file+headline "~/.org/Diet.org" "diet") " * CAL-IN Diet for day %t %^{Weight}p | Food / Exercise | Calories | Quantity | Total | |-----------------+----------+----------+-------| | %^{Food} |%^{Calories} |%^{Quantity} | | |-----------------+----------+----------+-------| | Total | | | | #+TBLFM: $4=$2*$3::$LR4=vsum(@2$4..@-I$4) "))) This works allright, this capture template is used once every day to start the table (christopher: how does one do a CAL-OUT ?) It creates a headline for every day with the table. During the day the org file needs to stay opened so one can fill the table with food/exercise items. Now, I understand org-capture has more functionality than org-remember, like a capture template that adds a line to a table, totally apt for this situation: ("f" "food or exercise" table-line (file+headline "~/.org/Diet.org" "diet") "| %^{Food} |%^{Calories} |%^{Quantity} | |" :table-line-pos "II-1" ) But I' having trouble getting the target right. This works like a charm on an org file that just has a table, but I need to figure out a way how to grab the last table (or better even, *todays* table, if not there, will create one, but I guess this is for future) Can anyone point me in the right direction on how to add a table line to the last table in an org file. Or the table in the last child of headline "diet" ? help a noob out,plz. tips are greatly appreciated, thx wzzl -- Stinky Wizzleteet thinks: You will have a long and unpleasant discussion with your supervisor.