From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Riley Subject: Re: taking note when clocking out Date: Thu, 14 Apr 2011 12:17:26 +0200 Message-ID: References: <4DA69AAA.9040707@gmail.com> <83ei552q9h.fsf@yahoo.it> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:36684) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QAJd4-0002Ll-R6 for emacs-orgmode@gnu.org; Thu, 14 Apr 2011 06:18:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QAJd3-0006Vu-Vb for emacs-orgmode@gnu.org; Thu, 14 Apr 2011 06:18:26 -0400 Received: from lo.gmane.org ([80.91.229.12]:53011) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QAJd3-0006Vn-Od for emacs-orgmode@gnu.org; Thu, 14 Apr 2011 06:18:25 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QAJd0-0001Dg-Jr for emacs-orgmode@gnu.org; Thu, 14 Apr 2011 12:18:22 +0200 Received: from 85.183.18.158 ([85.183.18.158]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 14 Apr 2011 12:18:22 +0200 Received: from rileyrg by 85.183.18.158 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 14 Apr 2011 12:18:22 +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: emacs-orgmode@gnu.org Giovanni Ridolfi writes: > Radosław Grzanka writes: > >> Hello, >> I cannot find this using google nor browsing documentation so I ask >> for help. Generally I don't want to take notes when I'm clocking out >> except for one task. > You can use the org-clock-out-hook, > > but if you'll post an example, well'have something real to work on: > > 'But I must have something to work on. I cannot burn snow' > Gandalf > > Giovanni ;-) > I thought I'd have a quick crack at this since its ages I tried any elisp Something along the lines of ,---- | (require 'org-clock) | | (defun rgr/check-for-clock-out-note() | (interactive) | (save-excursion | (set-mark (goto-char (org-entry-beginning-position))) | (let ((tags (org-get-tags))) | (message "tags: %s " tags) | (if (member "clockout_note" tags) | (org-add-note))))) | | (add-hook 'org-clock-out-hook 'rgr/check-for-clock-out-note) `---- it uses a tag ("clockout_note") so can benefit from inherit etc. I'm sure its not optimal or well written but a quick test and it worked. btw, when entering a tag "-" is illegal?