emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Sébastien Gendre" <seb@k-7.ch>
To: Max Nikulin <manikulin@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Capture, template expansion and keyword for link type
Date: Fri, 12 Jul 2024 18:34:06 +0200	[thread overview]
Message-ID: <87v81atvr5.fsf@k-7.ch> (raw)
In-Reply-To: <v6r5td$rqr$1@ciao.gmane.io> (Max Nikulin's message of "Fri, 12 Jul 2024 19:00:45 +0700")

[-- Attachment #1: Type: text/plain, Size: 2747 bytes --]


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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 849 bytes --]

  reply	other threads:[~2024-07-12 16:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87sewga4ni.fsf@k-7.ch>
2024-07-11  6:59 ` Capture, template expansion and keyword for link type Sébastien Gendre
2024-07-11 13:56   ` Ihor Radchenko
2024-07-11 20:47     ` Sébastien Gendre
2024-07-11 14:05   ` Max Nikulin
2024-07-11 20:36     ` Sébastien Gendre
2024-07-12 12:00       ` Max Nikulin
2024-07-12 16:34         ` Sébastien Gendre [this message]
2024-07-14  8:22           ` Max Nikulin
2024-07-11  3:42 Sébastien Gendre

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.orgmode.org/

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

  git send-email \
    --in-reply-to=87v81atvr5.fsf@k-7.ch \
    --to=seb@k-7.ch \
    --cc=emacs-orgmode@gnu.org \
    --cc=manikulin@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

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

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