all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Integrating eev and org-capture/org-capture-set-target-location
@ 2021-06-04  3:41 Eduardo Ochs
  2021-06-04  6:00 ` Jean Louis
  0 siblings, 1 reply; 6+ messages in thread
From: Eduardo Ochs @ 2021-06-04  3:41 UTC (permalink / raw)
  To: help-gnu-emacs, Jean Louis

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")



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

end of thread, other threads:[~2021-06-04 23:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-04  3:41 Integrating eev and org-capture/org-capture-set-target-location Eduardo Ochs
2021-06-04  6:00 ` Jean Louis
2021-06-04 16:09   ` Eduardo Ochs
2021-06-04 18:14     ` Jean Louis
2021-06-04 22:28       ` Eduardo Ochs
2021-06-04 23:33         ` Jean Louis

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.