all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Non-interactive org-schedule
@ 2013-09-23 10:46 Marcin Borkowski
  2013-09-23 19:46 ` Marcin Borkowski
  0 siblings, 1 reply; 3+ messages in thread
From: Marcin Borkowski @ 2013-09-23 10:46 UTC (permalink / raw)
  To: Org-mode mailing list

Hi all,

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?

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Non-interactive org-schedule
  2013-09-23 10:46 Non-interactive org-schedule Marcin Borkowski
@ 2013-09-23 19:46 ` Marcin Borkowski
  2013-09-23 20:45   ` Marcin Borkowski
  0 siblings, 1 reply; 3+ messages in thread
From: Marcin Borkowski @ 2013-09-23 19:46 UTC (permalink / raw)
  To: emacs-orgmode

Dnia 2013-09-23, o godz. 12:46:35
Marcin Borkowski <mbork@wmi.amu.edu.pl> napisał(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,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Non-interactive org-schedule
  2013-09-23 19:46 ` Marcin Borkowski
@ 2013-09-23 20:45   ` Marcin Borkowski
  0 siblings, 0 replies; 3+ messages in thread
From: Marcin Borkowski @ 2013-09-23 20:45 UTC (permalink / raw)
  To: emacs-orgmode

Dnia 2013-09-23, o godz. 21:46:10
Marcin Borkowski <mbork@wmi.amu.edu.pl> napisał(a):

> [...] 
> (I'm writing a custom org-insert-habit function, so that I can
> [...] 

#+BEGIN_SHAMELESS_PLUG
Just in case someone might need something like this.  (Not that it's
difficult, but why reinvent the wheel.)  The code is ugly and crude,
and not very general, but works for me.

http://mbork.pl/2013-09-23_Automatic_insertion_of_habit_templates_%28en%29
#+END_SHAMELESS_PLUG

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-09-23 20:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-23 10:46 Non-interactive org-schedule Marcin Borkowski
2013-09-23 19:46 ` Marcin Borkowski
2013-09-23 20:45   ` Marcin Borkowski

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.