From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.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 SB/WK6KD5WZnSwAA62LTzQ:P1 (envelope-from ) for ; Sat, 14 Sep 2024 12:37:54 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id SB/WK6KD5WZnSwAA62LTzQ (envelope-from ) for ; Sat, 14 Sep 2024 14:37:54 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=lDoUsMhG; 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=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1726317474; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=JCsj4D3AhuAZFdcxfWrIl927Ax/yc04HU8iNsC5p+VU=; b=cgbLWRnF2pVA2brVL+qnaXWw1YbEbMwzTwiMDaYshRB4xQOkQ9Ak+n1aoJQmUOOVZmNaNn pRA4YpROImkKrhdxryAaHaQ12cDLC1ujjWKeC4rCmEdXE8d/vLDy5agwzzRkNmonr0Px3R sasEokqu5/thIQHE40zQmLHY/nckwa54u0DxYJQ7IAogRVoLMLsSZFr+Z9OSohk8dNUEbM W7MrDceR3VolKCQXjWUCkee+z7yaTHPMHPt9B7awTp/5V6WrioJ1WkVmDqqdy6DBG1usQp /ZDG6e9JM2MuCq4MVAWProkEcaiAypPXIjOgWnTXIzOofvxMpcHVmHrEX+AwAg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1726317474; a=rsa-sha256; cv=none; b=hInT22DQBOKd3tz0K2MrzERlC1LJXxvKs5JUlpFu0B9ZCqDzjqDXeXh3q+7WnNZa6iAlgQ mgoroFiKGyx5Wjaevh0D+uLWSlBKQ61ePQ8TvMKKztR7W7/ZNoTiZ22aaq1evifdEmmSPk tLzQHEXoHbc+0ag51qio0tTnHg8MKxlSy0sg1Riwr69dpbZUxWd3no/sn+6Ln7mFM3RpEK mKy0RW2bdiJVNFc5Kp8Q2gqHK8j/66QQDCMZoFHRptE7gZHogfZtXA+olkDfGKl/QSUg3P OlOEkpz/5j5h5JNdTBgV3iCObIgB0BF4YTwM3yaHBwzOJy+YjfjOfzblNtbDAg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=lDoUsMhG; 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=gmail.com 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 73EA21B561 for ; Sat, 14 Sep 2024 14:37:54 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1spS1R-0006ci-UW; Sat, 14 Sep 2024 08:37:05 -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 1spS1P-0006cR-On for emacs-orgmode@gnu.org; Sat, 14 Sep 2024 08:37:03 -0400 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1spS1O-00056B-0B for emacs-orgmode@gnu.org; Sat, 14 Sep 2024 08:37:03 -0400 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-53654dbde59so3857230e87.1 for ; Sat, 14 Sep 2024 05:37:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726317419; x=1726922219; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=JCsj4D3AhuAZFdcxfWrIl927Ax/yc04HU8iNsC5p+VU=; b=lDoUsMhGAGm2ZpB08bsBKgAihA/hQaKN5+A0wv5ECl+HUI6jll/wm0ECpFIaazHlGc CzZsd7PzUtRJ4+PgeDA5Pj9ZvlSYiCIxLY1Rja9nOzJxzlSez2/8TJpr3ynKqSq4O7Ub S7eJQrohkiRd5XmU1xqlxvR1hIRaW03oHOjdIzX61jY/JIRyfkcSgAa1ca9AwQwLv3vc i/kA77uRWyA9UEC4N+O8hp067mPaJ1yl7cK0B7v6IJ/sARphWEJobevEy20/nE//Q5ib t6SqMfweA+NsHW7RiK1k9iuSFXcay3zzoA/K6DkM0umiA00FF2YV3QlzRBl9EW44LPK9 298Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726317419; x=1726922219; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JCsj4D3AhuAZFdcxfWrIl927Ax/yc04HU8iNsC5p+VU=; b=ENwBxZPWObbj0cXyBG0ECSmvEh3+5FLfq2RB9xkvggFmCg/Y09VmzLJUc0asKg1+j2 GSMomCJfv2xdEvQnDGsms3gpmf4gjNyxlUkw3HU6bhAMwjp/g/gwMZ3neTkkIURFsDZs c+P/PUwl82OPnZNpVS952FW6UDGsfW1K30qpwGUwHFzpgACU73hF/PsmEjww3bhDJl81 aewEVwOQ6RHL2HiAK8eJ/uYAd69SYtVhAdEuTdN77PNqYzfDjLgIBK6KBaUWmlYcf3NH WfdNPNgHSuoNF9aGPUoOeD4c1Mj6S1FnP1lMW+f9eJReD12KMVU7BE7eANMLDf5RSvdD 57eg== X-Gm-Message-State: AOJu0YxLNgAXGe/m/G9mNtEia660lDBc72k02Ka1AJmfmsQP7gqoOMCB pEcfF7PQ30rEp/UbnwZBV7HDiQdGs2V93mrrcxN3X5mumfvqJZcHSMi6VX8o X-Google-Smtp-Source: AGHT+IE67LLETdM1/XHYXIoZZ7Sv5w9ZKqE67No0lvqlZy+Iz+EJszkFW/xnWDKfLzA2Py2AkJ9y6g== X-Received: by 2002:a05:6512:10cb:b0:533:447b:94f0 with SMTP id 2adb3069b0e04-53679075f10mr2896679e87.10.1726317417701; Sat, 14 Sep 2024 05:36:57 -0700 (PDT) Received: from barbar (mobile-access-5672fb-252.dhcp.inet.fi. [86.114.251.252]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-536870a8917sm235092e87.237.2024.09.14.05.36.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Sep 2024 05:36:57 -0700 (PDT) From: =?utf-8?Q?Tor-bj=C3=B6rn_Claesson?= To: emacs-orgmode@gnu.org Subject: Org-cite: Replace basic follow-processor with transient menu? Date: Sat, 14 Sep 2024 15:36:49 +0300 Message-ID: <8734m28l9a.fsf@gmail.com> 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::12c; envelope-from=tclaesson@gmail.com; helo=mail-lf1-x12c.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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -8.82 X-Migadu-Queue-Id: 73EA21B561 X-Spam-Score: -8.82 X-TUID: tXkrCPOhQ67g Hello! I recently switched from org-ref to org-cite, and would like to thank eveyone who has worked on citation handling in org-mode! Your work is of incredible value to my research productivity! Since I use org-roam-ref, I initially went with citar and installed vertico, marginalia and embark, but this felt a bit invasive, so I went back to the built in basic processors, which fill all my needs except for the follow-processor. To improve following, I made a transient which offers options other than opening the bibliography entry. This works really well, and can easily be extended by adding new suffixes. In order to make the basic follow processor more useful, would you be interested in replacing it with a transient menu? As an example, I attach my transient, including examples on extensions. It would obviously need some work on wording and thought as to what commands should be made available by default. Also I am not used to elisp, and the code can probably be improved! I hope that this example demonstrates how more useful and extensible the basic citation follower would be in form of a transient menu, and would be happy to work this into something fit for inclusion in org-mode, in case you would be interested. Best regards, Tor-bj=C3=B6rn Claesson (transient-define-prefix tbc/follow-reference (datum &optional _) "How should we follow references?" [["Open" ("b" "bibliography entry" (lambda () (interactive) (org-cite-basic-goto (car (oref (transient-prefix-object) scope)) (cadr (oref (transient-prefix-object) scope)))))] ["Copy" ("c" "citation key" (lambda () (interactive) (kill-new (org-element-property :key (car (oref (transient-prefix-object) sco= pe))))))]] (interactive) (transient-setup 'tbc/follow-reference nil nil :scope (list=20 datum _))) (org-cite-register-processor 'tbc :follow #'tbc/follow-reference) (setq org-cite-follow-processor 'tbc) (transient-append-suffix 'tbc/follow-reference "b" '("p" "pdf" (lambda () (interactive) (find-file-other-window (concat tbc/projektet ; path to my research files "Referensartiklar/" (org-element-property :key (car (oref (transient-prefix-object) sco= pe))) ".pdf"))))) (transient-append-suffix 'tbc/follow-reference "p" '("n" "note" (lambda () (interactive) (orb-edit-note (org-element-property :key (car (oref (transient-prefix-object) scope))))))) ;; Adapted from org-ref (transient-append-suffix 'tbc/follow-reference "c" '("d" "DOI" (lambda () (interactive) (kill-new=20 (save-excursion=20 (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 (car (oref (tra= nsient-prefix-object) scope)))) (setq doi (bibtex-autokey-get-field "doi")) (replace-regexp-in-string "^http://dx.doi.org/" "" doi)))))))