From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brady Trainor Subject: Re: extra newlines in TYPE checkitem for capture-templates Date: Thu, 23 Oct 2014 22:00:23 -0700 Message-ID: <87oat2njtk.fsf@uw.edu> References: <87siiegonc.fsf@uw.edu> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36210) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XhWzU-0000M6-Ot for emacs-orgmode@gnu.org; Fri, 24 Oct 2014 01:00:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XhWzO-0002WI-Ma for emacs-orgmode@gnu.org; Fri, 24 Oct 2014 01:00:44 -0400 Received: from plane.gmane.org ([80.91.229.3]:59283) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XhWzO-0002WD-G1 for emacs-orgmode@gnu.org; Fri, 24 Oct 2014 01:00:38 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XhWzN-0007JK-3j for emacs-orgmode@gnu.org; Fri, 24 Oct 2014 07:00:37 +0200 Received: from 174-24-239-229.tukw.qwest.net ([174.24.239.229]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 24 Oct 2014 07:00:37 +0200 Received: from algebrat by 174-24-239-229.tukw.qwest.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 24 Oct 2014 07:00:37 +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 Brady Trainor 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