From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id HcC4M9TcqWD4KgEAgWs5BA (envelope-from ) for ; Sun, 23 May 2021 06:40:52 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id QDHdLtTcqWDdGgAA1q6Kng (envelope-from ) for ; Sun, 23 May 2021 04:40:52 +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 0B2E231E73 for ; Sun, 23 May 2021 06:40:52 +0200 (CEST) Received: from localhost ([::1]:44768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lkfv0-0001WS-Cv for larch@yhetil.org; Sun, 23 May 2021 00:40:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41684) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkfuS-0001VR-JE for emacs-orgmode@gnu.org; Sun, 23 May 2021 00:40:16 -0400 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]:40646) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lkfuQ-0004c2-Tw for emacs-orgmode@gnu.org; Sun, 23 May 2021 00:40:16 -0400 Received: by mail-lf1-x12e.google.com with SMTP id w33so27760373lfu.7 for ; Sat, 22 May 2021 21:40:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:in-reply-to:references:cc:date:message-id :mime-version; bh=oXsG6DO3PPliZGdfQI1MitWAnRDEm2qlYbMwSM899OQ=; b=phXrjldAHK5+8Vo6tVZMJPj9IUbAb4jvLq4VMOftDoBPwBURTM4khlWqhxXJH7uGai EMTeWCuCwWidv3zkF5KUpic28qNS5mVhz5JTcwnavHisxezyKg7cjl9Z9JgePjRKaXbE Kv5pcTkPcisi5wUlynO4/swODyVj3w612G9ZH/me6gmv1psJOF8jiEhxHjtXyJnM+CIq 1jGTsgMRy+4tQie20DUsDtQiSnWro4lm1mpV83BWq71ebg28Qk0PZMs37I3GxfWR5Ap7 vyFnmvKwKU7dmPql9U5nC+YEyaJTeN+WrKxxY5HeQcmk7MbC5n6Xi0KzTAbpjA91/iOR KFVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:cc:date :message-id:mime-version; bh=oXsG6DO3PPliZGdfQI1MitWAnRDEm2qlYbMwSM899OQ=; b=Df2kOYoAbGTIPULhvDWlcoLW4Nc5CKDdnfqk+xvjM0xBpxgFw4NR24z7cM/zJe3FhV ZcKNL6P8D7f0g4sX3pfmv7IOIGSNIRul4CJlSdcBXCWIcUHKd/ET29OYkBd+Kq3aTtKR IqSq7JbqmxQlU0JlSQ2rNfG+oOYC79CQy4O7ezkUvajZzMzqopgVfSX8kWkDCHYHv14W HX/V9xIq7gea+d61qwZipo+BCoqlqkna0Ru332dE1/FCkQIQrVkrE3Ax6U91UnCXmFcU n7fRl8zrzszbAM/KwAvQhKXjuGf+hp5L71uB0j1Ww57rgE6oEDZ2eiAFWECLVVDqBiUM wi9g== X-Gm-Message-State: AOAM532S5bfZiNj6voUFqccQ+vYxQALJQl0YxOl+Fx0ir5Qqnqo8TvF4 +K8LH9Be2BzVZnwCVtyTbWk= X-Google-Smtp-Source: ABdhPJyz8Yqv9uGFqdTwzSna7UIS5wnhhrAGAfhiyG0RyVpxXsHdYgo3JAZQISHPrNkybhXQHoVukw== X-Received: by 2002:ac2:4dba:: with SMTP id h26mr4347773lfe.182.1621744813209; Sat, 22 May 2021 21:40:13 -0700 (PDT) Received: from localhost ([91.210.107.197]) by smtp.gmail.com with ESMTPSA id x26sm1228440ljj.46.2021.05.22.21.40.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 May 2021 21:40:12 -0700 (PDT) From: Ihor Radchenko To: Nicolas Goaziou Subject: Re: Empty headline titles unsupported: Bug? In-Reply-To: <87fsyft0vv.fsf@nicolasgoaziou.fr> References: <87tumvdno3.fsf@gmail.com> <87fsyft0vv.fsf@nicolasgoaziou.fr> X-Woof-Patch: yes Date: Sun, 23 May 2021 12:45:02 +0800 Message-ID: <87zgwmt5wx.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::12e; envelope-from=yantar92@gmail.com; helo=mail-lf1-x12e.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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: , Cc: emacs-orgmode@gnu.org, Sebastian Miele 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=1621744852; 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=oXsG6DO3PPliZGdfQI1MitWAnRDEm2qlYbMwSM899OQ=; b=Ora5yArWENHjMurnJjebyLOFSVzrcGkbaJJUDNhxy1ZaIrOLRwKDAnuHjztl+H3ksUidvc 4pIKfPRZAd+1ufn629UoVYhKDry1O3V5j28xRZkBYLTqHmn4qmw2kz+7i9ZDPsGwjJuD3A 2y89BcsrEjRVywcf5j3SHFyNoBTxbBFOqz94udEfTS3kD4paBgjvP1AisBd9mDkqmUNnSZ WUt8KEF/r7tOC4bCTPewIMcxwJ0yUZIOKar1Xgfkntw/zB4qRPDfc+qdAcyK0IP6v6Uvml r66m3g2rybEeEXaXnka2/MWUMnT4VW4kn+wds/oCteyAqHmLmTQRVK4Qqb4SJA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1621744852; a=rsa-sha256; cv=none; b=jCz3qzqVc5ITnxQLr+mc5ImUKdZqvZzPAVVZ2iQild+Zjvw5bAOdPEsZMnVx0DwRufXkew E9LGgWiJ5INyi6dYCNJ3SIihvBSoDYWaYudsI51crul1x8UJ5hYVAccWksqncHjZoea2aW NPsnrQW3r/EGW6GYOH4RpcgIrvd+aHwXF1S2hsxr3asaO4tDtqQrvGaFkyuCkS2OHPrLmw dDa64ClvQfuxxP9VzKOj8eLUQS/AODu9nYyu9zuhy1UPCCbzaamK2yRMcsmfKC66K3+bnx 8xnbs3Yb0zjxQQ86C57bYD8I2vIaAQyskZNZEBHuckBXH0ieBn6zxpwVMqmyDg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=phXrjldA; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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-Spam-Score: 0.16 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=phXrjldA; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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: 0B2E231E73 X-Spam-Score: 0.16 X-Migadu-Scanner: scn0.migadu.com X-TUID: pWfL/ge/2cww --=-=-= Content-Type: text/plain Nicolas Goaziou writes: > Empty headline titles are supported, and "org-syntax.org" makes it > clear. > > However, empty headline + tags is ambiguous. The right solution is to > disambiguate it by inserting "something" as the headline you want to > tag, like a non-breaking space. Yet, why not simply alter the headline parser a little bit to support empty titles + tag? Such headlines are used in some of the tests. See the attached patch. Best, Ihor --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Parse-titeless-headlines-with-a-tag-correctly.patch >From a65e39125b732f6e091dbabdd63bb46c2463cc99 Mon Sep 17 00:00:00 2001 Message-Id: From: Ihor Radchenko Date: Sun, 23 May 2021 12:41:35 +0800 Subject: [PATCH] Parse titeless headlines with a tag correctly * lisp/org-element.el (org-element-headline-parser): Do not treat tag as headline title in headlines like "* :tag:". --- lisp/org-element.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/org-element.el b/lisp/org-element.el index ba4f0ead6..36b8f5847 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -1001,7 +1001,10 @@ (defun org-element-headline-parser (limit &optional raw-secondary-p) (commentedp (and (let (case-fold-search) (looking-at org-comment-string)) (goto-char (match-end 0)))) - (title-start (point)) + (title-start (prog1 (point) + (unless (or todo priority commentedp) + ;; Headline like "* :tag:" + (skip-syntax-backward " \t")))) (tags (when (re-search-forward "[ \t]+\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$" (line-end-position) -- 2.26.3 --=-=-=--