emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Andrea Giugliano <agiugliano@live.it>
To: Nathan Neff <nathan.neff@gmail.com>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Suggestion for note capture
Date: Sat, 11 May 2019 16:37:59 +0000	[thread overview]
Message-ID: <VI1PR06MB5214E6EF9357D838F3EFC484C70D0@VI1PR06MB5214.eurprd06.prod.outlook.com> (raw)

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

             reply	other threads:[~2019-05-11 16:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-11 16:37 Andrea Giugliano [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-05-10 19:00 Suggestion for note capture Nathan Neff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=VI1PR06MB5214E6EF9357D838F3EFC484C70D0@VI1PR06MB5214.eurprd06.prod.outlook.com \
    --to=agiugliano@live.it \
    --cc=emacs-orgmode@gnu.org \
    --cc=nathan.neff@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).