Oops.

(set org-capture-templates '(...

should be

(set org-capture-templates `(...



On Tue, Nov 3, 2015 at 12:28 PM, Nick Dokos <ndo...@gmail.com> wrote:

> Shankar Rao <shankar....@gmail.com> writes:
>
> > I'm trying to use to org-capture insert tables into a datetree that I
> use to manage my finances. Below is the capture template I set up for it.
> Is there a way to make the table be aligned
> > after I finalize the capture?
> >
> > Shankar
> >
> > -----
> >
> > (setq org-capture-templates
> >        '(...
> > ("f" "Add Tables" plain
> > (file+datetree+prompt "~/my-table-file.org")
> >  ,(concat "#+TBLNAME: accounts-%<%y%m%d>\n"
> >                   "| Account | Initial | Final | Calculations |\n"
> >                   "|-\n"
> >                   "| Account A | | | |\n"
> >                   "| Account B | | | |\n"
> >                   "| Account C | | | |\n")
> > :immediate-finish t
> > :jump-to-captured t)
> >         ...))
>
> The ,(concat ...) stuff did not work for me: is is supposed to? I get
> "invalid capture template".
>
> Be that as it may, you can do this (maybe with more safeguards):
>
> --8<---------------cut here---------------start------------->8---
> (add-hook 'org-capture-prepare-finalize-hook (function
> my-capture-table-align))
>
> (defun my-capture-table-align ()
>   (forward-line 1) ;; skip the #+name line
>   (if (org-at-table-p 'any)
>       (org-table-align)))
> --8<---------------cut here---------------end--------------->8---
>
> --
> Nick
>
>
>

Reply via email to