From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: [PATCH] Add shortcuts to org-clock-select-task Date: Tue, 25 Jan 2011 06:55:05 +0100 Message-ID: <0B91122C-5BB7-4135-8CED-3978442B9AC7@gmail.com> References: <87hbcynmy3.fsf@home.drieu.org> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=53432 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Phbs1-0007Gs-HH for emacs-orgmode@gnu.org; Tue, 25 Jan 2011 00:55:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Phbrx-0000yW-GF for emacs-orgmode@gnu.org; Tue, 25 Jan 2011 00:55:13 -0500 Received: from mail-ey0-f169.google.com ([209.85.215.169]:41026) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Phbrx-0000yG-8z for emacs-orgmode@gnu.org; Tue, 25 Jan 2011 00:55:09 -0500 Received: by eyh6 with SMTP id 6so2274936eyh.0 for ; Mon, 24 Jan 2011 21:55:08 -0800 (PST) In-Reply-To: <87hbcynmy3.fsf@home.drieu.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Benjamin Drieu Cc: emacs-orgmode@gnu.org Applied, with name change of hook to org-clock-before-select-task-hook. - Carsten On Jan 24, 2011, at 8:03 PM, Benjamin Drieu wrote: > > Hi Org-moders, > > I am often frustrated because I clock a lot of things and some of them > are repeated (i.e, coffee, read mails, etc.). So when I want to clock > time I spend drinking coffee, the best I found was to search for a > headline matching "Coffee". Or to tag frequent clocks and do some > agenda research on this tag. Too long. :-) > > So here is a solution for this need : to add a shortcut property to > entries I would like to "bookmark" and insert matching entries in the > org-clock-select-task menu. This can be done with : > > * TODO Pause and drink coffee > :PROPERTIES: > :SHORTCUT: p > :END: > > then C-u C-c C-x C-i p. And voil=E0, "Pause and drink coffee" is =20 > clocked! > > Here is a patch that adds a hook into org-clock-select-task and a =20 > module > that adds the shortcut feature. I tried to be the least intrusive > possible, if this proves to be useful, the hook trick might not be > needed. > > Benj > > --=20 > * Benjamin Drieu - http://www.april.org/ > * Soutenez le logiciel libre, rejoignez l'April > http://www.april.org/association/campagne-adhesion/ > * La comptabilit=E9 personnelle libre pour tous - http://grisbi.org/ > diff --git a/lisp/org-clock.el b/lisp/org-clock.el > index 17fccae..8f2f353 100644 > --- a/lisp/org-clock.el > +++ b/lisp/org-clock.el > @@ -420,6 +420,7 @@ of a different task.") > (if (fboundp 'int-to-char) (setf (car s) (int-to-char (car = s)))) > (push s sel-list))) > org-clock-history) > + (run-hooks 'org-clock-select-task-hook) > (org-fit-window-to-buffer) > (message (or prompt "Select task for clocking:")) > (setq rpl (read-char-exclusive)) > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode