From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Campese Subject: Re: Non-interactive insertion of future-dates Date: Sat, 28 Jan 2012 23:38:24 +0100 Message-ID: <87sjizbggv.fsf@tu-dortmund.de> References: <87sjj3d98v.fsf@rman-office.uni.lux> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:56683) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RrGul-0007tk-N6 for emacs-orgmode@gnu.org; Sat, 28 Jan 2012 17:38:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RrGuk-0003U0-1D for emacs-orgmode@gnu.org; Sat, 28 Jan 2012 17:38:31 -0500 Received: from smtp01.worldserver.net ([217.13.200.39]:34276) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RrGuj-0003Tl-Sd for emacs-orgmode@gnu.org; Sat, 28 Jan 2012 17:38:29 -0500 In-Reply-To: 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: Jonathan Leech-Pepin Cc: emacs-orgmode@gnu.org Hey Jonathan, thanks for the hints, it works like a charm! As far as I can overlook this, adding relative dates to the template expansion should not be a lot of work, basically one just has to add a simple wrapper to org-read-date. I gave some more thoughts to an appropriate symbol and the best I could come up with is '_'. I therefore propose the following:=20 %=C2=A0{EXP}t, %_{EXP}T, %_{EXP}u, %_{EXP}U=20 in a capture-template inserts an (in-)active date-/timestamp that would have resulted from manually entering the expression EXP at the interactive date-/timeprompt.=20 If no serious objections come up, I will put this on my todo-list. Best wishes, Simon On Wed, 25 Jan 2012 12:56:37 -0500, Jonathan Leech-Pepin wrote: > Hello, >=20 >=20 > On Wed, Jan 25, 2012 at 11:42, Simon Campese w= rote: > > > > Dear community, > > > > I want to setup a capture-template that sets a > > SCHEDULE-property in the future (say one week from today) without any > > user interaction. > > > > Currently, I almost achieve this by inserting the line > > > > :SCHEDULED: <%(org-read-date nil nil nil nil nil "+1w")> > > > > into my template. When I now call the template, I end up in the > > date-time-prompt, with "+1w" prefilled, so that manually have to press > > enter. > > > > Maybe it is trivial to call an interactive lisp-function and emulate > > some keypress, in which case I would be thankful for the code that > > achieves this (my lisp-skills are limited). Also, one should be able to > > achieve what I want by using format-time-string and increment the > > current time, but again my lisp-skills prohibit me from implementing it > > myself. >=20 > A similar question had come up on StackOverflow ( > http://stackoverflow.com/questions/7986935/using-org-capture-templates-to= -schedule-a-todo-for-the-day-after-today/7988809#7988809 > ). >=20 > My answer there should apply, adjusting the offset from +1d to +1w : >=20 > =C2=A0 =C2=A0 SCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+= 1d\")) >=20 > Alternately you can include the SCHEDULED: portion within the > timestamp insertion itself. =C2=A0This example will also include a fixed > time at which to schedule the item (unneeded in this case I suspect > but it could be of use elsewhere) : >=20 > =C2=A0 =C2=A0 (org-insert-time-stamp (org-read-date nil t \"+1w 12:00\") = t nil > \"SCHEDULED: \") >=20 > > In any case, it might be a good idea to include non-interactive access > > to relative times in template expansion, so that for example one > > can state something like %t[+1w] or %{+1w}t in the template to get the > > date one week from today (one should spend some more time to specify the > > actual input-format of course...). What do you think? >=20 > I agree, adding the ability to automatically have relative dates would > allow for quicker capture templates if you regularly need to to set > them with a specific offset. >=20 > > Thank you very much, > > > > Simon >=20 > Regards, >=20 > Jonathan