From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id AL3FDocvIWeiBQEAqHPOHw:P1 (envelope-from ) for ; Tue, 29 Oct 2024 18:55:03 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id AL3FDocvIWeiBQEAqHPOHw (envelope-from ) for ; Tue, 29 Oct 2024 19:55:03 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=AKPNcRiZ; 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=1730228103; 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=jxqyqXdvHeShdqV8joU+R9L8N/07FI4Rw9iYiqdoEZE=; b=uLxWcjJs1+cGYKIXSIz8FvY1RGCN4p2iUqeAlLQcLJ/WuPR2KitVtiJWnBdabwqEqt8fJa bftflJFQMRr6uJineWHAoHHQKpc5uxnvCAZxavuMRv2zdUrvLf6s18VWhB201gMs2XPclf PDh26bOWK2zw5t+OH85fS/IZcgF1KImq7bKwZi/haU/XBvA2FxtqR3epopQWNCFiKsVaWx 6Q+ajAftM/xxSwIZjFV1FDQjEbWVIo4oL+zzkvQYJcggGk6NhfIMTYLcUYk5EyTLYj/7u8 KM/8Du/tQMxfKTz0arZ3Nt4kBAUFAznlrVDNXVNmS6cu6+Dzcwq8vcTkGV/GoA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1730228103; a=rsa-sha256; cv=none; b=RCgz8RtORjRv6kkKBiRhwF+5XtX6YVc1RNdxn1HxIcIpnK/cPIN2BoCJVJ3RBAjI+b6VQf fuq+hHB+v/Wf1T6C5UIyqpB7qIVFgMvoIjdTWcuYorVZtgmDH+D6Y7NWQUluJf8KnaXY/h XtG+w5XH6wiMdh+UkSyZfdfkjBkMwq2Vk3SSf8tNZ+hq+ZkgBw4RCf4/IeTDMLSmTMh8hp pg59gHSrkMWehg/XSLQhsN3pgZYTlf/RIWyTVXX9UP3ezZAjS1HQ+NClOG07bhlDcbXv/t hcBX5gsxUJXo3kxDcR7mOZV0npnSivooxJ1C3R6zt1MTZ1IHUARhUIpers/yuQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=AKPNcRiZ; 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 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 D37DF7B08B for ; Tue, 29 Oct 2024 19:55:02 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t5rMB-0007GX-DK; Tue, 29 Oct 2024 14:54:19 -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 1t5rM8-0007G2-5y for emacs-orgmode@gnu.org; Tue, 29 Oct 2024 14:54:16 -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 1t5rM5-0000mC-Q2 for emacs-orgmode@gnu.org; Tue, 29 Oct 2024 14:54:15 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 2D532240027 for ; Tue, 29 Oct 2024 19:54:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1730228051; bh=9W1kgxT0yLclLSD3t3MVOZ4pX7cpA9nhBdhC/R2lcT4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:From; b=AKPNcRiZEpZEfVhqhxp258LRBQitHlIXVjBKgqYYNmo74HkNloP7IpBwddonauEWD RChQlfSWj+V7NeqZWFWfJDgO3x8i46wPkfGeYWOghylxOL9izk2DNH84hSSzcZFD7i C/VvZudnPRio3kuxop+eO0DT9H7KEiooFXsiaMN0DwKt6yRpWaKsLUSHb+fM3DZ6jw KQFRf0XWGgHJ9UmvhFiEiAdCvbQ2STrjyPt87pX6MJ5yM+X/bLKI5nM5D+XCz9nzMx tV8e6egf/kfv6ZhgrI2QNetbuWJ1r3RBKqK/DRXzJM5of6FTFWITvgm67PLxNXSo+Z wKUU0BSrIfQVQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4XdKDL2xGDz6v0m; Tue, 29 Oct 2024 19:54:10 +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: 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> Date: Tue, 29 Oct 2024 18:55:54 +0000 Message-ID: <874j4ueo1x.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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -3.29 X-Spam-Score: -3.29 X-Migadu-Queue-Id: D37DF7B08B X-Migadu-Scanner: mx13.migadu.com X-TUID: at5mOe/GGN7h Tor-bj=C3=B6rn Claesson writes: > ... >> (mapcar (pcase-lambda (`(,key ,desc ,fn ,transform)) >> (list ,key ,desc >> (lambda () >> (interactive) >> (apply fn (eval transform))))) >> org-cite-basic-follow-actions))) > > ... > I will keep trying, but I must find the spare time to learn more about > mapping and pattern matching in elisp, so this might take a while. In > case Ihor wants to just fix it, please go ahead :-) Check "11.4.4 Destructuring with =E2=80=98pcase=E2=80=99 Patterns" section = of Elisp manual. It has examples explaining how backquote pattern works. > It would be good if we could match against the case of '(key desc > suffix) as well, so that we could include otherwhere defined suffixes. To not complicate things, I suggest something simple along the lines of (lambda (&rest suffix-spec) (pcase suffix-spec (`(,key ,desc ,fn ,transform) ...) (`(,key ,desc ,suffix) ...))) Remember that you can always play around with things in scratch buffer, in IELM, or even just using C-x C-e from anywhere: (pcase '(1 2 3 4) (`(,key ,desc ,fn ,transform) (format "key: %s; desc: %s; fn:%s; transform: %s" key desc fn transform)) (`(,key ,desc ,suffix) (format "key: %s; desc: %s; suffix:%s" key desc suffix))) ;; =3D> "key: 1; desc: 2; fn:3; transform: 4" (pcase '(1 2 3) (`(,key ,desc ,fn ,transform) (format "key: %s; desc: %s; fn:%s; transform: %s" key desc fn transform)) (`(,key ,desc ,suffix) (format "key: %s; desc: %s; suffix:%s" key desc suffix))) ;; =3D> "key: 1; desc: 2; suffix:3" --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at