From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.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 2C8HAErGIWcpzQAA62LTzQ:P1 (envelope-from ) for ; Wed, 30 Oct 2024 05:38:18 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id 2C8HAErGIWcpzQAA62LTzQ (envelope-from ) for ; Wed, 30 Oct 2024 06:38:18 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=NBDS9Rpe; dmarc=pass (policy=none) header.from=gmail.com; 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=1730266697; a=rsa-sha256; cv=none; b=SU3rk0QlJiHcriCBAtCu64LrQJlRSpjpPlMX9I5zl60WOhsVP6ljiBdnUTWDnnQnzve/+D aOeZCEcdW/rXbotOsLXlbm2P13IfZ08qCG7dREUxEAZlU/dXjyNARF2nBfTCDkGGL7IbX+ 9nsGMwDJrYijnaXBDyARIQMyS3esDxtV4NF+PnU3jrdEgSOIaD8hJHJYoAQvzKbCmTR6lr dlvuEjyGG7jllchh9LacFGy7LdowOrprHDrMWD6v6X+tES9veUmR0BVwFlt4VBDzMy8T9v 7Lcb+1+RW57+htckHGF0+d5zfSbB/OeK07N5FvBiOL1n4WSaAtFiYH3C9NeczA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=NBDS9Rpe; dmarc=pass (policy=none) header.from=gmail.com; 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=1730266697; 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=0AxYxRZk8N80OEbwK6qj/iw7AOtKppOkspAb6n4utDk=; b=fXlSxmLvXJioDMfeeCnMV7w1RwAcGOFvRx4ffKoCuUKHJsnYIfOyo2zOKxtS0WRX7YkIzv dlzksU2cp6lvfsaEs5WBEcYriYKho1T+XWGX6MLtZlGYO3jCxRXWf0qKXGcRxMTD60JBt+ Kb8yFyMjzeqeexvV4155bnhnrApN6GCGnBsEiEohx7ScphmNu7bbP7mXkW3UA8uB407zCL tiouPFxsBjVkhkqnaJVAbyi+T+P3GTox13SEsj77MLFd2KuZ7sN9VsgI4lPwBkVmcsV/kL B0tT5wf3wZEvvtGJExBml+xPUPtrWwJJV7vj4wyok2lZvy6ePa0aT92rrFg3FQ== 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 6347D3403B for ; Wed, 30 Oct 2024 06:38:17 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t61OU-0000tX-7s; Wed, 30 Oct 2024 01:37:22 -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 1t61OS-0000t6-A8 for emacs-orgmode@gnu.org; Wed, 30 Oct 2024 01:37:20 -0400 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t61OQ-0006y0-E2 for emacs-orgmode@gnu.org; Wed, 30 Oct 2024 01:37:20 -0400 Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-539f58c68c5so10292301e87.3 for ; Tue, 29 Oct 2024 22:37:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730266635; x=1730871435; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0AxYxRZk8N80OEbwK6qj/iw7AOtKppOkspAb6n4utDk=; b=NBDS9RpeG77T6zv2NTDmD5M5Sreqm+P23N4Pvg6Z8kEn6rIoyTekNgACBtnMpFmM9Y 030URxbhlajQ8vgwQkUrLSrKOf+dGexnEn+YLce1OYETDQJDZkqF5Wt/l6pSFbtXiTXk GR3/+i8hb46JEq8/V3eZHGvDoi+CJgMvZ18HNShZJxJ8X4Zzm2KiEHfZoeLV4DwdIu/w LxfSa/oalRt9JyZdrGUANulXyHtRlSnB6KQsz36Ti9zmYi7gUikmbHaEvfTODUMcB51o Vpk4lEQCyScQUWxGN/JwrcLz+lKYH+lkWq4M3a9TIL6FiSPdK7z1TgOGsnDLi8PwnOrW 9Guw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730266635; x=1730871435; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=0AxYxRZk8N80OEbwK6qj/iw7AOtKppOkspAb6n4utDk=; b=EquCMeHf3M7zE4CHKK3FBbcvPF0eXcLZT4le+ZxJ4YCmEaDSgxxXKxHeDVdQ4yTId+ 6O7Rj9wknUZG0uUy1yXI1wPFneGH75G7qRyBxVlB1DmBQ/rDDfMxbYnxPHi4pqdc1F0w ZMkqAPihEQ2Y4C+pE6E9HAr3aUDfSyFh6TaTvMQhToXQd21jqvKsbZLf6fqVtodFduVk 3exVEVYrbvhWKLDq8WHOgB7eo78zthHANhbhQj5FebN6/CZxpsvcx4TDnS/TvGvlSO3E 3u7Ix0qp2cyVb9OPUh3zNjbEyM0irl7NDX54IiV0MF6jUdEX0M0ZGmWOB0HpZCgH0sk1 Yajw== X-Forwarded-Encrypted: i=1; AJvYcCW58I9g1nL4bRZF13IXVy7CQm5GmG3FgGND79tZjkpK/AgLYspfVqSj0lZ01IUupTCxDcwsqDBYLH/Q5r0i@gnu.org X-Gm-Message-State: AOJu0YwgYmk7D3k0hSxRsyL1cksq7XHFcxeKMHojJ4zjCqrBSEAAlbb1 BvPLRA/W8fYy+yB9EKCjEEZvnU9PypWKACsrdDQCylnWM+qlS8cwT8Ikwg== X-Google-Smtp-Source: AGHT+IH/SEM04QZTGJ/uGWbziuQTvfVuZH+SV00kZLK3yfqH6vWJ45QPF87XReeNsAVxRxx64Ra3Iw== X-Received: by 2002:a05:6512:3b97:b0:533:71f:3a3d with SMTP id 2adb3069b0e04-53b348da746mr10968365e87.24.1730266635025; Tue, 29 Oct 2024 22:37:15 -0700 (PDT) Received: from barbar (mobile-access-d98cc9-211.dhcp.inet.fi. [217.140.201.211]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53bc0d5e1bdsm143379e87.226.2024.10.29.22.37.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2024 22:37:14 -0700 (PDT) From: =?utf-8?Q?Tor-bj=C3=B6rn_Claesson?= To: Ihor Radchenko Cc: Jonas Bernoulli , emacs-orgmode@gnu.org Subject: Re: Org-cite: Replace basic follow-processor with transient menu? In-Reply-To: <874j4ueo1x.fsf@localhost> (Ihor Radchenko's message of "Tue, 29 Oct 2024 18:55:54 +0000") References: <8734m28l9a.fsf@gmail.com> <874j6h3rw8.fsf@localhost> <877cbamq2q.fsf@gmail.com> <87cykvrgwr.fsf@localhost> <8734lpmkjn.fsf@gmail.com> <87r08lqlbu.fsf@localhost> <87a5ewfvo1.fsf@gmail.com> <87r085vb1s.fsf@bernoul.li> <87bjz9o188.fsf@localhost> <87r0839jfc.fsf@bernoul.li> <874j4ueo1x.fsf@localhost> Date: Wed, 30 Oct 2024 07:37:09 +0200 Message-ID: <87bjz2tam2.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::12e; envelope-from=tclaesson@gmail.com; helo=mail-lf1-x12e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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-Spam-Score: -4.50 X-Spam-Score: -4.50 X-Migadu-Queue-Id: 6347D3403B X-Migadu-Scanner: mx10.migadu.com X-TUID: J67xNlK77Gjj This is a great learning experience, thank you Ihor and Jonas for the friendly feedback! (defcustom org-cite-basic-follow-actions '[["Open" ("b" "bibliography entry" org-cite-basic-goto (list (transient-scope) = 0))]=20=20=20=20 ["Copy" ("d" "DOI" org-cite-basic-follow.copy-doi)] ["Browse" ("u" "url" org-cite-basic-follow.browse-url)]] "Hepp" :group 'org-cite :type 'sexp) The bibliography entry demonstrates using any function (a bit ugly since org-cite-basic-goto insists on the prefix argument). (transient-define-prefix org-cite-basic-follow (citation &optional prefix) [:class transient-columns :setup-children org-cite-basic-follow--setup :pad-keys t] (interactive) (if org-cite-basic-follow-ask (transient-setup 'org-cite-basic-follow nil nil :scope (list citation)) (org-cite-basic-goto citation prefix))) Here I removed activating the transient menu if a prefix argument is present. If org-cite-basic-follow-ask is nil (the default) and I want to call org-cite-basic-goto with a prefix argument, this would cause the transient menu to activate, which seems wrong. (defun org-cite-basic-follow--setup (_) (transient-parse-suffixes 'org-cite-basic-follow (cl-map 'vector (lambda (group) (cl-map 'vector (lambda (entry) (pcase entry ((and (pred stringp) label) label) (`(,key ,desc ,fn ,transform) (list key desc `(lambda () (interactive) (apply ',fn ,transform)))) (`(,key ,desc ,suffix) (list key desc suffix)))) group)) org-cite-basic-follow-actions))) Prefixes of :class transient-columns expect a vector of vectors of a string= and lists, so we need to use a map that produces vectors. This works. Do the code look OK to you? I'll prepare a patch if that is the case. Cheers, Tor-bj=C3=B6rn