From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id Sl0xI9uXhGBPnAAAgWs5BA (envelope-from ) for ; Sun, 25 Apr 2021 00:12:43 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id EL6bHduXhGA8BAAAbx9fmQ (envelope-from ) for ; Sat, 24 Apr 2021 22:12:43 +0000 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 C6A6B99C9 for ; Sun, 25 Apr 2021 00:12:42 +0200 (CEST) Received: from localhost ([::1]:37004 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1laQW1-00073k-VC for larch@yhetil.org; Sat, 24 Apr 2021 18:12:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52864) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1laQVe-00073a-HD for emacs-orgmode@gnu.org; Sat, 24 Apr 2021 18:12:18 -0400 Received: from au-smtp-delivery-110.mimecast.com ([103.96.23.110]:22468) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1laQVc-0008LI-Ja for emacs-orgmode@gnu.org; Sat, 24 Apr 2021 18:12:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mq.edu.au; s=mimecast20180308; t=1619302333; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=SE7jWzRtqWBbfQHOZg5vpvKKHZ3/ZivDZBXaOxzGoWA=; b=d/S2ZoFfIngmTtyIpoRLTkmvNg9MmuQJMr+jR3izY78ZEKtmok7zEsr3y47YCoYh5riCj4 wrVJy9S7lYdAEmrNHnnFWw+Ld/atDLRsves8Ip25L1Feor7K3ToRHXJrNHCDColfhAJtil 4Jifx/KpUbk5gKVN3tWnxkGDoCAcRko= Received: from AUS01-ME3-obe.outbound.protection.outlook.com (mail-me3aus01lp2237.outbound.protection.outlook.com [104.47.71.237]) (Using TLS) by relay.mimecast.com with ESMTP id au-mta-100-_w7pbVexOrOkf_iDOaoBag-1; Sun, 25 Apr 2021 08:12:11 +1000 X-MC-Unique: _w7pbVexOrOkf_iDOaoBag-1 Received: from SYXPR01MB0766.ausprd01.prod.outlook.com (2603:10c6:0:a::20) by SY3PR01MB0988.ausprd01.prod.outlook.com (2603:10c6:0:2::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.22; Sat, 24 Apr 2021 22:12:10 +0000 Received: from SYXPR01MB0766.ausprd01.prod.outlook.com ([fe80::65dd:9570:cfcc:fbc1]) by SYXPR01MB0766.ausprd01.prod.outlook.com ([fe80::65dd:9570:cfcc:fbc1%11]) with mapi id 15.20.4065.024; Sat, 24 Apr 2021 22:12:10 +0000 User-agent: mu4e 1.4.14; emacs 27.1 From: Richard Garner To: emacs-orgmode@gnu.org Subject: [PATCH] org-capture.el: Add new capture template option :refile-to Message-ID: Date: Sun, 25 Apr 2021 08:12:08 +1000 X-Originating-IP: [2001:44b8:312f:f400:2c99:bdac:7f26:6427] X-ClientProxiedBy: SY6PR01CA0041.ausprd01.prod.outlook.com (2603:10c6:10:e9::10) To SYXPR01MB0766.ausprd01.prod.outlook.com (2603:10c6:0:a::20) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from Trudelutt.lan (2001:44b8:312f:f400:2c99:bdac:7f26:6427) by SY6PR01CA0041.ausprd01.prod.outlook.com (2603:10c6:10:e9::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.20 via Frontend Transport; Sat, 24 Apr 2021 22:12:09 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8876f43e-c6a5-486b-6266-08d9076e00fa X-MS-TrafficTypeDiagnostic: SY3PR01MB0988: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: jx7SnCt1L79HaNmNKOEu2wxrhgZCYRa+plqqYZuJHDs+LWOOUfl0QxJShH7hvzngn3x7rqTx1OqFYa7MSmFg5cqJCCun5DgFw8hZlImDdwP0ODjympk+Nw0kl+5IzSMWRDtcxnQk68w6vyaXoQyo6tjce2n9AQ7HqJwV7eS8RslW04WLiJJU0qysI84Clbzs8LzLwPuSy0CJb/FEiUqStGSAtngkVMj9L+3UlBlLKs8q5zPSbLhbHUKee46Y40lDcQ7PJLw8PrtcuBVCKV4MkhVMtTeqiD82Yp0f8aQ6U4n2B5HXXWgwnlsd99IuECgfLG+iMDt7EPOv/eZX/VnunbxbcGz5xGLwKQEBSRlvLhKSMHXbSziW+Jt5KkYsUqFu2AmXjlJczvtkwj0MkZiyZba6+nv2Z1SsRt01CrcJkknYXEKhsiqbjaDbC3+NfGrKO7FNWYa28xu5Cmkd2oShnqP7YdwjnjGrgoZFDkG5jlYGJ9w+V1shXS39FrhpJ6YQSUtCr6lPR3y3/cXdaC41LDlxpF7QlTWrMvVCJcsIDBaz3lkO6pBdMUBzukd91dWHI/zSC8541R2BIEcql9YCugmOI2pM7NV+2K5C8EgDcQg= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SYXPR01MB0766.ausprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(376002)(136003)(346002)(39850400004)(396003)(9686003)(55016002)(235185007)(16526019)(86362001)(478600001)(8886007)(186003)(564344004)(7696005)(6506007)(52116002)(8936002)(36756003)(8676002)(316002)(786003)(38100700002)(44832011)(66556008)(6916009)(66616009)(66476007)(66946007)(2906002)(5660300002); DIR:OUT; SFP:1102 X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?mbHlAhTmJ1OU/YNLSwNvAAWPq1kXjBfnXAnHHqlq8SmIW32x7RR1SRBscXI3?= =?us-ascii?Q?R8Y7OZwSn067ZTiRaUuE9XMifFYD/Ry84GIvvgkU2UZr8M2B8g8J7A8r/JQH?= =?us-ascii?Q?51E5WBbn8oD+YaqaW/AbwNevpqGjEzBok0bufUsMWBinyY/YpOi/F2f1Ss0c?= =?us-ascii?Q?ix8epbyZjqobgV+Ilmv/cLbfhnUoBXVb6Xaj0ph/J2ryj+d+DhHAb0TJsDA4?= =?us-ascii?Q?8JmHXjfN4W/kitHQK6nRfxkDxh5xHNxXBcCN+/+9eMuUs0Dq4pWrhUX8MwCf?= =?us-ascii?Q?kOnKxB1dMrxdfzv5j6JZAd55ALs/Q2qRcfqhrSLqw3O7DRC6djvss2x+sZbV?= =?us-ascii?Q?VIxop5qKLK/7F3yfBuRrEgo08BbmkwavCojetdFOAPnS03Q6GYHokXqnJMRD?= =?us-ascii?Q?ZNQVnuqWaWLJt5+W2VUGi5V3kxKXRvWewp7HtJtLPDoiCuh1evyGk/PLhH/U?= =?us-ascii?Q?AYplB2RH19uCCV0t3BimRYviCE99MT9w7TgBawgmQQnrSvIxh0a/Kn3F3dJR?= =?us-ascii?Q?n9JTGagBbkdDyaJpJwwmD+s31NB9XfQe64WM3fs4mvjv8531HymII+RIBSQy?= =?us-ascii?Q?SQZM2g2kmfIxLn3ppEbUHf9NCIXzESZJ4noTGAHBYVj7UGZoO8xG5jQkrRsA?= =?us-ascii?Q?myKkOgR7iIm4es68iFYsoH92cWxfClu05Wcvog6usxzSzzuvImP2Gi+WjTbi?= =?us-ascii?Q?cizYUFHn6jTF47NUF5alfrBdHnIN7PGENEOnW8QqZ/1rIDkTf56fPTYDhM8I?= =?us-ascii?Q?mfR7z8Vm4m8xepyulWZGhonFM/oXNq0cJisNdVRmclW/CWGTuvDxfNHlHPG4?= =?us-ascii?Q?0xwcHRbcdzB7Kzr5oI9LJgShXM06PHitF1r/Q/DNbcQ86pZOteKKEiKPLKpN?= =?us-ascii?Q?3aVELblkfFD1/2ShQcsgNZLoHvoaq2swNePU7W0aAMlI3nkd7ZNKvbFb3qE2?= =?us-ascii?Q?DjKD0dkuv74QaDjaYaJVF3GvrsYQTeD2G/BhOqYL0I7rO4/BUcJXleacl5S9?= =?us-ascii?Q?/GTlLyiQKNhQ1rTiVT3FM0PhelwrmuZZiJxlrJrPGb4ZtzXAcMzL7mCVqeSb?= =?us-ascii?Q?XrURAZxy612/cWm5+r7qrcJmzwSAwLjLBEOcrZZBiv9sriO8+Kuo4qyBX2A3?= =?us-ascii?Q?qFd3+aPua2FO5vWYl2cPI9I5tXgIYHfmCUqMQziHBrSxgCpFxz6BowmtLu0u?= =?us-ascii?Q?LAfejeAvyMZnwzbbqiMmnOv0T5mqQiroq5mlG80CBO0YBE+CbbCdpwW1GDEY?= =?us-ascii?Q?blOf2LlGKdy743SSDNe1ykRJRH5e3I1WLduzI4EhTQw17EFqxIPPw9FkG8uc?= =?us-ascii?Q?1KmbuayzyUkIOI2HOwQjuV5vzulCAwDnPTKEeCSVFNQFSbiwyKGZTKUnZNYI?= =?us-ascii?Q?uDE/3j5SYNUMLJsx1wyZrZX2uZXv?= X-OriginatorOrg: mq.edu.au X-MS-Exchange-CrossTenant-Network-Message-Id: 8876f43e-c6a5-486b-6266-08d9076e00fa X-MS-Exchange-CrossTenant-AuthSource: SYXPR01MB0766.ausprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2021 22:12:09.7030 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 82c514c1-a717-4087-be06-d40d2070ad52 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: LkHsoLCysbZlxRGxxQyi+BtcMrRKHM4RuX5YDcGTc13+uUeCLrz/wCzlZLN3hRizR17hKp0n8Wp7jtsgaPTf0BXlvESxsI/m3nyF8UokjRc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SY3PR01MB0988 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: mq.edu.au Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=103.96.23.110; envelope-from=richard.garner@mq.edu.au; helo=au-smtp-delivery-110.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 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" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1619302363; 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=SE7jWzRtqWBbfQHOZg5vpvKKHZ3/ZivDZBXaOxzGoWA=; b=dP+ZM65MRfDSxJhdjQOACB+szt+zJiXTFQ+qnVB/U0eemphgtizDJDFw3gYRfpZ4c4AGvl 6DN7QawdlRVze2UGJdAOONl+kpWXuNnOHhS2BhpKETbA4DQRAB7KyVUebp7MGDh+5FRcwr FSgx2sl0SvNkEVY3vKkEQx8yViBbYRojdKsiHTdyf61TDyqL+TTp4OUPJpCye2/5OXhBGv zrgBul5SW63VmDiCSvPqnwMJkuBUWkuUmOU51CmGDuTWqU8lD+48bQnqu8u6fmbWK0pqNE uh6OVKaelQfgvk+HZBNwfDXicUZzntZCxjJ6fX7CoMisRE7RWeoTeOC8wp7gWg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619302363; a=rsa-sha256; cv=none; b=P92BGdbqGbwhP0TAIT4s1u7UZgbWOjGg1sO4UEbecFXVFzZUUbjIFLnKn4b2sBbmDt6rZO t0MBso5WMuclA3/5cKMFOK2FKIN8E4m2v4nAgXj35sP9ghZYwPwYgKs9dCkGikXWIojuS+ SKomh0jSOmXhE8eMk7vAjLx4S9aDcB6O6B98eyYlNBBG4yYhI9+N09mLaQt+Xv0LB6izr9 xLw/siuc0owbQIHHayvEfp4XCUyRowMUNZanu5aNOjCejUsDB9NjivPuBNm64lYnTGYFW1 RHqO0DvDAyoY9aGkOF+sbpghwZR/P3V+u8il96zs/tKJSV7AQ92o2ffC5il9Dw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=mq.edu.au header.s=mimecast20180308 header.b="d/S2ZoFf"; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.64 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=mq.edu.au header.s=mimecast20180308 header.b="d/S2ZoFf"; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: C6A6B99C9 X-Spam-Score: -2.64 X-Migadu-Scanner: scn0.migadu.com X-TUID: q8mHllhToZQu --=-=-= Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Hi all, (Resending after messing up the first time.) The included patch adds a new property :refile-to to org capture templates, allowing each template to have its own set of refile targets. I find this really useful in practice and thought others might too. Richard --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-org-capture.el-Add-new-capture-template-option-refil.patch Content-Transfer-Encoding: quoted-printable >From 829c1ba4805327645fcb75b35b73ecb3a1700b2f Mon Sep 17 00:00:00 2001 From: Richard Garner Date: Tue, 13 Apr 2021 13:53:49 +1000 Subject: [PATCH] org-capture.el: Add new capture template option :refile-to * lisp/org-capture.el (org-capture-refile): bind `org-refile-targets' to value of local capture template property :refile-to around call to `org-refile'. (org-capture-templates): document new capture template property :refile-to. TINYCHANGE --- lisp/org-capture.el | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/lisp/org-capture.el b/lisp/org-capture.el index 9fbd00ccd..64ecd5fe1 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -246,6 +246,10 @@ properties are: =20 :jump-to-captured When set, jump to the captured entry when finished. =20 + :refile-to When exiting capture mode via `org-capture-refile', t= he + variable `org-refile-targets' will be temporarily bou= nd + to the value of this property. + :empty-lines Set this to the number of lines that should be insert= ed before and after the new item. Default 0, only commo= n other value is 1. @@ -885,7 +889,8 @@ for `entry'-type templates")) =09 (pos (make-marker)) =09 (org-capture-is-refiling t) =09 (kill-buffer (org-capture-get :kill-buffer 'local)) -=09 (jump-to-captured (org-capture-get :jump-to-captured 'local))) +=09 (jump-to-captured (org-capture-get :jump-to-captured 'local)) +=09 (refile-to (org-capture-get :refile-to 'local))) ;; Since `org-capture-finalize' may alter buffer contents (e.g., ;; empty lines) around entry, use a marker to refer to the ;; headline to be refiled. Place the marker in the base buffer, @@ -895,11 +900,12 @@ for `entry'-type templates")) ;; early. We want to wait for the refiling to be over, so we ;; control when the latter function is called. (org-capture-put :kill-buffer nil :jump-to-captured nil) - (org-capture-finalize) - (save-window-excursion - (with-current-buffer base -=09(org-with-point-at pos -=09 (call-interactively 'org-refile)))) + (let ((org-refile-targets (or refile-to org-refile-targets))) + (org-capture-finalize) + (save-window-excursion + (with-current-buffer base +=09 (org-with-point-at pos +=09 (call-interactively 'org-refile))))) (when kill-buffer (with-current-buffer base (save-buffer)) (kill-buffer base)) --=20 2.17.2 (Apple Git-113) --=-=-=--