Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Richard Riley <rileyrg <at> googlemail.com>
Subject: Re: taking note when clocking out
Newsgroups: gmane.emacs.orgmode
Date: Thursday 14th April 2011 10:17:26 UTC (over 5 years ago)
Giovanni Ridolfi <[email protected]> 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?
 
CD: 3ms