emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] taking note when clocking out


From: Richard Riley
Subject: Re: [O] taking note when clocking out
Date: Thu, 14 Apr 2011 12:17:26 +0200
User-agent: Gnus/5.110016 (No Gnus v0.16) Emacs/23.2 (gnu/linux)

Giovanni Ridolfi <address@hidden> writes:

> Radosław Grzanka <address@hidden> 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?






reply via email to

[Prev in Thread] Current Thread [Next in Thread]