From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id yIFlKEQpcmLh2gAAbAwnHQ (envelope-from ) for ; Wed, 04 May 2022 09:20:36 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id iEN/KEQpcmJlvwAA9RJhRA (envelope-from ) for ; Wed, 04 May 2022 09:20:36 +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 35F99858 for ; Wed, 4 May 2022 09:20:36 +0200 (CEST) Received: from localhost ([::1]:33298 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nm9JL-0002ww-46 for larch@yhetil.org; Wed, 04 May 2022 03:20:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45938) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nm95F-0001qz-IB for emacs-orgmode@gnu.org; Wed, 04 May 2022 03:06:01 -0400 Received: from mail-db8eur05acsn20809.outbound.protection.outlook.com ([2a01:111:f400:7e1a::809]:1505 helo=EUR05-DB8-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 1nm95B-0003yn-03 for emacs-orgmode@gnu.org; Wed, 04 May 2022 03:06:00 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GzalyEk8Wlx8nymWA64I9PPxBYd1E+62uK2bSgziZnp/j1VuTLGPs15WNxlWRCIT27BFnH8ZCSgv3pPJ2aeV7RjkMHQ/lVtVkhX3TT3tEDt6YBaVkDUOXcBKJ98O52zYht34YYdI6CjIzk1umEeTyt+UKddJgkdSaTAnZ/qsTbQoiFcgkwIGUwO6ej9KcLS9RL80ni0cfCvfH7GWynHotQaukI8k+/htcey8e+pzjHsjgnh3eUEctLKWDu/3la6GPyZBek1g3w0hXOVjs5j/HxWe0nLxPSYnBkxx8BR/fL5BL7BAZYDMMnjebmamZFNf+gZi1odiF/KdIjYfPf/1sQ== 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=1wD2LxEcgCFJ0TyVdjWr/x2F0vJRnZDhyIBoRgfmhAQ=; b=T7dltgvU8nGHXcLwYBE4ECPlKk9rmKjyK2kgKrQPGMWQGEHul0de3H8PbPxKWs1Io/62D0zQW67oOLNGxbW5tbEUEGiZgdorqkM3h9alHFQR2tn39joL3G1iIn873ReYiQffYqAzda6YZ+RVLzojOIwg4ArQtm7J0OWop3A3OKlsYlUr5i+DaG6H0tI0UEAghURx+Rr1G11SjxY/HP5Sbt4OO6NDCzCVFH4dWR7xT24ZLI2k5mB0RTQhUXuC3npCgmvUXiBCMkXwgyveyBwWF240B0dDo3iVlKXmn331XnXiUExaD9RTtp2r4EX/xvx52WTbcdob8GSUWN+sZyB1WA== 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=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1wD2LxEcgCFJ0TyVdjWr/x2F0vJRnZDhyIBoRgfmhAQ=; b=eTjE9UF/BNwcMTOIjpyTBo4HxCC7gS9Kt7kr2/Du3ZMCiUuL1pTD2++iv/bDJJMKcOkpbxj7mdu+0yA7MSjUn7WhN3qStDjkgjZD+IG6q0YS6SFUCo4xdit1kTN1i2ZlxzGYvZ0o/r2F+skbL/gydY9TD5l6wGLnXeHeuYe3SZQ1HU+2Ls8PUVRWTu8wghh/RLUme8fQBkUsocmBFPZPSq6FmOyogZMTGmpeSJRBicSChHgb1OeBBkfl6Cy7TbtHU3rbH3W9aP+85KoB0KQHIK4JUondfbb2NO+QlZ4ubb+3S5BDDFkpYIb7+dOkXRFerukjB0/kbwwe6YbC/lcyyA== Received: from PAXPR06MB7760.eurprd06.prod.outlook.com (2603:10a6:102:155::8) by DB7PR06MB5180.eurprd06.prod.outlook.com (2603:10a6:10:6d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.20; Wed, 4 May 2022 07:00:53 +0000 Received: from PAXPR06MB7760.eurprd06.prod.outlook.com ([fe80::3d50:522e:f03c:6225]) by PAXPR06MB7760.eurprd06.prod.outlook.com ([fe80::3d50:522e:f03c:6225%8]) with mapi id 15.20.5206.025; Wed, 4 May 2022 07:00:53 +0000 References: <87v8ulhnhh.fsf@localhost> User-agent: mu4e 1.6.10; emacs 27.2 From: Ignacio Casso To: Ihor Radchenko Cc: Samuel Wales , Daniel Fleischer , Fabian , emacs-orgmode@gnu.org Subject: Re: [BUG] - Statistics cookie is part of the org heading title Date: Wed, 04 May 2022 08:31:17 +0200 In-reply-to: <87v8ulhnhh.fsf@localhost> Message-ID: Content-Type: text/plain X-TMN: [WvAV12aNtPX1H3vMc7FmduHGYpWPiQ24] X-ClientProxiedBy: MR1P264CA0110.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501:50::19) To PAXPR06MB7760.eurprd06.prod.outlook.com (2603:10a6:102:155::8) X-Microsoft-Original-Message-ID: <87h765aijn.fsf@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1656df5e-fa89-4daa-7edf-08da2d9bd270 X-MS-TrafficTypeDiagnostic: DB7PR06MB5180:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AaRT/ttxgxRfjtb9JLEMCwxX76/gZDWJFVsV6YOXHjLciBc5cFd46qtTopOI8ryyOGe1iyaMBrcSRdYl2aJ6oW7AjYMf+gja33nmX5+pGarYlBzew0RW70vxmb8/M6MaRi9GxaaCQiiITdVNn3KbB9wHwfjI0EKET48rsEN28XwM3DLQrYSBXLXRPII2+i0cPYP1B2oTnUG8AcM3MeNEZ7L6CJyoFi8UhdjvaiWhe44zrb6MXRzLqmr5tomLmQTq0RBvEV5TVFjKq+zDkdvbPW35ZRbnjlQI2AORrS1aPhX/iIorwFWPsWDXvlxBxKzqJ+HsdZlhww9g0p38+0PoveR9sbn9S9MeOF9TFUEWmGhQK6G9hzRxo15mvZ0pG9ALwiDxzdVaqSfST6i/TdPUPVML/mJVd7+KMERMnWDg/Hnnvkl2zx71bor3qhS9u4ddPZH7qpIZf+6Xro84NCXKG5esXSzNqNDpl+Fk4DJ8NvttT4LFA5ttfLug1LxTtvvBKtQTFYmUHenjc3F61kY4d0AdXDbkiwf92ieQAwuF2OG0dJfJNJ/OIhOf2Vkmxot1lTzYiJefPTIfj8RQWIiprorleMAH1S9tNmGY+gPG7MI/QVvF91Sbh7z9sMJehwjMHklbYoBH+6szw0mY9HHON8KCGWpG2/czHgH42gqKPuO1y8xbGAG5z2/L+TJbOuMonS+gDqOYEiH7Cd3ZwCFqtw== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?OKI5jsiCxgRTHStnpVezti0Sfq8A0HLbgn+KPEw9UwwY4d4SfYX/BU7GCdH5?= =?us-ascii?Q?eefhh4ZHp/SoNUISV2FsVc7w0N+VxApg9bPE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JMFMOwmCxKRfpcnWAnKb/+aXk+Lj1SUhWGCAhaW26cOBJRu9?= =?us-ascii?Q?58EYW/K55yrtfVA9d3DER1YLEEAMbfMPzNqF/UpmhACpM0gmsCd4YRFjhXhZ?= =?us-ascii?Q?nhfHQU/EAaRszrnFigvDVy0U+Ml25QsaG7Hz96einxnvT/eCiVJRKtHPZay5?= =?us-ascii?Q?1GbjW7TyWVz9j41igtMJ0B9ad9SB84UVZu5MMrCJtH8G6jxaqEEklnUiNwCk?= =?us-ascii?Q?0CJjirOcXV0/FhjZrz40QA2AYfeLK/xIvV6xgAO57qGKf021im0Ny/4QErGL?= =?us-ascii?Q?kxIg/bADGGi982dDoV9AEUNfN8UjBspknJGCuAd5Sl+O7wBqWM4hnScHZuy7?= =?us-ascii?Q?n0mHDhXYFs2CghKHdXPSDHKJmvvuUr77J8d3WSV7u0CU2CPTD+CHCLx2eQAq?= =?us-ascii?Q?4ImJMmrLPA/tpBhgw6i495NC2Sf99mcriU1Nt2vOgI4RPe4WC4xvnvaIvqvs?= =?us-ascii?Q?A/LctfP7pN0=3D?= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-6e454.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 1656df5e-fa89-4daa-7edf-08da2d9bd270 X-MS-Exchange-CrossTenant-AuthSource: PAXPR06MB7760.eurprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2022 07:00:53.0891 (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: DB7PR06MB5180 Received-SPF: pass client-ip=2a01:111:f400:7e1a::809; envelope-from=ignaciocasso@hotmail.com; helo=EUR05-DB8-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, SPF_HELO_PASS=-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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1651648836; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=1wD2LxEcgCFJ0TyVdjWr/x2F0vJRnZDhyIBoRgfmhAQ=; b=bMb4XuNaWauZUV2mA2oKhCaZc7NQ5Q4GVbWMW+Ya3PPzet9sQXd38icvDu/tA+jMoGCar2 9BbaipayqLOFWhm9+C4//cIxRhzPndYwWtHjbcSpHMycOEYhuv7aLsWXPnzNGjf2crjxEs ioJKkreccpYPmfTUKYIV2wJ3Tt17OMkcRbllBwRrglQdipKsmPr6i5MePj/PnT8A8wFZLc NH8HaW9b+4CK8xCe2C++s0BXK5MgCZrZl3qoSjrbRg+0Qnd5Cx78JW4ZXPLWyATEoVPTn8 F7AbSdA7q6TvLjh/8Xp59OFLZh9iuUjHBiHzCPJ4m8skF4j5GRgsUTpt/D86JA== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1651648836; a=rsa-sha256; cv=pass; b=jewvLpqBkiL5dxIRLRVyuAEe7TVHUhcAUhAFdmgA8HbzZfO3vuTmi17bhUeFhPY8xcCe3o ceMgIq5kqChwR6J69jieN3I2KV9bvd0hsoXbVvAAOTW6Xk81Oqn/h6J+WQYwRsrRY/dR0U gnfvrYdJCZ7gc7vAfWErdUIQyIRuHi6nJzwhTuRs5pVTXOrjExh8vKAjiXFGW5vnM1c2Sp 9E1kHMNj28ECBWhENRmlryQo6S356nvqsekiOhEm72384CK9pFIg5JmmwQP3O/AeGoqeV9 HvBk7IEhV1J8rRJeVMb1EgqaDGnhH3m5TvV7w0g9S6fUCMgeiogcp+S6x/c2VA== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=hotmail.com header.s=selector1 header.b="eTjE9UF/"; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=hotmail.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" X-Migadu-Spam-Score: -3.48 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=hotmail.com header.s=selector1 header.b="eTjE9UF/"; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=hotmail.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" X-Migadu-Queue-Id: 35F99858 X-Spam-Score: -3.48 X-Migadu-Scanner: scn1.migadu.com X-TUID: KNGQMDoXyQH2 Ihor Radchenko writes: > Samuel Wales writes: > >> some code removes it. for example creating a link to a headline using capture. > > Yeah. org-link--normalize-string. But it is internal function, so I would > not rely on it. > > Also, rather than relying on regexps, I would use > org-element-headline-parser, extract parsed :title property, and filter > out statistics-cookie objects. > > Best, > Ihor I replied to this bug report yesterday via the "reply via email to" button in https://lists.gnu.org/archive/html/emacs-orgmode/2022-05/msg00058.html, assuming it would send it to the org-mode list, but now I see that it was only sent to Fabian. I copy my answer at the end of this email, although when I wrote it I did not know that statistics cookies can appear anywhere in the headline and not just at the end before tags, nor about `org-element-headline-parser', so as a reply it may be no longer relevant or correct. Still, I think it might be interesting to compare this topic with the one I linked in my reply, https://lists.gnu.org/archive/html/emacs-orgmode/2022-03/msg00293.html, which it's basically the same bug report but about COMMENT keywords. In that regard, I have tested that org-capture targets do work regardless of statistcs cookies. Could not something equivalent be done so that they also work regardless of COMMENT keywords? Feel free to reply in that other thread if you feel this is off-topic here. Regards, --Ignacio Original reply: Hi Fabian, > I would like to report his behaviour as a bug: > ---- > Example: > > * Some Heading Title [0/1] ;; cursor in this line when executing > ** TODO Some Todo Item > > -> result is "Some Heading Title [0/1]" > > -> desired result would be "Some Heading Title" > ---- You forgot to say that you use (nth 4 (org-heading-components)) when you copied the example from emacs.stackexchange.com. > I don't see any reason why the statistics cookie should be part of the title: > it should be a separate component. I agree. This bug is related with the issue I reported in https://lists.gnu.org/archive/html/emacs-orgmode/2022-03/msg00293.html. The problem is that `org-heading-components' uses `org-complex-heading-regexp', which does not consider statistics cookies, and neither COMMENT keywords as I reported. I think it should be updated to consider both. In the meantime, I was going to suggest that you use the org parser, with (org-element-property :title (org-element-context)) which solves the problem in the case of the COMMENT keywords. But I have tested it and it does not solve it in the case of statistics cookies, so I guess the problem should be fixed in org-element.el too. Regards, -- Ignacio