From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: Re: Clock-in task when emacs starts Date: Tue, 12 Apr 2011 09:31:33 -0400 Message-ID: <87k4eztx3e.fsf@norang.ca> References: <4DA42568.4000102@gmail.com> 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]:49273) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q9dh1-0008UA-Bu for emacs-orgmode@gnu.org; Tue, 12 Apr 2011 09:31:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q9dh0-0002k7-3K for emacs-orgmode@gnu.org; Tue, 12 Apr 2011 09:31:43 -0400 Received: from mho-02-ewr.mailhop.org ([204.13.248.72]:55873) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q9dgz-0002jE-T1 for emacs-orgmode@gnu.org; Tue, 12 Apr 2011 09:31:42 -0400 In-Reply-To: <4DA42568.4000102@gmail.com> (=?utf-8?Q?=22Rados=C5=82aw?= Grzanka"'s message of "Tue, 12 Apr 2011 12:11:52 +0200") 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: radoslawg@gmail.com Cc: Org-mode ml Rados=C5=82aw Grzanka 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