From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id uIVQElOsc2L0pAAAbAwnHQ (envelope-from ) for ; Thu, 05 May 2022 12:52:03 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id cJBlElOsc2KqMgEA9RJhRA (envelope-from ) for ; Thu, 05 May 2022 12:52:03 +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 AFA69A6AA for ; Thu, 5 May 2022 12:52:02 +0200 (CEST) Received: from localhost ([::1]:41754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nmZ5V-0008N3-30 for larch@yhetil.org; Thu, 05 May 2022 06:52:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57158) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nmYsN-0002ud-QK for emacs-orgmode@gnu.org; Thu, 05 May 2022 06:38:28 -0400 Received: from mail-db8eur05olkn20825.outbound.protection.outlook.com ([2a01:111:f400:7e1a::825]:12640 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 1nmYsL-0007gi-ML for emacs-orgmode@gnu.org; Thu, 05 May 2022 06:38:27 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BvPczlyMnH4QFEH8y4tmiO26upr0hLVmWqzkUC9d+LGf7jYv4+qpK/MK3KRoyuRJzJ06wAicbeYV5MsbMlglBqAWiOtMtf88cFf6uMuOhuDlRViEBBqdDI9bhdKkdcjTOc1VtV2/3OVrFKu3z3yxpf6UOPbHo2U9bNSArd0hA+aMjeuDYsmRB2PQjgRy4U5y1FaJtlNosi0DYG66ipT5YRndZwejQ6ryGOKva0Eau5bj67LDv1JDVB+7j+8NRirERvLUN8hddt3XYJdqsWuKpo9wq0CFtd+qBGh9FIpUlBW44T7i3vzsa49k8vGDyndkH4pcN/RpQ8BdGgtTyih8vg== 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=xp+U+my3qlwSOZSeSdeDgHNqvwdS8c8oZ/Bbjd42ZIQ=; b=hWs24tblOdP4Cxoqds277lhf5nzeO4B9L78xt/WHBWnc/VmENDsRz0W7GoQD0c8X5vmntxFdBA3ThyQ8qQi2PFdfeNGqVTmO9ZdFVkNZACsvZSDFkczx8IhvzXY9QJLd4HTV2Az5s4L/rkBjvS7QO5YXtWEcKj/QIODWSFj92RQQBGhRZcnW1gzwuBigNc57tHKNAn+HoopijYrREXVzyfUGU3oI4o/Vohc1+T60Hn95SYYvadqtyAsJXWEQ0KFWP+GvGjndR+L9/TDEKGqLGV+iYsuSRT1w9e9jg9/bC3YdX0FveBtYuvq2pQIwA6NsP8f91J/z5juB9LfUU/Lqsg== 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=xp+U+my3qlwSOZSeSdeDgHNqvwdS8c8oZ/Bbjd42ZIQ=; b=YwFh1IqHixwg0yb2iOhpAxqrghzPwXGglwvgT7EvVKB+uxpYeoqU98qh+ssDVS+nLOA6KQbs5gAoQKywSX8gfUaRPLJeSosHQwIHPyPp4DO7ZGGfF3Qq2rixDSdgnUOiSdB8Pn3Bu009IQ9sw2+JMJOvztPQEGgiuWik7vFxADhczjrVjT9y7kngos3BPuXb7xt5ef/4rp1RAmF29SzIfNS0C432bk7GUxYCOEXnKSZ4Z8pGpAr1QjpcQtOkr1q1/GYEalRgDcYQ0HAt4gmicX/pxbP374USTNOfpPnd8yN1/sDL8XsF11RLYOJfZrQufhZ8u0c8s9SLHRZBvo8Bzg== Received: from PAXPR06MB7760.eurprd06.prod.outlook.com (2603:10a6:102:155::8) by AM5PR0602MB3314.eurprd06.prod.outlook.com (2603:10a6:206:7::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.24; Thu, 5 May 2022 10:33:21 +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.027; Thu, 5 May 2022 10:33:21 +0000 User-agent: mu4e 1.6.10; emacs 27.2 From: Ignacio Casso To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Subject: [BUG] org-complex-heading-regexp should consider COMMENT keywords [9.5.2 (release_9.5.2-25-gaf6f12 @ /home/ignacio/repos/emacs/lisp/org/)] In-Reply-To: PAXPR06MB7760098A2D438F2129D86615C6179@PAXPR06MB7760.eurprd06.prod.outlook.com Date: Thu, 05 May 2022 12:27:24 +0200 Message-ID: Content-Type: text/plain X-TMN: [ZoSsY7pLbNtON+BoEkmzBfvpDbI9kg6u] X-ClientProxiedBy: MR1P264CA0001.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501:2e::6) To PAXPR06MB7760.eurprd06.prod.outlook.com (2603:10a6:102:155::8) X-Microsoft-Original-Message-ID: <87wnf02rro.fsf@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0b448888-8557-40fe-04e9-08da2e82accd X-MS-TrafficTypeDiagnostic: AM5PR0602MB3314:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PzDOzPI/VvQ95xjMoVMau2zzPJxhU6PxN/tfSqkCeRQupX/oY5CevOFhFasfxlSyHk2JOHipqH8c8/CMJgLpODnOYrwtYxIsfoBVVc3alid0I3sHnXo2LI69XriH/uJNZpnsM9h40l0DWbR3Vy1bz8SkKx6hIeuFTtSq94bsEuUkN8pDZBV6JogDoLgZbDPeb7ztzIQcVumavdBDE2yuF+6pP+wet6PlXJJ7GTr3JptqQo3Vqhn2bpfKtKiO4GCedyp5yMq8HbG5Rn+5CRJ5DJK1owyh0FLmHGYs/8znL+TmfwqU5fuRTzOcLEEHJGWj9wmJmih7A9+gbqtNDYzX/ipa1c3ujulHRoohXwZYbpTy8OsqfLBKbRqRvitOFJ6sF6cTM1pbEeZJDlNiJQc/Z2XMqh+6r8SaAT/2XwuT54zmLjvjQO0SyJ/CBSyt56vSCV4Mk7S3lrqD0/RYI2278BcBfaup9Sir0bnauZL/fDHAhQvt28JJg3HTTejYMeDrH2Md7H6XAAVAB0Yi/xKoy+NUCbL/Wt+ti1vMQhXnZzJk8h9whDLKWqMO0xvGyVQFMKqJbpAbqvPKQ6u1nABR2QVK+1SSiaAHQ9Q2x3idUY1vaZVGnS+CpEI6rnnktSDo2p1Pkmu87EuB5jFuW2iduec+WnHj3wcZ3JiThkCc1D9AgPkvBG6tIJFzqk0HFEAIWWrz+OkvwgQw5lPGHKjPow== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?xoD5RzKGh3Ahaz2A69c7hmKwbRNLxSHZf8e3piph9mtKjTSR1HD9QK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KSyhDFrLwM/9neyIG5wspPDu2TYxXzfffjUG+WPA?= =?us-ascii?Q?R6n5V3i3OeKJBbrU0qRs18ssx7kABKX+C876rHthN+TmFTmJmqbbxhmZJfwq?= =?us-ascii?Q?Jv1Tct2xXvUOCPHbwGgqHsaglcZyWjAEOIyQq0PL6xvMyZRskqa41vBPcbfZ?= =?us-ascii?Q?NyRTV8kbmVxSbMYDSnlPMsq4Ht5Gdrkj+Tb2Gq3F9Zax4KVQxX43AnM5FAe5?= =?us-ascii?Q?TcX0yMCJ7EbMwBtm7Q7vVnp4H4PUGgDbPJKyJdp9wOO7CK5tdUgvQjA+VewO?= =?us-ascii?Q?u4Z5IzxYsoxGQ/UzJjYDKHmuQUIA3rBkablCkuy7Kz1knyTENA46AUIxQsOp?= =?us-ascii?Q?6jZOSPWpPLttu4q7/d919YJAaORbbgO+rzn6ZWiLO5rUUVOIqUg0QLRCei/S?= =?us-ascii?Q?Nk/f2N7LS9xKKargskZ35xoxx2V0lkqO31wuFGHjKJ3F6hUN2aE2uYmQenfD?= =?us-ascii?Q?glrk0GiRVxsNvUSFpj07NO2wytPBkS1pu9CZrUt0koexJw2xsUAf3fLlDmu9?= =?us-ascii?Q?287yEGktOt8=3D?= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-6e454.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 0b448888-8557-40fe-04e9-08da2e82accd X-MS-Exchange-CrossTenant-AuthSource: PAXPR06MB7760.eurprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2022 10:33:21.1401 (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: AM5PR0602MB3314 Received-SPF: pass client-ip=2a01:111:f400:7e1a::825; 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, 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=1651747922; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=xp+U+my3qlwSOZSeSdeDgHNqvwdS8c8oZ/Bbjd42ZIQ=; b=keQ1qBY6TDxwFc1Lpzeu0STqSpeYfFLRXwkVWTHIrDpPhZT2pUlQXzP6JhpbVF9ljaoZNM GLJikzwYIe8wRnfrT/mS8cprjRdXefPlHtWXNqH+fdirr4kBN69UMnGizMeaeDzNECu1Qs 9DwbrhTYaunpu58+R0l2joJ36prq8CxkPYJwGSm8JHk+eBHti0oqcfwFmr+sfrRJGUTTRM 6An6BdFVdXxC8XLEWp4uznOBZlwoP0YjmYznyapiBZ6PrX4FZsikoVQ8z+gnIfN9cioZRm r3C6x5arIXtuLu7eL8GVooYZJI3jHH8a7QjfczmvtcAYtcT/z81vG+uVlQ+ALw== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1651747922; a=rsa-sha256; cv=pass; b=pWuXsX2DJqwomvOalqKGtJBwT0VWraJgZRjI0e0sIGW1S5kQDnMZECJgc/v7zHDLuWvgDr bRnsqMlMT+UZ2o17gKfWcuM7E/NhyA9cy8d8dyYDYNi4SM/5k/0e6glJvLHo91fHh1MrD/ UmiuwfaVq6QUtTlOHmUady+FFWlhv71gHcm18M/wUAt6B1xaeP414ECiuKa2aT896xDrMc 6YDIbxQDJPYkTLkrpUzyhDMQcFaMWtJKHEQbSwKmPhff+kxqxix/sr52jrps6pnnLLApas rHKs3+SIgOgqbF3b8K0+u7FsicQ0ANXxr9LAxejBXK9amWLxwaB2rK1WKLIr7Q== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=hotmail.com header.s=selector1 header.b=YwFh1IqH; 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: -8.49 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=hotmail.com header.s=selector1 header.b=YwFh1IqH; 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: AFA69A6AA X-Spam-Score: -8.49 X-Migadu-Scanner: scn0.migadu.com X-TUID: +ZqoYS0S1UpU This topic was brought up again in https://lists.gnu.org/archive/html/emacs-orgmode/2022-05/msg00058.html, I continue the discussion here: >> 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. > >> 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. > > Note that org-complex-heading-regexp-format does consider statistics > cookies, but only at the beginning/end of the headline title. > Unfortunately, it is impossible to provide generic printf format to > match a headline title with arbitrary statistics cookies inserted in the > middle of it. > Could not something equivalent be done for COMMENT keywords and optionally match them at the beginning of the headline in `org-complex-heading-regexp-format'? Something like this: (setq org-complex-heading-regexp-format (concat "^\\(\\*+\\)" "\\(?: +" org-todo-regexp "\\)?" "\\(?: +\\(\\[#.\\]\\)\\)?" "\\(?: +" + ;; Headline might be commented + "\\(COMMENT \\)? ;; Stats cookies can be stuck to body. "\\(?:\\[[0-9%%/]+\\] *\\)*" "\\(%s\\)" "\\(?: *\\[[0-9%%/]+\\]\\)*" "\\)" "\\(?:[ \t]+\\(:[[:alnum:]_@#%%:]+:\\)\\)?" "[ \t]*$")) This would fix the problem I really cared about: being able to use a headline as capture target regardless of whether it is commented or not. Getting the headline text was never important to me, so I don't really care that much about `org-complex-heading-regexp'. > As for your other report, it is a hard one - org-complex-heading-regexp > is hard to modify because we guarantee certain match groups and its hard > to fit COMMENT in there without breaking backward-compatibility. > > I generally dislike the idea of the available plethora of analytic > regexps with numbered match groups. Do you mean that there is no way to specify an optional string in a regular expression without wrapping it in a parenthesized group, which would break the match group numbering backwards compatibility? I'm not that familiar with regular expressions, but if that's the case I completely agree with your last statement. --Ignacio