From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id +l3IHfaVhGAplgAAgWs5BA (envelope-from ) for ; Sun, 25 Apr 2021 00:04:38 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id kPtVGPaVhGBELQAAB5/wlQ (envelope-from ) for ; Sat, 24 Apr 2021 22:04:38 +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 5224F9818 for ; Sun, 25 Apr 2021 00:04:36 +0200 (CEST) Received: from localhost ([::1]:60560 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1laQOB-0004p4-3e for larch@yhetil.org; Sat, 24 Apr 2021 18:04:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51462) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1laQNm-0004ou-87 for emacs-orgmode@gnu.org; Sat, 24 Apr 2021 18:04:10 -0400 Received: from au-smtp-delivery-110.mimecast.com ([103.96.23.110]:29202) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1laQNi-0004Vr-M6 for emacs-orgmode@gnu.org; Sat, 24 Apr 2021 18:04:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mq.edu.au; s=mimecast20180308; t=1619301840; h=from:from: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; bh=7wWgy38LlROsDn4vUnr/mKY4tddr4oesV1z9H6OLZdk=; b=aHUZ6SlKUFQqJwBOm5uWrWagy7+ER39QjpoS5Q+ter6vXeqnpD53XsKidzhgj+FJl2cCba rY8TUP1XIuk0h1QfRcdZDHamDJPGO3YR2emirGQ+TAKQpablmeoKFwDtRzBokNROYDzw9D uZRNy2LbvlCmRUazyml/NJywMtl5uEE= Received: from AUS01-ME3-obe.outbound.protection.outlook.com (mail-me3aus01lp2240.outbound.protection.outlook.com [104.47.71.240]) (Using TLS) by relay.mimecast.com with ESMTP id au-mta-72-f7MUer8yOKCeK0kN01NA0Q-1; Sun, 25 Apr 2021 08:02:33 +1000 X-MC-Unique: f7MUer8yOKCeK0kN01NA0Q-1 Received: from SYXPR01MB0766.ausprd01.prod.outlook.com (10.169.175.20) by SY2PR01MB2297.ausprd01.prod.outlook.com (52.134.168.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.23; Sat, 24 Apr 2021 22:02:29 +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:02:28 +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:02:19 +1000 X-Originating-IP: [2001:44b8:312f:f400:2c99:bdac:7f26:6427] X-ClientProxiedBy: SY3PR01CA0142.ausprd01.prod.outlook.com (2603:10c6:0:1b::27) 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 SY3PR01CA0142.ausprd01.prod.outlook.com (2603:10c6:0:1b::27) 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:02:27 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 048cca3b-7aa3-4100-130c-08d9076ca629 X-MS-TrafficTypeDiagnostic: SY2PR01MB2297: 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: s8VhtD5lkATmcG8CY29kqAyqkarDGw8pcqEqZugngSldkdSyG+hdtGlQBNmxRYZN5LAxs5WRUU1EqVytc7PCuncjGeROnOUaadGoasL0N9HhGAEvCrHdGCQxEO0Iv8YgAKGiVOrE43YBVPuISRRWH2mBJif6KYcqdxXrUuuaR7dctjAEM8TgzRXs9AMi+jtU+rcJ0m7bRInufBGLerJnpe7RQbH99rokpwu/w6oEHX6ZSDN6zsYixLMyJa+V19znABla3K/sWYHm8pkdSPcNhSsqb5YMRxWdVLpuFa9s1ybLf1L10oNjE243ma3E5hAGvlj3jdSuthMeP7MsV9EnGrJJae4z1ovZLza+H7hCbF0ZdaKGY8GkwaZcJ4+PvzvHXMYUQ8npxPWQcVJ3Fhf/5iRCYtO03ut21mbhrKYN5jjaEwmS987uBtVA0Zz6HzoACdOPQsuR3hG5+Vh0QYwAmwyJsji2iurHUa2LHrUCjE1IsnrUwQPHNouWhd8+zdI1foySPP1cPMnrhOCcuYZ2/fWHyVgyGJUtZFFOcU8E476GLUCF+lQSzvfm4hPuNvbC/weQbpAHlHbvkUiFlBLXbsMvfJ81XtOvabNUst15zF8= 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:(396003)(366004)(376002)(39850400004)(346002)(136003)(83380400001)(66476007)(7696005)(316002)(36756003)(2906002)(66556008)(16526019)(8676002)(6506007)(8886007)(786003)(52116002)(5660300002)(8936002)(44832011)(186003)(66946007)(478600001)(38100700002)(9686003)(6916009)(6666004)(55016002)(86362001); DIR:OUT; SFP:1102 X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?7F3dFP2vrbPJTTmg0ULtRUEux+GCuWfbfTwloeg/epSY4A7EgdfIEmrNDCdf?= =?us-ascii?Q?wUQjm/Up5K9Ms3SrnDlFSFthz4friY+yarRVQkPT1Q+GY2rMT/o7S3YQrPHj?= =?us-ascii?Q?IOCIRsREMdxVaeB/aQoZFH8kR3uXcS6LB2EszzmgKikNYSI16Jv4JrQpdL/o?= =?us-ascii?Q?k+W6REr7+U9Gr3atsQVsvZ2vWUOGdl3oM1J9Q9qqrRC62bcMURMJumbHJr5a?= =?us-ascii?Q?tLT3nwxixix1On2IB9ORS3aknyPI1AmuU65L66ueiOhTtUCX8YCdYWxNqo72?= =?us-ascii?Q?ssmRuB0xUKVwDrQvctfD756GWQiqnNgH8aifvnat8EjMEw7h7RL13tzSE3DY?= =?us-ascii?Q?q1B9GBoKudMz8GFe9qfZfhbNigt/cwsIvgjcZUoq6sMOc78dRYvVqsEm6vVF?= =?us-ascii?Q?Iviay2FGRceGNpBVMq1u1/63TwDU70RMMcrYljg+kcCrWtMcVsUAn2SXqILy?= =?us-ascii?Q?y/cWpVmIS9HLC57idQ3SFqyyO6xM+gqukm797f4gGWhnFXO+Ed/7dqrYuAJ9?= =?us-ascii?Q?oDqKyv+MMzWFV1a7a7L+LKQLOXFwyGsBw1WgSYfjWvUnxktqbJSvwtlTTWzX?= =?us-ascii?Q?XvdaH9tHi0t+F99AVlsQoMpfy0iGilzBuF1ZtMaKuknjyozWi9ty2gOADczf?= =?us-ascii?Q?rjGw8Txo3GiSWTKErhH0DeycyZz65W8Yg15nskqECV2GxJKpufJ0GzcclXqI?= =?us-ascii?Q?8Zxd6FhsByEoAa5LRD2p6G9I4SbNzlO2k7Q3uJgdexb2xXWxRWFAdMixv4oY?= =?us-ascii?Q?W2px8z/nyvB0c6Th0HlSxDdju+pT3UDvhKWNXD4ufd8Rw3AA3QSahC9KwSjZ?= =?us-ascii?Q?jMcFriNAXZHKjzSLHsqM1kvf6UvV4noNfFUvPdsNr+3d4pzaBlk4Yoo+YPzy?= =?us-ascii?Q?uNicW4QN3w2FtZCyhpUTcLLGgm3vq/+9r0cEZTHZGPwqI7PoQX4o1RzPf6kg?= =?us-ascii?Q?+GTKHIpEeb3M0IbC4SloYIhWKEo1CSOzXqWa4GPsuDBYxS8HoYZ1fZOrSDqz?= =?us-ascii?Q?e5lOGt2c4CM5p7p1Cj5TPP/DBSSvgsnOaKimOc+0nt0DGxNLyFSm61TR2Q1m?= =?us-ascii?Q?53lTVKILAs254EF6o005VXdEQGOLrS592q+uPQXVtyygyj4E+wYq7ZtqRSxE?= =?us-ascii?Q?2DrPb7bghOxkMAsxAI0BGuYcsyztckZRSDsEr0qUZFohOvCN9Xq293sxibeu?= =?us-ascii?Q?ngrx1tTrohiqeajiZyYsWJWp/vHfOQZ4xDZaiqqnSc15hxs1CngIsRvchDcJ?= =?us-ascii?Q?Sd5HTv04DspD4WXNJRfIyVfQTIROnyRuLQJCB/9gfPmXZUmWbsx/2gzgxhTp?= =?us-ascii?Q?/3lNmDTLedfiO3Oc3bWLijZXvrE/HOCj9cqbqo07xPli0SxTb5OOvBcO7a4S?= =?us-ascii?Q?t2KDXIPlkxx5wBeXGEkWt379JClH?= X-OriginatorOrg: mq.edu.au X-MS-Exchange-CrossTenant-Network-Message-Id: 048cca3b-7aa3-4100-130c-08d9076ca629 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:02:27.9086 (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: nd2NGf0Xex8DmnZYPNxn3mw++7G4y7vOk71V2T2pCRGEitzJkSw7yxTtp4tsQKUvR78h2/aUilDwCvpjQ/8olDInLXSXDXnnIDNPLkZhf94= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SY2PR01MB2297 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: mq.edu.au Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable 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=1619301877; 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=7wWgy38LlROsDn4vUnr/mKY4tddr4oesV1z9H6OLZdk=; b=dR6j04/ZmBQYzv2Ec38RscFlexacmb205bZi5OYK/fCL2KUvLY36y/kynlA+/S2+pScCfI eKE5WUkRznHMPjp3vxb6T/6wTikEW/5e7a9UN64wJGj82AxFcjQt01a452OGCnfVxt5trN ouem+RT67d7ED7JDCZNjxiJTADU6D5ZIFubKHII0x0rjrgt2RoOTTBA63Ubchrow6AS0Jy 4hi1Osmn4/87ZmgcdhIECqwLrLDH82GW1bZjsl2TNeqY87C7sTScgAS9QgsR2nKdHtX5NO flVcPVsrb77w33NOdrYUcK21pFsjHOuyK0BKjzp1A2uFczBLw6XU4ONaNZbPYQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619301877; a=rsa-sha256; cv=none; b=FUcqWn+xo5KGFaaU2EETBflPqlpcQCSJfHORCiiISt+jTJjERNQ57G24e1HNbzKlEYnPaG M7IUV1ZnSdE5KrYtEX/fFXUP3OUvb7hPvbxnvVOwsF3KAUL2GaRUWmmeo5c22AvSaDfHoT ydmnRbCO7G/KS2eh42zfgSl74Wl/2/RmxuppcCzTsg5fpBezY6yv9DUK6snegP7fdCanLr 6fuyZ7NypPBKzdj65I1+9gy55HR+yzA1v/0CBa9HzXULkHywYdGKoFh4KaYm2w5BuwiOhf ickrpWD3nIz88Ait2GCbAKrCPy5NSPRK0/yy9T0D/4BC0wvRGQgu+biY43p09w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=mq.edu.au header.s=mimecast20180308 header.b=aHUZ6SlK; 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=aHUZ6SlK; 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: 5224F9818 X-Spam-Score: -2.64 X-Migadu-Scanner: scn0.migadu.com X-TUID: A/Ip+2iyHiDx Hi all, 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 --- >From 829c1ba4805327645fcb75b35b73ecb3a1700b2f Mon Sep 17 00:00:00 2001 From: Richard Garner Subject:=20 * 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)