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

2011-04-13 Thread Radosław Grzanka

--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---


Thanks Bernt, that is so cool. In fact I conceived something simillar 
but it dependent on exact headline name. Your version is way more versilite.


Thanks!




[O] Clock-in task when emacs starts

2011-04-12 Thread Radosław Grzanka

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.



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

2011-04-12 Thread Bernt Hansen
Radosław Grzanka radosl...@gmail.com 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