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 ms1.migadu.com with LMTPS id +GDfAwNCR2YpogAAqHPOHw:P1 (envelope-from ) for ; Fri, 17 May 2024 13:39:47 +0200 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 +GDfAwNCR2YpogAAqHPOHw (envelope-from ) for ; Fri, 17 May 2024 13:39:47 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=cyJE86mz; 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=1715945986; 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:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=oIuWuYqFh1YQ0u4nsQffNdpj+sABRMw5K90Ofn36HwU=; b=QW5pKVu/KpJBa/DNha3P3SPtSXAnN227n42/+awRn1wk3aTNmSO3L9zgezepsDaLHDhkFT oeobO68xbvDEIsgjwyVXet46aL17GnZSKLGNqN4UqdWEz2NNKQGqiRhcyyU5z1sZih6Xmt vUxgVVw7f/xQgmblP/RDRdAWJ0FJpYATC5TC4pqBL1c0vEibngIhemhwBNXddjpPHvj6Ku fse4M9+5TgD0dPAx0Dbo9HkRL9CISOgTt0R9Fzl106JYMYMOS2yTTg2zOQ+EFI31DCmIP1 suI1sYOgLCaBk/+JC2cdVI5LpOdx2JoxtDPRjlVSuSvkqCwFV+wVjqxJZKUFmA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1715945986; a=rsa-sha256; cv=none; b=kkQeJSDec2jOVejB/ZYgFlrVQhr7MA+Zu/eWd0xIDyJhO9OIjfHjxcohD5nnKvU76x2faz ZuzPygmLw3s7qQQRAm6bZXodoL54hqH+vkz5X7XJHhp4dgAOaXoNgfaNQQIZ3YCufYuZ3e g5pXbKiHVAKDWGZuhEh/ozY2j0ET8XhMNzpuNJv5mUZORVpWuAs6830NAkR/1MLbQUvvKs 2Ire48hZPlIF/iGyh302f8UFz+/RfYZ5x8sbftZn5/m8/UR3H4rzplsltLiCUSvsPk/TBZ VftLh+9RZNxeLjaWeRVB8CL8BmulfxAumLR5MsU3YC+1nRt9+O1LIWmNOMN2Gw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=cyJE86mz; 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" 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 CA1BF60119 for ; Fri, 17 May 2024 13:39:46 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s7vvF-0002Nq-Pw; Fri, 17 May 2024 07:38:51 -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 1s7vvD-0002Nh-GB for emacs-orgmode@gnu.org; Fri, 17 May 2024 07:38:47 -0400 Received: from mail-oa1-x2a.google.com ([2001:4860:4864:20::2a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s7vv8-0004vx-2U for emacs-orgmode@gnu.org; Fri, 17 May 2024 07:38:46 -0400 Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-23db0b5dd28so744658fac.2 for ; Fri, 17 May 2024 04:38:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715945920; x=1716550720; darn=gnu.org; h=content-disposition:mime-version:message-id:date:user-agent:subject :to:from:from:to:cc:subject:date:message-id:reply-to; bh=oIuWuYqFh1YQ0u4nsQffNdpj+sABRMw5K90Ofn36HwU=; b=cyJE86mznqINyxjNZ6FiwhBtL8/shPgFAp9plu3Eloqx33vJiIn4ChzzZI4sxvSQqE SLi4Kx2/rX1FZKAJXFnSuniT+IOp6hVVfsp0J9hAhOD7zm1ZQx7lcpO/fwn9hvtVNidx +ioaXYRUO+YOViBAxOXxpukCogRx3rK0jeR26yOH2sr4ffivkBssaLZbGLa6dooY652A KKXPpnnGOB9lRMaFsiianbRWWXJ4byEfrcT613ALiKLitMz0eWWZEsiMcGVlAMce0PJ1 Nke7SBwTmswEIgGTLPE9MIE3Azg/CHSGoTv8ncELRCbhA7RPF0BFfexozF+1IFctD50j 7ZSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715945920; x=1716550720; h=content-disposition:mime-version:message-id:date:user-agent:subject :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=oIuWuYqFh1YQ0u4nsQffNdpj+sABRMw5K90Ofn36HwU=; b=WJ8ocJ/5rrQFxIXjNDJeFTgdkrHTeTKg6JWErQ6zlmTVrKa+mwZFujtVjU4OuUF5KR KP6z/rrZVB9z+8lSB7cot4LLBkohIlo+wDv1ajp3I8S9a28iqV4WhbIwSVNHbfjtVd4o 6KmjFtN4fqTL9EMSTFFkfAN1CZ267R7azrjq76SHDYSTQFEoktXHzRSwbDrfPrP0d9Xh pbZHNuJXaxiZAwhYMJrWdVV8d02ut8oKzm6HNfh9hKNfrSaWZ8GzCZOB/5QzOyvub/xu keZuZxgiweboWHZm522vYAi0ies5Asnf23AzDVeWy0hX1OunPc1yUjp4sXLSUlS3P/5R TDJA== X-Gm-Message-State: AOJu0YxeTjtu8h0V5vfi1CFwqYB+3lbt/8jXRkRiQEy3+b7WZ0X/8Joo 4jy32mhhi4R+NglWqFOq+IKg30OLa77r/D58tW1E+NNrtqLokc+vhdT7+w== X-Google-Smtp-Source: AGHT+IFN0k68kc/w4Zf12n54knWzOKz8R6IGiuyJOLIh8Mfd+qs4UMlzIoha/ssjt4sooXAebzyr9w== X-Received: by 2002:a05:6870:d627:b0:23a:fb36:ffb3 with SMTP id 586e51a60fabf-24172a77f76mr25372446fac.19.1715945919954; Fri, 17 May 2024 04:38:39 -0700 (PDT) Received: from Proteus ([118.211.125.184]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f695362d8asm716356b3a.148.2024.05.17.04.38.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 04:38:39 -0700 (PDT) From: Anand Deopurkar To: emacs-orgmode Subject: [PATCH] lisp/org-capture.el: Restore org-store-link-plist User-Agent: mu4e 1.12.0; emacs 29.2 Date: Fri, 17 May 2024 21:38:32 +1000 Message-ID: <87jzjsllc7.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-lisp-org-capture.el-Restore-org-store-link-plist.patch Received-SPF: pass client-ip=2001:4860:4864:20::2a; envelope-from=anandrdeopurkar@gmail.com; helo=mail-oa1-x2a.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-Spam-Score: -6.69 X-Spam-Score: -6.69 X-Migadu-Queue-Id: CA1BF60119 X-Migadu-Scanner: mx11.migadu.com X-TUID: sJ2pPTBcpwi9 >From 8f603b721ddd7edf1e622a39dc80f4b74a5b5198 Mon Sep 17 00:00:00 2001 From: Anand Deopurkar Date: Fri, 17 May 2024 20:39:51 +1000 Subject: [PATCH] lisp/org-capture.el: Restore org-store-link-plist * org-capture.el (org-capture-fill-template): Restore original `org-store-link-plist' after calling `org-store-link'. To replace a %K escape (link to currently clocked task), `org-capture-fill-template' calls `org-store-link'. This call has the side-effect of replacing the contents of `org-store-link-plist'. As a result, expected template expansions using the original `org-store-link-plist' do not happen. For example, suppose `org-capture' is called from a message buffer with the template "%:subject %:from" while the clock is running. Then %:subject and %:from are not substituted because of the behaviour above. If the clock is not running, there is no problem. Current fix restores `org-store-link-plist' to its original value after `org-capture-fill-template' calls `org-store-link'. TINYCHANGE --- lisp/org-capture.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lisp/org-capture.el b/lisp/org-capture.el index da14f45c0..9d8f855ef 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -1675,9 +1675,12 @@ Expansion occurs in a temporary Org mode buffer." (org-no-properties org-clock-heading) "")) (v-K (if (marker-buffer org-clock-marker) - (org-with-point-at org-clock-marker - (org-store-link nil nil)) - "")) + (let ((original-link-plist org-store-link-plist) + (clocked-task-link (org-with-point-at org-clock-marker + (org-store-link nil nil)))) + (setq org-store-link-plist original-link-plist) + clocked-task-link) + "")) (v-f (or (org-capture-get :original-file-nondirectory) "")) (v-F (or (org-capture-get :original-file) "")) (org-capture--clipboards -- 2.44.0