From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id MEZdGJMFQmeyKgAAe85BDQ:P1 (envelope-from ) for ; Sat, 23 Nov 2024 16:40:51 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id MEZdGJMFQmeyKgAAe85BDQ (envelope-from ) for ; Sat, 23 Nov 2024 17:40:51 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=aQHDe5tP; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1732380051; a=rsa-sha256; cv=none; b=Af2C9YW6q3uvCWNnb7A7zOxhkfJ58lv/y2y+qFGD1GpE7g+aCWIlAmvxHrC1efNSbn9I5q RxaOGWibHwlW+JaVcIOaOfPHCzFDcflJq1sJg57PFZeYKHmdvMgfAmKPpqokmsBAOJHEPW diV9dbFqBbq8gT365a0yjn6Cq+FYrb43q1RR6fYGzq7LPKJ4uQtzYgDF19AH7NSMOtlYDF lHGGDpQnGsAiJKh3siJe1TrgYhDveVbAANeqXGCYhuU67Xth8fMCxqdmtlR0B6CIvZo8jE 1beBQIvpXfjzV+pkJEwWVIUyZpBwkCm0cUtBgdIe3KfLPacpRJ0eD6wwG/Qh0A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=aQHDe5tP; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1732380051; 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=fHYLbqKhiN950N8JltT0eVQu8X2fb3qbNdKkv5vijto=; b=FM0wZXZRtGKWSYj6pu/uPQYPA9Iacb0cFLfi6gpwy3jPorGoixWjohhoDOUgObOwk2Huzf 9T3t15MpQu7LUKL+nQWKvGAwpfmwxYQ68i1FR9/Ezg15cSkMzqJuV/7od3QmC+lByypZ5x hI/EMuq9iduiYhwQYFx1+3wXI+Na0w8mkRSIYM3Cu0gAPxXQJ02l/nP6O1eQZQgirkq4rW 2Zo7cEtmrrDIROf+56RJwwMqgF7EnDC0r1SH29aKP10jPDahtQuDFmku9uJHY/2v76MN7Q LDbRxsqpWa1BLtIfOkSzycKE8qeI76iZck5wJRQ73D+Z6xLpCGTlbH9NpnupWA== 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 09D4119E97 for ; Sat, 23 Nov 2024 17:40:51 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tEtB9-0004Qp-KO; Sat, 23 Nov 2024 11:40:15 -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 1tEtB7-0004QI-Le for emacs-orgmode@gnu.org; Sat, 23 Nov 2024 11:40:13 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tEtB5-0008Dt-Bd for emacs-orgmode@gnu.org; Sat, 23 Nov 2024 11:40:13 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 28250240101 for ; Sat, 23 Nov 2024 17:40:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1732380008; bh=FG9nxCol6Q5JFPCtsrFnVx5Y1ozlAXAkfc2B0F+RL8E=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:From; b=aQHDe5tPe8rIU2YVs2UHbSj3NeUzmHE34zH1JQqLS3pSoVjoMRzFqCSUhO5oIbCC/ oWXgAFYiy7hoUgDbkP9YWa68rytzCcs3EHIwAT0sykGhH5yPDN63RueYR93s6nlqOr gcKEA9fBd4fWNDoFEFlmxeE+uWndBXQQqiEDZw57zzOSZRt7KuGu8VY07idxXmT2Ve tb96j24jDAAtUR4dzk+W2A5AbRzjcxBCYq44PNfg9TFcG0l2ZLfrYYrB6Wlk/qcnfn qG6JMYkXnP5IFGVmVpPiIA75t1g9/DVa48yWRDH14QSuJNwSyNh8JvVCfCLzhQeiOA fAun3BHvzgcag== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Xwd475Srmz9rxK; Sat, 23 Nov 2024 17:40:07 +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: References: <8734m28l9a.fsf@gmail.com> <874j4sccuv.fsf@localhost> <87jzdo2e4m.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> Date: Sat, 23 Nov 2024 16:41:42 +0000 Message-ID: <87v7wd9a2h.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.66; envelope-from=yantar92@posteo.net; helo=mout02.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_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -4.00 X-Spam-Score: -4.00 X-Migadu-Queue-Id: 09D4119E97 X-Migadu-Scanner: mx12.migadu.com X-TUID: Hw3XqYZ6aYlW Tor-bj=C3=B6rn Claesson writes: > Ah, then it has to go. Here comes a fixed patch. ... Thanks. See my comments below. > +*** Menu for choosing how to follow citations Maybe "New transient menu when following citations" > +Following citations with the org-cite-basic citation backend can now pre= sent a > +transient menu. To show this menu, set ~org-cite-basic-follow-ask~ to no= n-nil.=20 > +This behaviour can be reversed with a negativ prefix. "-4" prefix. Not negative. > +This behaviour can be reversed with a negative prefix argument. Same. "-4". > +(defcustom org-cite-basic-follow-actions > + '[["Open" > + ("b" "bibliography entry" (org-cite-basic-goto !citation !prefix))]] > + "Actions in the `org-cite-basic-follow' transient menu. > + > +This option uses the same syntax as `transient-define-prefix', see Info = node > +`(transient)Binding Suffix and Infix Commands'. In addition, it is poss= ible=20 > +to specify a function call for the COMMAND part, where !citation and=20 > +!prefix can be used to access those values." > + :group 'org-cite > + :package-version '(Org . "9.8") > + :type 'sexp) 1. Ideally, we want at least one more menu entry here. Otherwise, the menu is not very useful. 2. It would be nice to provide some examples on using !citation and !prefix in the docstring. Also, lambdas. 3. We need to explain what !citation and !prefix refer to. > +(transient-define-prefix org-cite-basic-follow (citation-object &optiona= l prefix) > ... > +This behaviour is inverted when the transient is called with a negative = prefix > +argument. -4 prefix > +(defun org-cite-basic-follow--parse-suffix-specification (specification) > + "Handle special syntax for `org-cite-basic-follow-actions'." > + (pcase specification > + (`(,key ,desc (lambda ,args . ,fn-args) . ,other) > + `(,key ,desc > + (lambda ,args > + ,(unless (and (listp (car fn-args)) > + (equal (caar fn-args) > + 'interactive)) > + '(interactive)) > + (let ((!citation (car (transient-scope))) > + (!prefix (cadr (transient-scope)))) This can be improved a bit. Rather than storing transient scope as (list citation prefix), we can use plist: (list :citation citation :prefix prefix). Then, we can do (let ((!citation (plist-get (transient-scope) :citation)) (!prefix (plist-get (transient-scope) :prefix))) ...) It will be more readable. --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at