From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 0Bv0OEmSWGfHxwAAqHPOHw:P1 (envelope-from ) for ; Tue, 10 Dec 2024 19:11:06 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id 0Bv0OEmSWGfHxwAAqHPOHw (envelope-from ) for ; Tue, 10 Dec 2024 20:11:06 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=DFx0wRGs; 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=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1733857864; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=YFXFlERHDOsbKqeUornr0Oi37D/8BCmPAVD7YB0/354=; b=p+20S1lV+/h9y0fyYMllNBZthnA1xQrZL4bpyWYgZFfQu1W+TjrzyoOt4CXHCPQmV8wg+P 7MW358mNpWXbSfmpG/YSwuDu2Tw7uahpvvPMS6KpZrWGQ5cyVIvy9kaOzi2nOKehOe9EyR CyUrh5fiuv3eg/4+4Pj6LgZvn2beAqU+uza92BkTJWXAqybx2S/K7D5qKnBgp+K10mkH78 gNRn5tKMwiwF9wY4Qzi8Bp2MwCcDKFWfb6jfQtN/hS7I835cp2vtLb9Jn7VuAkYBUKCkzR cskmBZTu8XxQbuM/ru8A3n10hdi9ENqN3EB0Wz1Of5zCzSktvR7Aikbl+D2ZoQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=DFx0wRGs; 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=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1733857864; a=rsa-sha256; cv=none; b=mP9kPuQxrTyCGo+3cPAm4jNAGWFwxHld8r0m28vZw90NqeX8R3jwjeFA+RgpvBG9g3z6wY pSs/qBth/5oqgeKtEiMNDyKbYU6H7i2oxyk7kwQc2FbYfTQ0iUuZJpJUjQXH9AgD2fn4cY ZQzHKXrDUJMnIt66TlrXVOdRdJVrLGecFEO9Vs8emPSSgvPO8M4wVubm6ca980znVDG99a gy7CEMgg8WU+GgVqEVKXcQVSM1DumGW09wGS23SLTU/XE1zG8cBLF/sGWSuFXoqsoBg952 GYz/MWzPr2j9W6NROkCaoI9QmSGztgUrRrO5ik8iMOOcBetj7gfO4lU9/ASwhQ== 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 C27E1428A9 for ; Tue, 10 Dec 2024 20:11:04 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tL5ck-0003SC-Q6; Tue, 10 Dec 2024 14:10:22 -0500 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 1tL5cf-0003RY-GZ for emacs-orgmode@gnu.org; Tue, 10 Dec 2024 14:10:19 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tL5cY-0000lk-MW for emacs-orgmode@gnu.org; Tue, 10 Dec 2024 14:10:16 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 724EC240028 for ; Tue, 10 Dec 2024 20:10:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1733857806; bh=tsI3zdDP9IdBlH4RH/4nYrS00UASaAdDTpsZ7IfZvFw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:From; b=DFx0wRGs4PlW9rAlAIb4fTvRybShcr3z/5FjowlvzXjLhsjn+RR5RljE5pSyIquEb Uz/mr/GlSIavhfV/TjdEOWrkDNCVRkP/gyG/vtXjbw75N1lcMv6GE6ogF8VDKEvYU8 tFVryGivl3qtscEzQNl834BJktqWNNl3ESLg/XzIfgHYzw/41Fi1yQW7we7KT+Dply 8RnZD5cpyoj5tvaK/rwQS7T2uNjimA9qEfGjXyXo6p0twhwz48W8U0TSUMarvuHjKB w5BRiGv42Q7U7QqowwlblVF09llehckv4JXKLCYn3Hc9RoA2nD+3c/YLRBXILH5R/c q0OUjKYNnnoRA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Y77bK5g3Kz6tvc; Tue, 10 Dec 2024 20:10:05 +0100 (CET) From: Ihor Radchenko To: =?utf-8?Q?Tor-bj=C3=B6rn?= Claesson Cc: emacs-orgmode@gnu.org Subject: Re: Fwd: Org-cite: Replace basic follow-processor with transient menu? In-Reply-To: <878qt7fbki.fsf@gmail.com> References: <8734m28l9a.fsf@gmail.com> <87a5eievav.fsf@localhost> <87wmhlmp83.fsf@gmail.com> <871pzte929.fsf@localhost> <87v7x548ri.fsf@gmail.com> <87y120daue.fsf@localhost> <874j4m9ep6.fsf@gmail.com> <87h68gfqj1.fsf@localhost> <87pln3f3cc.fsf@localhost> <87jzd9ojj0.fsf@localhost> <87cyj0ajm9.fsf@gmail.com> <87zfm4s50x.fsf@localhost> <87wmh8s358.fsf@localhost> <87y11nwp9z.fsf@gmail.com> <87v7wd9a2h.fsf@localhost> <878qt7fbki.fsf@gmail.com> Date: Tue, 10 Dec 2024 19:11:36 +0000 Message-ID: <87o71jwdxz.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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-Migadu-Scanner: mx11.migadu.com X-Migadu-Spam-Score: -3.88 X-Spam-Score: -3.88 X-Migadu-Queue-Id: C27E1428A9 X-TUID: orpsaP6kTK6c Tor-bj=C3=B6rn Claesson writes: >> 1. Ideally, we want at least one more menu entry here. Otherwise, the >> menu is not very useful. > ... > 1. The infrastructure is very useful in itself, but I have added an > option to add the DOI to the kill ring, it seems innocent enough. I had > first thought that I would like to, as a next step, add a helper > function to try really hard to get a citation key from a citation, but > lets go with this. Thanks! > +(defcustom org-cite-basic-follow-actions > + '[["Open" > + ("b" "bibliography entry" (org-cite-basic-goto !citation !prefix))] > + ["Copy" > + ("d" "DOI" > + (kill-new > + (save-excursion > + (with-temp-buffer > + (mapc #'insert-file-contents org-cite-global-bibliography) > + (bibtex-set-dialect (parsebib-find-bibtex-dialect) t) > + (bibtex-search-entry (org-element-property :key !citation)) > + (setq doi (bibtex-autokey-get-field "doi")) > + (replace-regexp-in-string "^http://dx.doi.org/" "" doi)))))]] > + "Actions in the `org-cite-basic-follow' transient menu. Two comments here: 1. It should not be a lambda. Better have a function or even command 2. The logic is not right. You should better follow `org-cite-basic--key-completion-table': `org-cite-basic--parse-bibliography', `org-cite-basic--get-entry', and `org-cite-basic--get-field'. --=20 Ihor Radchenko // yantar92, Org mode maintainer, Learn more about Org mode at . Support Org development at , or support my work at