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 mCUAC2t7Jmd0CAEAqHPOHw:P1 (envelope-from ) for ; Sat, 02 Nov 2024 19:20:11 +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 mCUAC2t7Jmd0CAEAqHPOHw (envelope-from ) for ; Sat, 02 Nov 2024 20:20:11 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=qIKUgzRF; 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=1730575211; 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=JS9t7k1ASHV7Utj972yO1KsTud8Vs1V/j9L9UT8osCk=; b=GqNL08Ar2wZJ3fGVBXrZt70bmaHgtwD6SV07GG42uqHd7O9LdwyyYUBKUMoadMha7IPOkv HyxgCRB1gmWGDpmeGesJBxYRUxLWC+GxbXAAxY6ZqhETOiwfy/CJwv02Wju6aVzw0fK2dc SIVvk4V9ZbosoOtZMVINo5XkbughRSr86ySUkMcx2uBYkTHmqC7qbgt0wXH6UCaZvgN/dx IhKMwFDPiM1siX0mmtZECs/ih9NkOZa8aJe4o30Zbo/8E6mlXNUJzD8ELOAgSRaDVo6X9Y +ZMEUuhw8FEuMTkAv2FVu4Zhz8wKz1w/9E9s+vTrouH6dDNUmuWxUK2y12vZrg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=qIKUgzRF; 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=1730575211; a=rsa-sha256; cv=none; b=C4/Kmgd8K/xDvShHs5qTravWXOkvdWB885DbYAZEQXw8ojCljq44T8PdZabnRl43HA9eKc RAzfFOgdWgzHusYm6CZVyvZNlQA6WhW0s7wFs6j6Y+anwuIZHJLzzjZaFpzi/GgUkgonYv yb2z7YllR16NmbBudxixC/npcKehcAfwUCEVnqPEH44V4FmC5qNLMnj+MS3h39MPrnw151 mvwxRcOlE8pi7NbOuEWJC9MtlFg6JBONxs4gIzEE3U1c4NBkStyhQxMD/mfpC+F1d48pdU ah+q/boK06QhqzlVdv8iRD1k5lcExv30ddKK/ENU4gg3qjhr3P6vPgVdZv08LA== 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 C1CCA407F1 for ; Sat, 02 Nov 2024 20:20:10 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7Jek-0005g4-2a; Sat, 02 Nov 2024 15:19:30 -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 1t7Jei-0005fg-16 for emacs-orgmode@gnu.org; Sat, 02 Nov 2024 15:19:28 -0400 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 1t7Jef-0003ZQ-Ok for emacs-orgmode@gnu.org; Sat, 02 Nov 2024 15:19:27 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 0722C240028 for ; Sat, 2 Nov 2024 20:19:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1730575162; bh=bSzaRyLvKizEPxK65vyfmzJ81kw8qIw4e7p6a9mqqcA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:From; b=qIKUgzRFzyPjnmN3vLqi+F91SoSlFhqYEJnkNE0ogGni4PSM9kfrKXjYeN/4GW/mO g+2ddyB1+OkeDeyfExwQ3sBuWseKvoeIf35PrkWxFsvXX+QSRccc8oxkZmg1k1GfkC UIgNVwPPsMpVEvNaIItrIuUqazhvWB8laWESveI3R1bFL/6tUIjBKVGI0nXHbhV55X U7ZlFnPVDYOTLNJjaK4jYqSuBVAW0DgyGiq3C4fjifreDHlgZdEeIrud0CK9Y1jC/n /EgJKQOn23Y4DKYYnFdsdBOrTSaCyevjQ5hR/Uz+U9VoiSPpWVHUgO/9GIlB2d+vBY pyURxd/aH+Jdg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4XgnbW6Tr5z9rxB; Sat, 2 Nov 2024 20:19:19 +0100 (CET) From: Ihor Radchenko To: =?utf-8?Q?Tor-bj=C3=B6rn?= Claesson Cc: Jonas Bernoulli , emacs-orgmode@gnu.org Subject: Re: Org-cite: Replace basic follow-processor with transient menu? In-Reply-To: <87wmhlmp83.fsf@gmail.com> 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> <87bjz2tam2.fsf@gmail.com> <87msil77oi.fsf@localhost> <87ed3wnlv4.fsf@gmail.com> <874j4sccuv.fsf@localhost> <87jzdo2e4m.fsf@gmail.com> <87a5eievav.fsf@localhost> <87wmhlmp83.fsf@gmail.com> Date: Sat, 02 Nov 2024 19:21:02 +0000 Message-ID: <871pzte929.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_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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx11.migadu.com X-Migadu-Spam-Score: -0.01 X-Spam-Score: -0.01 X-Migadu-Queue-Id: C1CCA407F1 X-TUID: pxDnnsgnWG9v Tor-bj=C3=B6rn Claesson writes: > Clever! I had to put the let inside the lambda for it to work. You probably do not have to once you use lexical binding (that is - not C-x C-e ad-hoc, but put things into actual byte-compiled file) But let inside the lambda body is perfectly fine. > (defun org-cite-basic-follow--parse-suffix-specification (specification) > (pcase specification > (`(,key ,desc (lambda . ,fn-args) . ,other) > (list key desc `(lambda ,@fn-args) ,other)) > (`(,key ,desc (,fn . ,fn-args) . ,other) > `(,key ,desc > (lambda () > (interactive) > (let ((!citation (car (transient-scope))) > (!prefix (cadr (transient-scope))) > (!citation-key (org-element-property :key (car (trans= ient-scope))))) > (,fn ,@fn-args))) > ,other)) > (other other))) > > Does it make sense to keep matching the lambda separately? This just > keeps getting better=3D) AFIU, you need to match against lambda simply to avoid the next clause matching it. If so, you can change the clause to match all ,fn, except lambda like the following: `(,key ,desc (,(and fn (guard (not (eq fn 'lambda)))) . ,fn-args) . ,other) This is getting ugly though. An alternative would be simply (defun org-cite-basic-follow--parse-suffix-specification (specification) (pcase specification ((and val `(,key ,desc (,fn . ,fn-args) . ,other)) (if (eq fn 'lambda) val `(,key ,desc (lambda () (interactive) (let ((!citation (car (transient-scope))) (!prefix (cadr (transient-scope))) (!citation-key (org-element-property :key (car (trans= ient-scope))))) (,fn ,@fn-args))) ,@other))) (other other))) --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at