From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:5f26::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id OAfdHwLjd2XsAQEAkFu2QA (envelope-from ) for ; Tue, 12 Dec 2023 05:35:14 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id 2M0VHALjd2UHNgEAqHPOHw (envelope-from ) for ; Tue, 12 Dec 2023 05:35:14 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=devnulllabs-io.20230601.gappssmtp.com header.s=20230601 header.b=O9sYc1Zs; 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=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1702355714; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: 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=I93iV/Q5bqZ/6h60W+4jVJaeOPykArijubtktGjTBXQ=; b=W3e4tdcg6sCLDeJ1LUIfjis/HIPBmKyo/3S678phnA7G2bzEpln1WBiyXTmPjt20Acb5Oc LY9e01koa/dJ8ilhZCkh27IboCrHDb1HGxGC/xcgAK4FuvK9jFK+VKr6qb5poCZvpVbu3l jaZxQzRVKm4IsuKe5bSV7CHPtqrIT2+62HNoK6X78+5ty/EDFdQRtlGM0xOB2yfMt5skVG U7zs0kR8s/ac0SDeWKHPu0gdzRaohBFmQ7W03QmTOZ48iQjcIMVY3pvdmRcUG/eTO+Asge RfzVdjKw0y9gERqvOoID9tZqONfX5IhKeo0SHH+WDTVH0wxT/NM493Y0TKsp5Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1702355714; a=rsa-sha256; cv=none; b=G4XT1qQ6U7oZEeg+S0OTDnDn1mecOl3OiSRKnIz8wlh6uMFXkC3HNyXGqZb5RNqkkNGRdj E8W7eM8wlT0kcggi0NmqowLBAJqdtO44wZH9+Czw/b+8qSfGqiH7sJ4pGt4qrlk6Y/fi4m +kFqOXRDSMQkXGxp6zjI/iKefadRMuQPAG0DInDiWlyjF7TGy2nqaFVnDbDLRoDm41j+8C bNcW5PEJWV0M6QmwjXim139NC5pJK8QkyNI52WulP+Y1cniFjkTbGtnQEQfgoJdWIl05Ll u822fcKHSdPv3paVLo16wHDK0b0SbfmWWtfSjNRfKWxXOA67xa3dPykHugTLrQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=devnulllabs-io.20230601.gappssmtp.com header.s=20230601 header.b=O9sYc1Zs; 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=none 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 0552024F16 for ; Tue, 12 Dec 2023 05:35:12 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rCuTU-0001zk-BX; Mon, 11 Dec 2023 23:34:28 -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 1rCuTS-0001zX-Do for emacs-orgmode@gnu.org; Mon, 11 Dec 2023 23:34:26 -0500 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rCuTQ-0005zm-U3 for emacs-orgmode@gnu.org; Mon, 11 Dec 2023 23:34:26 -0500 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-6ce72730548so4511747b3a.1 for ; Mon, 11 Dec 2023 20:34:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=devnulllabs-io.20230601.gappssmtp.com; s=20230601; t=1702355663; x=1702960463; darn=gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=I93iV/Q5bqZ/6h60W+4jVJaeOPykArijubtktGjTBXQ=; b=O9sYc1ZsTGLy/LcUxvxpKK3ee5o7X+KC4+wJfw6zytlyvk+2BLmRcGDlXW7cMK4Agb IB8v5SpSFH7AemOTSWLeoKNTmFXN02d78KVjNAnIq3rVCKdu3UQxP/TeWx5WXcxbi64/ Ybb/uiE3uUmjPIEew2mzDJkCdQt92/A3k1U3cuwc2JMHvKYYts0r4vZKaZ7L8ljYwnQh 9/JVPFrvwXc5NHc65IrLUf2T8I045waGzUMR6EDqQbZhc3xh0lOc9usJaFy/08Kdbj9Z ha5njRGcWYdk2e3bhN4QxmkwKVVr5wcVpEU73DwgSeCfWMsQR2ZYJjMp/mBn68uFIYpe BWpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702355663; x=1702960463; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=I93iV/Q5bqZ/6h60W+4jVJaeOPykArijubtktGjTBXQ=; b=VXMMxDvkANnRrmBNM4VFOhUUzbvxZm0U/qLQwAxxqYuExjIhM4aJ5QxKEFbUEjNDIl 6gDcBRCOuUoUgEt2JGnLga5Oy2zSd79WVNOk7UXWe6goo4LP1SZwXbnNRmfqkB7UnORe VdsxuK1U3/NnieB2YXe5FdXyvQx6D0fe6dIOWE7xqNV9sq921112lChAcTq7oaPi/EE8 1T6jAJopS5pNZoVcuzZaC2sfCGkrDWbHjvfJrFez1GDOkg5p2lnjdzx3qcxLtewjubnE PXziXi2y+mze0VxpfChEoRilvblsR54RlkaG2gg6KJZOfMQ+zcLISF3l8Hq61j/f+q3K LkbA== X-Gm-Message-State: AOJu0YzBFKyN6QVDm2ZBVp+nAn44WhrNzJPE+udOKUAgQivxCaRtfSrN 8BxGzsFDzLrTsJj7ise5z/2H/Q== X-Google-Smtp-Source: AGHT+IGfyLf7kQo5oY0IJ3JS6mdhJyMmLNQFnvTZrNI0ZygeixwB8W0KbN+j4ZY/ACCRIhxhiWatKA== X-Received: by 2002:aa7:88cf:0:b0:6ce:7a8f:af7c with SMTP id k15-20020aa788cf000000b006ce7a8faf7cmr6365962pff.12.1702355663465; Mon, 11 Dec 2023 20:34:23 -0800 (PST) Received: from localhost (67-60-133-188.cpe.sparklight.net. [67.60.133.188]) by smtp.gmail.com with ESMTPSA id n24-20020aa78a58000000b006ce4965fdbdsm7146749pfa.116.2023.12.11.20.34.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 20:34:23 -0800 (PST) From: Kenny Ballou To: yantar92@posteo.net Cc: emacs-orgmode@gnu.org, yantar92@gmail.com, Kenny Ballou , Nathaniel W Griswold Subject: [PATCH] lisp/org-capture.el: use `org-store-link' for %K values Date: Mon, 11 Dec 2023 21:32:18 -0700 Message-ID: <20231212043401.27847-2-kb@devnulllabs.io> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231212043401.27847-1-kb@devnulllabs.io> References: <20231212041305.26537-1-kb@devnulllabs.io> <20231212043401.27847-1-kb@devnulllabs.io> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=kb@devnulllabs.io; helo=mail-pf1-x42e.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: -7.32 X-Spam-Score: -7.32 X-Migadu-Queue-Id: 0552024F16 X-Migadu-Scanner: mx12.migadu.com X-TUID: gl2UQBUTbz4G * org-capture.el (org-capture-fill-template): fill %K values using link value from `org-store-link', which respects `org-id-link-to-use-id'. * doc/ORG-NEWS: (Template variable expansion %K) Document new behavior. Reported-by: Nathaniel W Griswold Signed-off-by: Kenny Ballou Link: https://list.orgmode.org/EF459D47-FCA4-4A18-AFC7-3E62159F186C@manicmind.earth/ TINYCHANGE --- etc/ORG-NEWS | 5 +++++ lisp/org-capture.el | 7 ++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 9328f333c..9858df045 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -539,6 +539,11 @@ Currently implemented options are: tasks this technically violates the iCalendar spec, but some iCalendar programs support this usage. +*** Capture template expansion now supports ID links + +The capture template expansion element =%K= creates links using +~org-store-link~, which respects the values of ~org-id-link-to-use-id~. + ** New features *** =ob-plantuml.el=: Support tikz file format output diff --git a/lisp/org-capture.el b/lisp/org-capture.el index e482f667f..4bbe2c43a 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -1675,11 +1675,8 @@ Expansion occurs in a temporary Org mode buffer." (org-no-properties org-clock-heading) "")) (v-K (if (marker-buffer org-clock-marker) - (org-link-make-string - (format "%s::*%s" - (buffer-file-name (marker-buffer org-clock-marker)) - v-k) - v-k) + (org-with-point-at org-clock-marker + (org-store-link nil nil)) "")) (v-f (or (org-capture-get :original-file-nondirectory) "")) (v-F (or (org-capture-get :original-file) "")) base-commit: 420ed4e0338d12e26c62d3666ca39e7cff323d05 -- 2.41.0