From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id CFv0IOLRCWbB/gAAe85BDQ:P1 (envelope-from ) for ; Sun, 31 Mar 2024 23:13:06 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id CFv0IOLRCWbB/gAAe85BDQ (envelope-from ) for ; Sun, 31 Mar 2024 23:13:06 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=outlook.com header.s=selector1 header.b="Y/eUdSMV"; dmarc=pass (policy=none) header.from=outlook.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=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=key1; d=yhetil.org; t=1711919586; a=rsa-sha256; cv=pass; b=NOg7qTIhVm+SdFit/qj065Ye0WmqRS7rsurb3Ud8QM79nBUY4FKZPp44AZ/GBDab2fYLk0 6H44Z8IFsNxnEfXcNjRMyE6vvYucTO/iDWOPOjMwkq7hSr0pcg99pRTIJ2bIuS6DEOZPlb xBZFRI+ZATBghjB9b5SLd8Be3RE3MWXwT0pzWsVkhDZFtHIw13jULufNwkop2Iu7L9Z9E5 nL1zLqCjgpNM+1C0WUVgvVtVdcC9rc2TuQY4gVNmF9fFiJ0w87pGcRujKdSiiGAGnNYfYo GNmXFoA/eRNruvlfVzqKhP6RRqqxEQE4rFfbdqVJ0yHDfuTKbmYmZ+q5YsDZzA== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=outlook.com header.s=selector1 header.b="Y/eUdSMV"; dmarc=pass (policy=none) header.from=outlook.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=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1711919586; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=2rp1nuNC3xpR+m6VT1zeMI9oID5qPpJU2iD19D7LdYk=; b=QwchqNTfUAP9m+6UVjtvMpEZ57bRFT5lgxx2fE8Ho+8nHhVTnASmwgW0av/cytELsnnpSc e3SgYg9zBgcgH9Co6z7KT6YVMsmhPvwOtePG0PVQDpFHS04NzBHJPSt+sV02ascgY0QP7Z 9pzBDpXJCFkRdsDEUxDiRcA3vWJeRMZEJj+CondQ+mC8be/jCRq/nrOJrmcZeQuv8ZkdZh 9y9U7CUBPG4QVuihKBrU7yuERNFnxbaIaTQgFfsV771vZqfpIVWH4QO09WNViZTaZtOH8a XOCi1x7vFGcgU5PLBfoO+uQGfy2Z4RmwYNE1T0I4yfLQC0nSdSBmT/JsqI9c4Q== 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 3F16825DB9 for ; Sun, 31 Mar 2024 23:13:06 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rr2TL-00089k-DJ; Sun, 31 Mar 2024 17:12:11 -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 1rr2TJ-00089K-8Z for emacs-orgmode@gnu.org; Sun, 31 Mar 2024 17:12:09 -0400 Received: from mail-bn1nam02olkn2100.outbound.protection.outlook.com ([40.92.15.100] helo=NAM02-BN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rr2TF-0006wK-PV for emacs-orgmode@gnu.org; Sun, 31 Mar 2024 17:12:08 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A/y/NaTRL1rPAVpyuxBdBbmHC2OS28e92lTpd65u01tz/9h6JQciIkHvY61teG0s9ACwPBMqwzIvsD3T48IeopJFGveZLTh+WEZBqvOW6NGbEHJbjqp5HOZGiRlZCHWHQaoAjEdmR8mJIr9LsIfpZbAymAcRHPV8qmljf4dlZRuv76O164yaO2UMUmc59s1IcqhpywGAZiVGCaaRoUL0KCp47ZEmyCpiE3KUU/5KmzuXST+aHC8mP49Ni09F7gOaAk2JnXY9/sFZiPahapkqWNAb4SdwYCO0Sx+th7gYFL+O15KoEH/Y4lr7hIl8nZbnh8p9yN0ohEBzTtNZBCVe3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2rp1nuNC3xpR+m6VT1zeMI9oID5qPpJU2iD19D7LdYk=; b=hiHyh7jg0dcVWfJCLtBats7P3NJ9TXBMHagjtl4RcfOJQZDKokxx1ebOx1tnj7GjuDn+X12qXYcNaYwnea4wJ0YdEq8MunPKVVgkzBlFyiFjiQUObEhWwtOcGSYh6tXb2BENwjLZQUNQG3qQqcyheVi9dCqh00/MrPq1UMByLh7kjVC0Q9HzN6RaLd3H9z9+2+RGkL9R+45OzrSs42oMsm57PsNcefQIjgpEIRDBYJLpmj9C17Vkj5wgYPdWWkq6x7TKCzUN9rc2WiOsfB8ttVHHgVg/tqzPHXXehGGMj+Yfhsu3MH4rE7R3l+Ecv68tp4HCrlhzzdsH9jCNNT7jbQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2rp1nuNC3xpR+m6VT1zeMI9oID5qPpJU2iD19D7LdYk=; b=Y/eUdSMVZVaatFvFcXECgjzW/p6VzAgHnzLTCrNjoCksWbprxA94/HCrX1SH+Z31ZTs6Ux+m9VS0jPZCQ/2Yh47iTYCU0lO4VPnbKNUDoQlVooCu811iM6kmQb0P4iBrMqMCN7je8Dhz9+zlALq6oFnTuryUOQKvzBibdi/D6t1yBox99pV8vwDOvkOuoFM9k5PT6B/4HcPHloOZWefn2vt+uQn5FkAVop413WMoVaUek6M/DZWULoOxM3JP/XsUK+CctUqE7VoQhiybYyeZYRqQyIJzh2Ti5i/arERKjtU7osqbKqvm+BsgtnNL2SitgVpZ8HdE1S+AyyThVI0Bww== Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) by DM4PR84MB1829.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:8:4c::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.21; Sun, 31 Mar 2024 21:00:57 +0000 Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::178d:1518:8a49:2a45]) by CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::178d:1518:8a49:2a45%6]) with mapi id 15.20.7452.019; Sun, 31 Mar 2024 21:00:56 +0000 From: Morgan Smith To: emacs-orgmode@gnu.org Cc: Morgan Smith Subject: [PATCH] lisp/org-capture.el: Simplify 'org-capture-get-indirect-buffer' Date: Sun, 31 Mar 2024 17:00:25 -0400 Message-ID: X-Mailer: git-send-email 2.41.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-TMN: [BV9HWCFbqrMBRpwJRkoT7IO6Kmj6g9V2PeHdFWoXj3Vo2Bn9Cxbyww==] X-ClientProxiedBy: YQZPR01CA0074.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:84::17) To CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) X-Microsoft-Original-Message-ID: <20240331210024.14993-2-Morgan.J.Smith@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR84MB3424:EE_|DM4PR84MB1829:EE_ X-MS-Office365-Filtering-Correlation-Id: 3c65c662-da38-4e96-c8cf-08dc51c5a885 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tGSKDz0n5qFNCknhdR6nzLSTgBwmk3EvisAp/09402V5sesN0K5ZSeX5UVuaxybYHbzYR+tBa9eIqQzetvn4KiYGTd9WCX/fge0f80QGNWxotvbyvjbKKpX1BA52c2QJjnEJ1MjTHEQP21rYtjalvQMbENLIoGKnhvCSTFLPCvLe4nXAwRdNl4FK5ZxqedK8y+K/sI4b4mcMVo2QHt/U878hGHEhNXi0101iz0p4/1mhjf5PTjOPWF4a6qlX7lQKf0EzuiAlIdHgGQ/e2PS8qebcDBqh5s/GrqcZoYLcZC9kzhjzNi4NUDQeKB3DLtzw6d2IQ0cV8+KEnM8sXiJdYya0D5DdqjzCvq1Ppl043DjupB18p9dBtQiyF+XsQyFnr5gAbonmQ/w1dkALaCIYedW6ECUWCSgXeCt6QCB2j1OuAsAjaDlgS8Z+ymVCCFglA+U1I217herD9f5EA3eFIOBnB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4LCIrXKujWdRZlYIOSzkNFXZslHuARWK6oTeR3?= =?us-ascii?Q?3kNCDjv0eAIp5iZXONTeA+B7OX1JxwRoyzoAIjtnLUSqBkdmBAqR8fRfT9fp?= =?us-ascii?Q?87Egd+wAoPCIgPg4gmzLc+i7/qyNNGhLjzV7Dngv1cX+FbSfaSUGqJIsYp0X?= =?us-ascii?Q?RbWaeCw8izVv2xe7dUXM58wRWm8gNzxtCa1qylDjJXqbaaLT8yn7jpfl2Dq/?= =?us-ascii?Q?7Cq5c8CMOgiiLzigIiiswxTQ6d5dZn+dhzMjNAWl1eRgkp3JzAnn7UllrinB?= =?us-ascii?Q?O6y+3EMgTnW4juSWiYPS+5OZKNI1uAm8L8RbKP4j7OQDCOPnLjOjeXrs+7gs?= =?us-ascii?Q?e32kfFa0hhSbMlbUefiu0FoH7kzah9l0RjMC+XeBrUu9ehoZLB8jRy+D9BaX?= =?us-ascii?Q?hZLdodf2VwyQf9q09sLH+QXix0/eoYoHK3nESkAJ/Q7S/2dmMiYjP+SDAHWj?= =?us-ascii?Q?mwt/yVLHBvowGagNISfj79+zbB3shhySHTVwzC9/GztyNnMdgkA1W4KeRo5c?= =?us-ascii?Q?XLXu4FlzjKu1mfgMzb4RP5nscQPQhoxIqD7VW3P+5gwjpS18L+OcXJDcXLjt?= =?us-ascii?Q?0e2+ITO/xyP3CfWRaIpIfE124CRnqdnsstb/BsfvIg=3D=3D?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3c65c662-da38-4e96-c8cf-08dc51c5a885 X-MS-Exchange-CrossTenant-AuthSource: CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2024 21:00:55.9770 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR84MB1829 Received-SPF: pass client-ip=40.92.15.100; envelope-from=Morgan.J.Smith@outlook.com; helo=NAM02-BN1-obe.outbound.protection.outlook.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, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-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-Spam-Score: -9.17 X-Migadu-Queue-Id: 3F16825DB9 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -9.17 X-TUID: zAtHCRS+eAyE * lisp/org-capture.el (org-capture-get-indirect-buffer): Simplify by using 'generate-new-buffer-name'. --- lisp/org-capture.el | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lisp/org-capture.el b/lisp/org-capture.el index 8ce11cb75..5d9ae4947 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -1585,10 +1585,7 @@ If TEMPLATE-KEY is nil, the user is queried for the template." "Make an indirect BUFFER for a capture process. Use PREFIX as a prefix for the name of the indirect buffer." (setq buffer (or buffer (current-buffer))) - (let ((n 1) (base (buffer-name buffer)) bname) - (setq bname (concat prefix "-" base)) - (while (buffer-live-p (get-buffer bname)) - (setq bname (concat prefix "-" (number-to-string (cl-incf n)) "-" base))) + (let ((bname (generate-new-buffer-name (concat prefix "-" (buffer-name buffer))))) (condition-case nil (make-indirect-buffer buffer bname 'clone) (error -- 2.41.0