emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: looking for examples of `org-capture-templates` working with `org-pr


From: chris
Subject: Re: looking for examples of `org-capture-templates` working with `org-protocol://capture`
Date: Mon, 31 Jan 2022 04:07:01 +0100

On Monday, 31 January 2022 03:30:41 CET chris wrote:

> Hi,

> When you do

> `emacsclient "org-protocol://capture?

> template=X&url="">

> I don't understand at all how you make use of `url` `title` and `body` in

> `org- capture-template`.

> I understand there is some sort of "encoding" that doesn't make use of the

> keywords `url` `title` or `body`, but it's dense.

> There are no indications of how to do that here:

> https://orgmode.org/manual/The-capture-protocol.html[1]

> I haven't found any example that I've been able to reproduce in the whole

> web. I've spent hours on the documentation and the source code of

> https://github.com/emacs-mirror/emacs/blob/master/lisp/org/org-protocol.el[2

> ] And I have absolutely no idea of how to use `url` `title` and `body` in

> `org-capture- template`.


The last example in https://blog.jethro.dev/posts/capturing_inbox/, namely:

```emacs-lisp

(setq org-capture-templates

      `(("l" "org-protocol-capture" entry

         (file "~/path/inbox.org")

        "* TODO [[%:link][%:description]]\n\n %i"

        :immediate-finish t)))

```

Seems to work consistently with:

`xdg-open "org-protocol://capture?template=l&url="" --iso-8601=s)&title=TITLE$(date --iso-86
01=s)&body=BODY$(date --iso-8601=s)"`


Provided I have opened at least one org buffer before hand, otherwise it opens a buffer named `"org-protocol://capture?template=l&url="" />` at what point it can get messy. Probably I have to "start" somehow "org-mode" first, and it doesn't get enough started from my `init.el`.


Goal is to have the capturing work in the background, with emacs started as a daemon, but with no opened emacsclient frame:

capture, simply, silently, unobtrusively.


> Chris

>

> --------

> [1] https://orgmode.org/manual/The-capture-protocol.html

> [2]

> https://github.com/emacs-mirror/emacs/blob/master/lisp/org/org-protocol.el


reply via email to

[Prev in Thread] Current Thread [Next in Thread]