From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 0PoDGIRCkGaazQAAe85BDQ:P1 (envelope-from ) for ; Thu, 11 Jul 2024 20:37:24 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 0PoDGIRCkGaazQAAe85BDQ (envelope-from ) for ; Thu, 11 Jul 2024 22:37:24 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1720730244; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=3OZfLtN/nXYl51p6avnxY+3hzOfvI6EsJIzetICk7U8=; b=tQdm1hdOEmJxI6osJzqQpgQDNIdcnRTvIoNNB/fNe2Nz5po69m17I6heM1u/tlpUZGKTny QCJo63nPEjnBmuaqdFiS4jLmzXg1fc6qjbMr3LdE6+pKmqhLoDro5yE7OSqsI7wZB9EAPU yvrfEsEt3sct0a6JTDHDZIo6dP/fP//e+1JPOXvK2iuGkLR5u9SdeEPHGYTHyM8V8woEV5 tYrwWi4D879PDWH+xigTpAQmhJ0Ymlc6cJBp7Kdxu6t69rkTbZvP7GW2VIqHA7lsJa104V 9xmFxHnzJeih4Ewr+VjwRHVxwQaAH9DPqwYHgTkrYlHFPx/t2SHdr0cpkAAvjg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1720730244; a=rsa-sha256; cv=none; b=E3qSXcXr7V8gJoCYpeYapVMP5odnCu/A0Ax+jUvsxEgKdVjaEygqGT7pC0bh8JbhFSlqW2 1lWU1KlEZGzgyQULPGhDRAcgv0vFNz8M2iXVmEtFI8qFnySUq5hFAExTpoLU1gRS7Qh18f M2UuyD5zk2FM6f+ruuja8aVjhvDlpveAS6ZWPk95d4J1Kd4o8DqwLedpsvqOFIH9Ho0IJ2 ZopGy/QBuVqNTP/5hjG7VmRw5Pcwk+YA0MaGll46P3sbHKcJvML5tBoUVqjKOd08p+ncen Kj4T0U4agJq2q2JzPd1c9fNDcVtOfXUbSOcBj1ozAoouhiHfTmMvUsHoIPCs8w== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2D81C27BB5 for ; Thu, 11 Jul 2024 22:37:24 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sS0Wl-0006oX-8T; Thu, 11 Jul 2024 16:36:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sS0Wh-0006oG-TL for emacs-orgmode@gnu.org; Thu, 11 Jul 2024 16:36:28 -0400 Received: from 96-100-31-185.ftth.cust.kwaoo.net ([185.31.100.96] helo=k-7.ch) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sS0Wg-0001yf-1x for emacs-orgmode@gnu.org; Thu, 11 Jul 2024 16:36:27 -0400 Received: from van (_gateway [192.168.1.1]) (Authenticated sender: seb) by k-7.ch (Postfix) with ESMTPSA id ADC29E8109 for ; Thu, 11 Jul 2024 22:36:22 +0200 (CEST) From: =?utf-8?Q?S=C3=A9bastien_Gendre?= To: emacs-orgmode@gnu.org Subject: Re: Capture, template expansion and keyword for link type In-Reply-To: (Max Nikulin's message of "Thu, 11 Jul 2024 21:05:04 +0700") References: <87sewga4ni.fsf@k-7.ch> <87r0c08ldo.fsf@k-7.ch> User-Agent: mu4e 1.12.1; emacs 29.4 Date: Thu, 11 Jul 2024 22:36:21 +0200 Message-ID: <87ikxbwtru.fsf@k-7.ch> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Received-SPF: pass client-ip=185.31.100.96; envelope-from=seb@k-7.ch; helo=k-7.ch X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) BAYES_00=-1.9, RDNS_DYNAMIC=0.982, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, TVD_RCVD_IP=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: -8.50 X-Migadu-Queue-Id: 2D81C27BB5 X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -8.50 X-TUID: JGsFigKsHUQl --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Max Nikulin writes: > See the "Link type, Available keywords" table in this section. > `org-capture' may be executed in various Emacs buffers and available > keywords may depend on major mode. Is it necessary to call "org-store-link" before calling "org-capture" to extracet the informations used by theses keywords=C2=A0? Or did I missundertant how it work=C2=A0? I found the documentation unclear about this. Is there a way to discover the keywords that a major mode provide to a capture template=C2=A0? Max Nikulin writes: > Some time ago I tried %(exp) elisp snippets in templates (untested) > > "* [[%:link][%:description]] > #+BEGIN_QUOTE > %i > #+END_QUOTE > %(let ((bla (plist-get (plist-get org-store-link-plist :query) :bla))) > (or bla "No bla"))" > > emacsclient > 'org-protocol:/capture?template=3Ds&title=3DHello&body=3DWorld&url=3Dhttp= :%2F%2Fexample.com&bla=3Dfoo' A new parameter added to the org-protocol url is only accessible through the ":query" key=C2=A0? It will not create a new "%:keywoard" automatically= =C2=A0? What I would love to do, is creating a Firefox extension that can extract different metadata from known well known web site and pass them to an Org-mode capture through org-protocol. For example, for a book, extracting author, title, year, etc. And then, I could simply create a capture template that would use the keywords "%:author", "%:title", etc. I was also thinking, instead of a Firefox extension, creating an Elisp function that take a web page URL as parameter, extract the metadata from the web page and then call Org-capture providing the keywords "%:author", "%:title", etc, to the template. But I don't know how to do the last part and I cant found documentation about it. And with this second solution, I don't know how to make it work with org-protocol. As an org-protocol call result directly in an Org-capture call. And extracting metadata from Firefox give more flexibility on manually selecting information to extract on the web page. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQI/BAEBCAApFiEEaA9vw9ypVj1kP0tAtYb3x3I54p4FAmaQQkULHHNlYkBrLTcu Y2gACgkQtYb3x3I54p6JOQ//e3x1Cz2DnLgXAKEll4EEQjrbz6bp9jrLE5fnNpCs dA4phot+S1JfR+VgomLLMDbnHjBY2krplK2DtaPvKPcYhHjfloSzyqXx+fcrcE2B XoC5HUvaUNDrXAQEuTTaxTRUn4Y9HKYYnnrmq3VkPBwK7+1e/4B6MP/Ib9vowbuD 8lEKDkQsRsVFtYhOKYOfjCcEeFvmzVKj6OOhvuKXTV5enOcrf/W51j4r+kwmPUur oJjHBlf2+CL2C0SbcPra8XEtdXbiZXHAC/RDoYo52+u6lQTsusHJ9P2p9owKPm9O 61qg06It7tJjE1z3Ch7+8+pOs6yXuZ/lLbqFqS1ZEvEMKYb+DvVcv2BavsH1ohIy w5LMfoluKfqBqC6i0s3WHt7XspaENO2kLfsdm91LzzW0v0BFZSPUMJZgqoZc2nHM B5eS3vLdAgvHcilWqGfrCYZopws1FS/QIbAc3hzPVyor738gxlSYsYcIaHy7saEO SX+xola/SMvnGV3PdDh3oIExTlBcV5YFHfINSGpNhjAjYz3RpS43+fkC455xCIMn 8GcQCVDtE98MuWX49YtetZKRNHzaGUv/Lg32ypstPZ3yK4qaOr072fPUL/CMhpOY lKGFwpAZfwvoN0bwOrrX/90jWQ6JJdTsnerv0qRD6dnQfOyvN5qctFK0H2joj+a2 dm0= =EfDd -----END PGP SIGNATURE----- --=-=-=--