[O] Suggestion for note capture

2019-05-11 Thread Andrea Giugliano
Hi Nathan,

I think I have a starting point for you:

--
(defun ag/org-add-note-to-last-entry ()
  "Add a note to the main agenda file under the latest visited
heading (untested in case the org buffer is not available)"
  (interactive)
  (let ((buffer (car (org-buffer-list 'files 't
(with-current-buffer buffer
  (org-add-note)
  (message "%S" (concat "Adding note in heading: " (fifth 
(org-heading-components)))
---

This function adds a note to the last heading you were editing before
switching file. It is limited to the first file in your
"org-buffer-list" (so does not work if you have multiple org files from
which you generate your agenda).

I imagine you could extend this by choosing the file that has a clock
open (i.e., you need to change the "buffer" binding accordingly), move
to the clocked heading (i.e., add some logic before "org-add-note") and
pointing to the subheading (i.e., again adding some logic before
"org-add-note").

Hope this gives you a lead.

Best,

Andrea


[O] Suggestion for note capture

2019-05-10 Thread Nathan Neff
Hello all,

Long time org user and I would like to hear how other
people accomplish the capturing of log entries in the context
of a currently clocked task.

Context:

I am clocked into * Task A.  I have something about Task A
that I want to log.  Let's say "Ran into some problem and wasted
30 minutes".

I do not want to simply capture this to an "inbox" for later refiling.  I
don't
really want to capture it to a Journal file, either - I know exactly where
the
note should be (it should IMHO be under the currently clocked item in
a subheading "* Log" or in the LOGBOOK drawer of the currently clocked item)

- I know there's a capture template (clock) and item to capture a list item
to the currently clocked
heading
- I know there's C-c C-z to capture to the LOGBOOK drawer of the heading
that
my cursor is on.
- I know there's a way to jump to the currently clocked item, so I could
jump to the
currently clocked item, press C-c C-z and then try to use C-c & to jump
back - however
I can't get C-c & to jump back.
- This request also seems like it should be possible using a capture
template, but I can't
figure out how.

- I would like to combine the two destinations and capture an item with an
inactive
timestamp to the LOGBOOK entry of the currently clocked item

- Optimally, I would like the text of the log entry to show up in the
agenda (but that's
a tall order, and I'm okay with seeing the headline which the LOGBOOK entry
resides
under.

- Can I capture to a subheading of the currently clocked item?  I've tried
this using (clock) and
headline in the capture template, but the capture template keeps adding new
"* Log" subheadings.

Any suggestions?  Or, is this request something that should / could be done
a
different logical way?

Thanks,
--Nate