emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Suggestion for note capture
@ 2019-05-10 19:00 Nathan Neff
  0 siblings, 0 replies; 2+ messages in thread
From: Nathan Neff @ 2019-05-10 19:00 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1769 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 2390 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Suggestion for note capture
@ 2019-05-11 16:37 Andrea Giugliano
  0 siblings, 0 replies; 2+ messages in thread
From: Andrea Giugliano @ 2019-05-11 16:37 UTC (permalink / raw)
  To: Nathan Neff; +Cc: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-05-11 16:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-11 16:37 Suggestion for note capture Andrea Giugliano
  -- strict thread matches above, loose matches on Subject: below --
2019-05-10 19:00 Nathan Neff

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).