[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Integrating eev and org-capture/org-capture-set-target-location
From: |
Eduardo Ochs |
Subject: |
Integrating eev and org-capture/org-capture-set-target-location |
Date: |
Fri, 4 Jun 2021 00:41:03 -0300 |
Hi Jean Louis,
this is an answer to these messages that you sent:
https://lists.gnu.org/archive/html/help-gnu-emacs/2021-06/msg00028.html
https://lists.gnu.org/archive/html/help-gnu-emacs/2021-06/msg00055.html
I decided to create a new thread, and I'm working on org-capture
first. I'll leave org-protocol for later.
I watched Prot's video about org-capture -
https://www.youtube.com/watch?v=qCdScs4YO8k - and I am trying to
implement a function that works as a sexp hyperlink to a "target"
structure like the ones that appear in org-capture-templates. These
target structures are documented here:
(find-evardescr 'org-capture-templates)
(find-evardescr 'org-capture-templates "\ntarget")
(find-evardescr 'org-capture-templates "\ntarget" "file+headline")
(find-orgnode "Capture templates" "file+headline")
(find-orgnode "Template elements" "\ntarget")
In Prot's video he uses targets like these,
(file+headline "tasks.org" "Task list")
(file+headline "tasks.org" "Links to buffers/files")
and I am trying to write a function `find-orgctarget' such that
(find-orgctarget '(file+headline "tasks.org" "Task list"))
would open the file
(concat org-directory "/tasks.org")
and then find the headline "* Task list" in it, and put the point in
the line following that headline. After a few very naive attempts I
got this definition for `find-orgctarget':
(require 'org-capture)
(defun find-orgctarget (target)
(org-capture-set-target-location target)
(org-capture-finalize t))
but when I run this
(find-orgctarget '(file+headline "tasks.org" "Task list"))
I get this error:
org-capture-finalize: This does not seem to be a capture buffer for Org mode
Do you - or anyone else - know how to fix that?
Thanks in advance!
Eduardo Ochs
http://angg.twu.net/#eev
http://angg.twu.net/eev-intros/find-eev-quick-intro.html#3
(find-eev-quick-intro "3. Elisp hyperlinks")
- Integrating eev and org-capture/org-capture-set-target-location,
Eduardo Ochs <=