** advanced table
:PROPERTIES:
:DATE: 2009-11-20
:END:
| DATA | WHAT | WHERE | HOW MUCH |
|------------------+------------+-------------+----------|
| [2009-09-25 Fri] | | | 28.95 |
|------------------+------------+-------------+----------|
| | food | supermarket | 7.85 |
| | ticket bus | | 2.3 |
| | tea + ice | ice uno | 4.4 |
| | ticket | | 14.4 |
|------------------+------------+-------------+----------|
| [2009-09-26 Sat] | | | 41 |
#+begin_src emacs-lisp
(let ((total 0) (responding t) purchases)
(while responding
(setq purchases
(cons
(list ""
(read-from-minibuffer "What: ")
(read-from-minibuffer "Where: ")
(read-minibuffer "How Much: "))
purchases))
(setq responding (y-or-n-p "more? ")))
(append
purchases
(list
(list
(format-time-string "%Y-%m-%d" (current-time))
"" "" (progn
(mapc (lambda (purchase)
(setq total (+ total (fourth purchase))))
purchases)
total)))))
#+end_src
#+resname:
| "" | "fish and chips" | "diner" | 9.78 |
| "" | "food" | "subway" | 5.45 |
| "2009-09-29" | "" | "" | 15.23 |