From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id CCArFjhdXmTdCAAASxT56A (envelope-from ) for ; Fri, 12 May 2023 17:37:28 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id UMrjFThdXmTKBQAAauVa8A (envelope-from ) for ; Fri, 12 May 2023 17:37:28 +0200 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 251F42F051 for ; Fri, 12 May 2023 17:37:24 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pxUoK-0005oL-Ld; Fri, 12 May 2023 11:36:00 -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 1pxUo8-0005lo-Lp for emacs-orgmode@gnu.org; Fri, 12 May 2023 11:35:48 -0400 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pxUo6-0006Rj-Vm for emacs-orgmode@gnu.org; Fri, 12 May 2023 11:35:48 -0400 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-4f146de360aso2181875e87.0 for ; Fri, 12 May 2023 08:35:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683905744; x=1686497744; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=bzscBX1IENyUD0fcrVYh39I5qmxqnYV2lyKvxppR10M=; b=D75JFgKVTVAEMgrnjZdJm9rjFYdCd8KZb/ajlPvamAmhIQgBZRA8XiFxXfqd6Q86K8 QudJflzkN2a1wVFlQND49lQ10ZzZDTvm9tWD9+KkNH8aih6aRqr3EtCKDzf5jYMyDNjb bo4h1p9BMWyJmA7kT2BD0kMnm/5S73A6PU9a0uW3BT1SjwShsb4yG6mE3iW+pS9qRWb+ T7k+r0Xqn8e6Jx8JDcgV/Oiu5OdYT5z0pWe1UPSw6SmjPo0lwVQNdlYS62nQDtaAPB6Y U2knbFP47WoWn6ZJJ3uVpPMIxVW5pv2Cdznkl3ECJ9aisWkpc5shN/fLj/Qpj8vQFCIh 3qkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683905744; x=1686497744; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=bzscBX1IENyUD0fcrVYh39I5qmxqnYV2lyKvxppR10M=; b=PSqse/q9ZAH3itxlZSxW+Z6WnYFY5jzg7Bb6F3wD2HS8rVHBNDWaut/CMAbU5qmxnP QXoR1ag97ha9zhZEO7t+jUax1iECFUR5SdmstISbyD8NAykDajNR/A/GwTD4rr+BHeV7 WDVHSDeF4L8aTlH4qCIm6olA+j51+T9rF47JtplnwD+oIjVHoVgLfC7WfZJAPm4XU7wn UofIfjWkt96dYHreN716joKf5JR/jtAB+oEx52MLND/GCoZVQi8csPByWlAfgxguRVfR XwVFObLrznbfvKSyR9fuAUJPvU7q+WaDu5Q7eSLdXDXenH1ssdEcgve3U9RwEDjHvEvp glxQ== X-Gm-Message-State: AC+VfDyyQCcClxpfez33GDS9O5JrSAM9NgUsMtiIRBee6wBJN2cRL5ML UB8p8p69lD2rOExdddGqO0Fzj1CXnLGDFP1kuOoHK12L3ZJlpA== X-Google-Smtp-Source: ACHHUZ7A7kEQaSxMjNk1NE/EOC4LYqs7VBPMq0nvXPrlMBZjkLv+r3Bk1mOVOrZQsDwJe8UIpLczVXmKlyd7+L6UNCE= X-Received: by 2002:ac2:54a5:0:b0:4f1:4f26:739b with SMTP id w5-20020ac254a5000000b004f14f26739bmr6044966lfk.5.1683905744323; Fri, 12 May 2023 08:35:44 -0700 (PDT) MIME-Version: 1.0 From: Tim Visher Date: Fri, 12 May 2023 11:35:07 -0400 Message-ID: Subject: [PATCH] org-capture.el: Allow `(here)' as a template target To: Emacs Org Mode mailing list Content-Type: multipart/mixed; boundary="000000000000ba0edc05fb80db7a" Received-SPF: pass client-ip=2a00:1450:4864:20::133; envelope-from=tim.visher@gmail.com; helo=mail-lf1-x133.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, HTML_MESSAGE=0.001, 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 ARC-Seal: i=1; s=key1; d=yhetil.org; t=1683905844; a=rsa-sha256; cv=none; b=mhI+BwtvgLiCQ2RQjSWP5lOP6YsxGGzJfFjQ1gnbIKl/EFfF7wKfDpJEDFx6J/fk/4QTbz R7DFCx2LQfjKPAxX+zZ8DXkI23rYsk6a0pOUS9iQjsXkoPPMhp0ZlGCLQGwAmRUq1oKIBK dQGlZthNGTe/i7JJANIL4Z9jTx4sRG9/vCzWMOPHq78OTqO3U4tIFfwULjFQ7chBc7eg+j ed0zR2bc4NkFIjd+XFLUQMtcfWgNv9mrETmgnicbXQBV4UOIuJCAS6A0h0EXPHBkxWfdB7 KJh1E4Yx1srt3HtKwQ+qgOaYCMBzNCxVC4ZqcismsFxTkGCnM1Ant0CJgQi4vg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20221208 header.b=D75JFgKV; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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=1683905844; 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=rKtnmQxuEtXr04u6Lsi5eURUL5ozzoWWsP4KYnhwJO0=; b=HTQtJx+1SetwUq8pU/TqvdvoIoKtiYL3EowiLMWuo/xPL/osJTiH9wqQyTuCWyDZEbkBy8 TfDTNgcffxNRa3uiqP75vETiXeEDMkl1GcKseVc0edy6lzfYcnYRR7go18bi4klc4jboHM NKptNaMSUhRkn6sm8xtUwBhV4/BZrc0tAUoIevm1hCL92kAfRdaBLNGjkR1U2KJCTSTUy1 fAvanJMcSYWlxOgTTkGVOyZN7fyOQzecWqLxSJiqyk6h//QFE+jD39JOCjACGXPbXoF480 vGubokixfDGK/r1g3qtf1hn74HO4uULJhy0aWcXGSoq+PhtmnkVZiAGMbNrazg== X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20221208 header.b=D75JFgKV; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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" X-Migadu-Spam-Score: 6.02 X-Spam-Score: 6.02 X-Migadu-Queue-Id: 251F42F051 X-TUID: ViUmGWsWjywN --000000000000ba0edc05fb80db7a Content-Type: multipart/alternative; boundary="000000000000ba0eda05fb80db78" --000000000000ba0eda05fb80db78 Content-Type: text/plain; charset="UTF-8" Hi Everyone, I think this should likely involve an update to the manual but I don't want to bother doing that unless the basic approach is approved. ----- >From eccc3f8f805c38b1de55fc8ad60c67a87e2feea4 Mon Sep 17 00:00:00 2001 From: Tim Visher Date: Fri, 12 May 2023 11:32:21 -0400 Subject: [PATCH] org-capture.el: Allow `(here)' as a template target * lisp/org-capture.el (org-capture-set-target-location): Allow `(here)' as a template target in addition to `here'. Templates had no user accessible way to target the current location directly from a capture template. Attempting to directly utilize the behavior accessible through a 0 prefix arg exposed the inconsistent treatment of the `:target` property in `org-capture`. `org-capture-set-target-location` understood that it could be both a symbol and a list, while `org-capture` itself required it to be a list through its use of `car`. This change opts to make `org-capture-set-target-location` more liberal in what it accepts rather than making `org-capture` agree that targets can be lists. This is because the manual implies, especially in the `(clock)' entry, that targets are expected to be lists even if they are meant as specific points. TINYCHANGE --- lisp/org-capture.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/org-capture.el b/lisp/org-capture.el index d4311dd20..f14e95c5c 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -991,7 +991,8 @@ Store them in the capture property list." (let ((target-entry-p t)) (save-excursion (pcase (or target (org-capture-get :target)) - (`here + ((or `here + `(here)) (org-capture-put :exact-position (point) :insert-here t)) (`(file ,path) (set-buffer (org-capture-target-buffer path)) -- 2.40.1 --000000000000ba0eda05fb80db78 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Everyone,

I think this sh= ould likely involve=C2=A0an update to the manual but I don't want to bo= ther doing that unless the basic approach is approved.

=
-----

From eccc3f8f805c38b1de55fc8ad60c67a87e2feea= 4 Mon Sep 17 00:00:00 2001
From: Tim Visher <tim.visher@gmail.com>
Date: Fri, 12 May 2023 11:3= 2:21 -0400
Subject: [PATCH] org-capture.el: Allow `(here)' as a temp= late target

* lisp/org-capture.el (org-capture-set-target-location):= Allow `(here)' as a template
target in addition to `here'.
<= br>Templates had no user accessible way to target the current location
d= irectly from a capture template. Attempting to directly utilize the
beha= vior accessible through a 0 prefix arg exposed the inconsistent
treatmen= t of the `:target` property in
`org-capture`. `org-capture-set-target-lo= cation` understood that it
could be both a symbol and a list, while `org= -capture` itself required
it to be a list through its use of `car`.
<= br>This change opts to make `org-capture-set-target-location` more
liber= al in what it accepts rather than making `org-capture` agree that
target= s can be lists. This is because the manual implies, especially
in the `(= clock)' entry, that targets are expected to be lists even if
they ar= e meant as specific points.

TINYCHANGE
---
=C2=A0lisp/org-capt= ure.el | 3 ++-
=C2=A01 file changed, 2 insertions(+), 1 deletion(-)
<= br>diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index d4311dd2= 0..f14e95c5c 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.= el
@@ -991,7 +991,8 @@ Store them in the capture property list."=C2=A0 =C2=A0(let ((target-entry-p t))
=C2=A0 =C2=A0 =C2=A0(save-excurs= ion
=C2=A0 =C2=A0 =C2=A0 =C2=A0(pcase (or target (org-capture-get :targe= t))
- (`here
+ ((or `here
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 `(here))
=C2=A0 (org-capture-put :exact-position (point) :insert-he= re t))
=C2=A0 (`(file ,path)
=C2=A0 (set-buffer (org-capture-target-= buffer path))
--
2.40.1

--000000000000ba0eda05fb80db78-- --000000000000ba0edc05fb80db7a Content-Type: application/octet-stream; name="0001-org-capture.el-Allow-here-as-a-template-target.patch" Content-Disposition: attachment; filename="0001-org-capture.el-Allow-here-as-a-template-target.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_lhkpy72i0 RnJvbSBlY2NjM2Y4ZjgwNWMzOGIxZGU1NWZjOGFkNjBjNjdhODdlMmZlZWE0IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBUaW0gVmlzaGVyIDx0aW0udmlzaGVyQGdtYWlsLmNvbT4KRGF0 ZTogRnJpLCAxMiBNYXkgMjAyMyAxMTozMjoyMSAtMDQwMApTdWJqZWN0OiBbUEFUQ0hdIG9yZy1j YXB0dXJlLmVsOiBBbGxvdyBgKGhlcmUpJyBhcyBhIHRlbXBsYXRlIHRhcmdldAoKKiBsaXNwL29y Zy1jYXB0dXJlLmVsIChvcmctY2FwdHVyZS1zZXQtdGFyZ2V0LWxvY2F0aW9uKTogQWxsb3cgYCho ZXJlKScgYXMgYSB0ZW1wbGF0ZQp0YXJnZXQgaW4gYWRkaXRpb24gdG8gYGhlcmUnLgoKVGVtcGxh dGVzIGhhZCBubyB1c2VyIGFjY2Vzc2libGUgd2F5IHRvIHRhcmdldCB0aGUgY3VycmVudCBsb2Nh dGlvbgpkaXJlY3RseSBmcm9tIGEgY2FwdHVyZSB0ZW1wbGF0ZS4gQXR0ZW1wdGluZyB0byBkaXJl Y3RseSB1dGlsaXplIHRoZQpiZWhhdmlvciBhY2Nlc3NpYmxlIHRocm91Z2ggYSAwIHByZWZpeCBh cmcgZXhwb3NlZCB0aGUgaW5jb25zaXN0ZW50CnRyZWF0bWVudCBvZiB0aGUgYDp0YXJnZXRgIHBy b3BlcnR5IGluCmBvcmctY2FwdHVyZWAuIGBvcmctY2FwdHVyZS1zZXQtdGFyZ2V0LWxvY2F0aW9u YCB1bmRlcnN0b29kIHRoYXQgaXQKY291bGQgYmUgYm90aCBhIHN5bWJvbCBhbmQgYSBsaXN0LCB3 aGlsZSBgb3JnL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