From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcin Borkowski Subject: Re: Non-interactive org-schedule Date: Mon, 23 Sep 2013 21:46:10 +0200 Message-ID: <20130923214610.2ba641f7@aga-netbook> References: <20130923124635.4622c5dd@aga-netbook> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55197) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOC5O-0004mx-DK for emacs-orgmode@gnu.org; Mon, 23 Sep 2013 15:46:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VOC5H-0001iA-QR for emacs-orgmode@gnu.org; Mon, 23 Sep 2013 15:46:22 -0400 Received: from msg.wmi.amu.edu.pl ([2001:808:114:2::50]:45067) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOC5H-0001h7-IG for emacs-orgmode@gnu.org; Mon, 23 Sep 2013 15:46:15 -0400 Received: from localhost (localhost [127.0.0.1]) by msg.wmi.amu.edu.pl (Postfix) with ESMTP id 9A0984AA25 for ; Mon, 23 Sep 2013 21:46:13 +0200 (CEST) Received: from msg.wmi.amu.edu.pl ([127.0.0.1]) by localhost (msg.wmi.amu.edu.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id esqjr22wz48D for ; Mon, 23 Sep 2013 21:46:13 +0200 (CEST) Received: from aga-netbook (99-52.echostar.pl [213.156.99.52]) by msg.wmi.amu.edu.pl (Postfix) with ESMTPSA id C2E1A4AA20 for ; Mon, 23 Sep 2013 21:46:12 +0200 (CEST) In-Reply-To: <20130923124635.4622c5dd@aga-netbook> 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 Dnia 2013-09-23, o godz. 12:46:35 Marcin Borkowski napisa=C5=82(a): > I'd like to call org-schedule from an Elisp function. I'd like it to, > say, insert today's date by default, and as a bonus, a repeater (I'm > writing a custom org-insert-habit function, so that I can automate > setting the STYLE and LOGGING proerties). Calling just (org-schedule) > did not work. How to do that? OK, so I did my homework. (I had done it previously, too, but I ran (apropos "today") which wasn't exactly what was needed;).) Here's the code: (org-schedule nil (format-time-string "%Y-%m-%d" (current-time))) Adding a repeater seems to require something along the lines of (save-excursion (search-forward ">") (backward-char) (insert (concat " .+" (read-string "Minimum interval: ") "/" (read-string "Maximum interval: ")))) (I realize that this is *very* crude implementation, but remember that it's a quick-and-dirty hack to be used once every few days at most, so coding it in an elegant way would be a bit of waste of time...) > Best, Cheers, --=20 Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Adam Mickiewicz University