unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Eduardo Ochs <eduardoochs@gmail.com>
To: help-gnu-emacs <help-gnu-emacs@gnu.org>, Jean Louis <bugs@gnu.support>
Subject: Integrating eev and org-capture/org-capture-set-target-location
Date: Fri, 4 Jun 2021 00:41:03 -0300	[thread overview]
Message-ID: <CADs++6gird51u7L8u7AtzjU7si0T8Mps_K=oqh+_2-LP__omew@mail.gmail.com> (raw)

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



             reply	other threads:[~2021-06-04  3:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-04  3:41 Eduardo Ochs [this message]
2021-06-04  6:00 ` Integrating eev and org-capture/org-capture-set-target-location 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

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.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='CADs++6gird51u7L8u7AtzjU7si0T8Mps_K=oqh+_2-LP__omew@mail.gmail.com' \
    --to=eduardoochs@gmail.com \
    --cc=bugs@gnu.support \
    --cc=help-gnu-emacs@gnu.org \
    /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.
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).