[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Capture, template expansion and keyword for link type
From: |
Sébastien Gendre |
Subject: |
Re: Capture, template expansion and keyword for link type |
Date: |
Fri, 12 Jul 2024 18:34:06 +0200 |
User-agent: |
mu4e 1.12.1; emacs 29.4 |
Thank you for your reply.
I wrote more after the quotes below.
Max Nikulin <manikulin@gmail.com> writes:
> Have a look into `org-capture' code. It calls `org-store-link'.
Thank you for this information.
Max Nikulin <manikulin@gmail.com> writes:
>> Is there a way to discover the keywords that a major mode provide to a
>> capture template ?
>
> See specific store link functions, e.g. `org-gnus-store-link'.
Reading the `org-gnus-store-link' function, I see that is set: type,
file, node, link and description.
I have seen that the variable `org-link-parameters' list all the defined
org links. With its different functions, including the store function
(associated with :store parameter).
I wonder if I can write an Elisp function that retrieve all the
properties set for each org link types and tell we at which mode they
are used. After all, with Elisp code could be data too.
But not now.
Anyway, thank you very much. I will explore starting from
`org-link-parameters', as it seems to have a lot of org links.
Max Nikulin <manikulin@gmail.com> writes:
>> A new parameter added to the org-protocol url is only accessible
>> through
>> the ":query" key ? It will not create a new "%:keywoard" automatically ?
>
> With "capture" subprotocol it does not mapped to keywords.
This morning, I have explored how org-capture work. Especially the
capture subprotocol. I think I will need to make another subprotocol.
Maybe a "capture-plus" that will accept any keys and make all of them
accessible as a '%:keymord'.
Max Nikulin <manikulin@gmail.com> writes:
> Not all books have authors in metadata. Some have editors since every
> chapter has its own author. To avoid handling such logic in capture
> templates I decided to resort to formatting inside an extension (or
> formatting performed by a dedicated tool if site has API, e.g.
> GitHub).
Can you tell me more about this ?
Max Nikulin <manikulin@gmail.com> writes:
>> And then, I could simply create a capture template that would use the
>> keywords "%:author", "%:title", etc.
>
> If you are using Emacs-30 I would suggest to keep away from
> org-protocol hacks and to rely on `server-eval-args-left' handled by a
> dedicated function
>
> emacsclient --eval '(my-capture)' 'my-proto://something?param=value'
>
> For older versions you may either use backslash hell like in
> emacsclient-mail.desktop or to define custom subprotocol for
> org-protocol.
Is there any change planned for org-protocole in Emacs 30 ?
The big advantage for org-protocole, is that it's based on an URL that
any external software can recognize and pass to Emacs and it's easy to
write a custom sub-protocole.
signature.asc
Description: PGP signature
- Capture, template expansion and keyword for link type, Sébastien Gendre, 2024/07/11
- Capture, template expansion and keyword for link type, Sébastien Gendre, 2024/07/11
- Re: Capture, template expansion and keyword for link type, Ihor Radchenko, 2024/07/11
- Re: Capture, template expansion and keyword for link type, Max Nikulin, 2024/07/11
- Re: Capture, template expansion and keyword for link type, Sébastien Gendre, 2024/07/11
- Re: Capture, template expansion and keyword for link type, Max Nikulin, 2024/07/12
- Re: Capture, template expansion and keyword for link type,
Sébastien Gendre <=
- Re: Capture, template expansion and keyword for link type, Max Nikulin, 2024/07/14