emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Stinky Wizzleteet <wizzleteet@hotmail.com>
To: emacs-orgmode@gnu.org
Subject: capture template: help w table-line target.
Date: Sun, 24 Apr 2011 22:31:51 +0200	[thread overview]
Message-ID: <cuo8vuzwfuw.fsf@mauc.nl> (raw)


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.

                 reply	other threads:[~2011-04-24 20:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=cuo8vuzwfuw.fsf@mauc.nl \
    --to=wizzleteet@hotmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).