[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] extra newlines in TYPE checkitem for capture-templates
From: |
Brady Trainor |
Subject: |
Re: [O] extra newlines in TYPE checkitem for capture-templates |
Date: |
Thu, 23 Oct 2014 22:00:23 -0700 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (windows-nt) |
Brady Trainor <address@hidden> writes:
>
> A solution would be to use file+headline, then not using :prepend
> prevents an extra line, but my headline is the date and varies.
>
I solved my problem this way by modifying the function
insert-date-N-days-from-current to print instead of insert. Now I can use
file+headline and avoid :prepend.
#+BEGIN_SRC emacs-lisp
(defun print-date-N-days-from-current (&optional days)
"Print date that is DAYS from current."
(interactive "p*")
(print
(calendar-date-string
(calendar-gregorian-from-absolute
(+ (calendar-absolute-from-gregorian (calendar-current-date))
days)))))
(setq org-capture-templates
`(("p" "pomodoro, checklist"
checkitem (file+headline ,pomodoro ,(print-date-N-days-from-current 0))
"")))
#+END_SRC
--
Brady