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. Is there property I can set that forces me to take note everytime I clock out from this single task? Thanks, Radek.
Radosław Grzanka <radoslawg@gmail.com> 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 ;-)
Giovanni Ridolfi <giovanni.ridolfi@yahoo.it> writes:
> Radosław Grzanka <radoslawg@gmail.com> 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 ;-)
>
From reading the OP he is requesting a way to mark/tag a task so that
when he clocks out he is prompted to take a note.
In this case someone more org savvy might construct something which, in
the clock out hook, sees if, e.g, the "note-at-clockout" property is set
and if so prompts the user for a new note which is then duly attached to
that org item.
Hello,
W dniu 2011-04-14 10:34, Richard Riley pisze:
> Giovanni Ridolfi<giovanni.ridolfi@yahoo.it> writes:
>
>> Radosław Grzanka<radoslawg@gmail.com> 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 ;-)
>>
>
> From reading the OP he is requesting a way to mark/tag a task so that
> when he clocks out he is prompted to take a note.
>
> In this case someone more org savvy might construct something which, in
> the clock out hook, sees if, e.g, the "note-at-clockout" property is set
> and if so prompts the user for a new note which is then duly attached to
> that org item.
Exactly that.
I'm not sure what example I can provide. I'd like to have org file like:
------------------------
#+STARTUP: nolognoteclock-out
* Headline1
* Headline 2
:PROPERTIES:
:CLOCK-OUT-NOTE: t
:END:
* Headline 3
-------------------------
When clocking out from "Headline 2" I'd like to be forced to give a
note. Real life example is that I do not really care about what I have
been doing during my clocked-in time except for some discussions with
client, who is bugging me constantly and I record it under "Headline 2".
I don't mind hooking in and using "unique id" of this task but I'm not
lisp fluent to do that myslef.
Thanks,
Radek.
Giovanni Ridolfi <giovanni.ridolfi@yahoo.it> writes:
> Radosław Grzanka <radoslawg@gmail.com> 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?
Hello,
> 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)
> `----
Mircale! Thank you.
Radek.
Richard Riley <rileyrg@googlemail.com> writes:
Hi, Richard,
nice solution.
>
> btw, when entering a tag "-" is illegal?
yes, underscore should be used.
1. from the manual:
Tags are normal words containing letters, numbers, `_',
and `@'.
2. from the source ;-)
org-set-tags in org.el
tags (org-re "[^[:alnum:]_@#%]+"))
(line 12959)
and few lines (12950) up + or - are used in the search, see
section "Match syntax" under "Matching tags and properties"
in the manual.
Hope that explains.
Giovanni
Giovanni Ridolfi <giovanni.ridolfi@yahoo.it> writes:
> Richard Riley <rileyrg@googlemail.com> writes:
>
> Hi, Richard,
> nice solution.
>>
>> btw, when entering a tag "-" is illegal?
>
> yes, underscore should be used.
>
> 1. from the manual:
> Tags are normal words containing letters, numbers, `_',
> and `@'.
>
> 2. from the source ;-)
> org-set-tags in org.el
> tags (org-re "[^[:alnum:]_@#%]+"))
> (line 12959)
>
> and few lines (12950) up + or - are used in the search, see
> section "Match syntax" under "Matching tags and properties"
> in the manual.
>
> Hope that explains.
>
yeah, I completely had a brain fart over that one. I did actually know
that but .. forgot ... ;)
ps I have signed fsf papers if that little utility snippet is any good
(ok, will need a defvar I guess for the tag used).
Richard Riley <rileyrg@googlemail.com> writes:
Cc:-ed Matt Lundin
>
> ps I have signed fsf papers if that little utility snippet is any good
> (ok, will need a defvar I guess for the tag used).
Maybe in the hack page of worg?
Feel free to reword my English ;-)
Giovanni
------------------ org-hacks.org ------------
** Using and Managing Org-Metadata
[...] <skip>
*** A way to tag a task so that when clocking-out user is prompted to take a note.
-- Richard G. Riley
A small function that, finding the tag "clockout_note" in a headline,
prompts for a note. It uses the tag ("clockout_note") so can benefit
from inherit etc...
#+begin_src emacs-lisp
(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)
#+end_src
Giovanni Ridolfi <giovanni.ridolfi@yahoo.it> writes:
> Richard Riley <rileyrg@googlemail.com> writes:
>
> Cc:-ed Matt Lundin
>>
>> ps I have signed fsf papers if that little utility snippet is any good
>> (ok, will need a defvar I guess for the tag used).
>
> Maybe in the hack page of worg?
> Feel free to reword my English ;-)
Thanks! I put it in org-hacks on Worg.
Best,
Matt
Matt Lundin <mdl@imapmail.org> writes:
> Giovanni Ridolfi <giovanni.ridolfi@yahoo.it> writes:
>
>> Richard Riley <rileyrg@googlemail.com> writes:
>>
>> Cc:-ed Matt Lundin
>>>
>>> ps I have signed fsf papers if that little utility snippet is any good
>>> (ok, will need a defvar I guess for the tag used).
>>
>> Maybe in the hack page of worg?
>> Feel free to reword my English ;-)
>
> Thanks! I put it in org-hacks on Worg.
>
> Best,
> Matt
I think someone needs to rework the set-mark bit. I see from the
docstring it shouldnt be used. I cribbed that bit from some code I wrote
for org-googlecl ages ago which in itself was a "learn by doing" hack.
Richard Riley <rileyrg@googlemail.com> writes: > Matt Lundin <mdl@imapmail.org> writes: > >> Giovanni Ridolfi <giovanni.ridolfi@yahoo.it> writes: >> >>> Richard Riley <rileyrg@googlemail.com> writes: >>> >>> Cc:-ed Matt Lundin >>>> >>>> ps I have signed fsf papers if that little utility snippet is any good >>>> (ok, will need a defvar I guess for the tag used). >>> >>> Maybe in the hack page of worg? >>> Feel free to reword my English ;-) >> >> Thanks! I put it in org-hacks on Worg. >> >> Best, >> Matt > > I think someone needs to rework the set-mark bit. Done. > I see from the docstring it shouldnt be used. Right. I also allowed the function to fail gracefully when there are no tags present. Thanks, Matt