emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Clock-in task when emacs starts


From: Bernt Hansen
Subject: Re: [O] Clock-in task when emacs starts
Date: Tue, 12 Apr 2011 09:31:33 -0400
User-agent: Gnus/5.110015 (No Gnus v0.15) Emacs/23.2 (gnu/linux)

Radosław Grzanka <address@hidden> writes:

> Hello,
>   is it possible to select and clock-in default task when emacs starts?
>
> I'm trying to implement GTD setup as described here
> http://doc.norang.ca/org-mode.html and I like concept of
> "punching-in". However, I found out it is not necessary for me to
> select "default task" each time I punch in becaue I have only one such
> task.
>
> Therefore, I'd like to set default task and clock it in when emacs starts.
>
> Any help?
>
>  Thanks,
>   Radek.

Hi Radek,

Sure it is possible.  You can identify a task by a globally unique id
and clock that in.  I have a function for this but I don't use it
anymore.

I've modified the org-clock-in call to provide the double prefix
argument so it also sets this as the default task.

Now you can just call (bh/clock-in-organization-task) in your .emacs or
bind it to a key to set that task to the default.

--8<---------------cut here---------------start------------->8---
(require 'org-id)

(defun bh/clock-in-organization-task ()
  (interactive)
  (bh/clock-in-task-by-id "eb155a82-92b2-4f25-a3c6-0304591af2f9"))

(defun bh/clock-in-task-by-id (id)
  "Clock in a task by id"
  (save-restriction
    (widen)
    (org-with-point-at (org-id-find id 'marker)
      (org-clock-in '(16)))))
--8<---------------cut here---------------end--------------->8---

Regards,
Bernt




reply via email to

[Prev in Thread] Current Thread [Next in Thread]