From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:203:b4db::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id yJxYHxKByGHJ3wAAgWs5BA (envelope-from ) for ; Sun, 26 Dec 2021 15:49:54 +0100 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 CKKYHBKByGFS0gAA9RJhRA (envelope-from ) for ; Sun, 26 Dec 2021 15:49:54 +0100 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 1308737CF6 for ; Sun, 26 Dec 2021 15:49:54 +0100 (CET) Received: from localhost ([::1]:46104 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n1UqP-0004fL-2X for larch@yhetil.org; Sun, 26 Dec 2021 09:49:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50838) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n1Uq0-0004fC-3m for emacs-orgmode@gnu.org; Sun, 26 Dec 2021 09:49:28 -0500 Received: from [2607:f8b0:4864:20::531] (port=35672 helo=mail-pg1-x531.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n1Upy-0002Dd-Fp for emacs-orgmode@gnu.org; Sun, 26 Dec 2021 09:49:27 -0500 Received: by mail-pg1-x531.google.com with SMTP id v25so11570203pge.2 for ; Sun, 26 Dec 2021 06:49:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=CvOjFZYN9uEhRzdE3J5tjcZeNuRUfd9WwkILSAEkPHQ=; b=BfvYEEsGWiY2Bqa0E7lEquqkxJraxG771tHbwEwSad9pzFCqXcJjS6gnVxqq67w5/T 5aua1F+EFAjeDS8+v82Z3e6ty2RmB+Wo006IFP6m2MapMiJDXoONiss3yGiGGBdWN+Xy CaqIHLqgGRKys7uRh5l0o3JtYDyFVFXeKBbl7bHNJYSuOKfxRQIV1cQuC0RYbopovFM2 evnjG8VvBMpF3iZJKcwgyH9zaKnVe4pkJZTAWlHO0EAbvRqKSKp2Pw+glnKIDOHoVv8G 2wlw8kbnFXaUenIm6v2nkMRU5VS6w8Mmqe3B7eQCbmcRf9xW1kBfr9/zMtlXKKGTTu4o YSFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=CvOjFZYN9uEhRzdE3J5tjcZeNuRUfd9WwkILSAEkPHQ=; b=LwCb8uAA03nevJlLw63ph+OMpuIep1iycJjWyYC9EbiHbhsTvhTueoGHGusnQTNLCx iGWABTyScxeVrYKFVwaB/p5pXIJdg9PK+QfFOZ6XAyYOzCrCvrMKHeHKWQdVcXDhQ74v jNJY3kGF8avrhVYsTpLfC8yF5frxmyj1k2YifJMX88jgtde08tJ9E1GL74s4gyyE/Y5Q Q4BHfYPTLdkc9K//X4BNcxNszlTUm70F8UB76Ua3yX5RrIkbNzb33qwVxdCHjqY/zbJh bFxCjR7M+0PuS82Md7yhBdVwI12UWQRwAO3OFsG1ZTWGD0jMdaK1j14ryYRgW2qpAkBK fzzg== X-Gm-Message-State: AOAM5328+JJsLlaaZhr8jaRfGa2JVSd2+K5dRv1lptvINyz6AANQKM+8 KxWijgQVFuBY0SqdSNbChK0= X-Google-Smtp-Source: ABdhPJyDF2HB462inHtkg+vWVKCINdMLAMTSdz7iM0HYL/rJjyEvOHboHOQOMu0BS5XlJFGY2l7Zcg== X-Received: by 2002:a63:7d1b:: with SMTP id y27mr7656555pgc.230.1640530164611; Sun, 26 Dec 2021 06:49:24 -0800 (PST) Received: from localhost ([210.3.160.226]) by smtp.gmail.com with ESMTPSA id k2sm12166731pgh.11.2021.12.26.06.49.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Dec 2021 06:49:24 -0800 (PST) From: Ihor Radchenko To: Robert Nikander , Nicolas Goaziou Subject: [PATCH] org-element--current-element: Fix #+BEGIN$ parsed as special block In-Reply-To: References: Date: Sun, 26 Dec 2021 22:50:47 +0800 Message-ID: <87bl13s9mg.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::531 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::531; envelope-from=yantar92@gmail.com; helo=mail-pg1-x531.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1640530194; 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=CvOjFZYN9uEhRzdE3J5tjcZeNuRUfd9WwkILSAEkPHQ=; b=FH6JqYOBq1XXQFiHEPQN6c2ZEKFCSeCEN8gA353t3jlaCMX3YdclKpz7a0vyod5kqSwfAr SwWhUq32q0k+cnRskBwXY2k4POg0CFmSxi4txyBOrcyMVa5L5gG4cxjcxyZH3qSbjSY//V mUL26DeAQ3xGu1RDuWzhAVhZT7ThfiKQYczEc54nofhet3iivLKn9E5UZHhppHXOE7qPlo sNc2kdhoQWGOIX65GCBWghzrpwo7WiphscnpCJAQJ6JwKzDSKGy4/Uibk7PV0RW3/as9r5 6RkBmswuY6djy0OVu8uT3Sho7Azx3MY1KzEfcYo3Ghq/OSVRq80o9YjqY+YQsA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1640530194; a=rsa-sha256; cv=none; b=BdgVgTKoj3d+LApAUYS6NY5NvI6/tSP5wCEee7FSN4XXNN+/O8fbO9IY0mjPOOmpVHdO6x fV86yxL74agDnbRg3d0yv2WsvlWDRXMw80shfQTDaU69nZdvFEXIMk07Fe5FleOo3fqTkV lqYVk8kYy7eA2EnU6ytj0Z2tekA/Muq2pXJbWd8SeTHRHzd9la8EzeJZkqkoGMp8541G+r OmT1klHxq8CZvk/cqriejLC5xEByvzWxBO0IAZibKrNl5YLgehbmJ7AcRa1nM0ReMOisQP 3gQki9vSTDlQx1PWoMe5qrWrjqsGArif4stFQzjipd2/p74H8Gbn0zA6QmTfiA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=BfvYEEsG; dmarc=pass (policy=none) header.from=gmail.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: -2.27 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=BfvYEEsG; dmarc=pass (policy=none) header.from=gmail.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: 1308737CF6 X-Spam-Score: -2.27 X-Migadu-Scanner: scn1.migadu.com X-TUID: 4NTA+rmYccil --=-=-= Content-Type: text/plain Robert Nikander writes: > Hitting TAB on the BEGIN line does nothing. But if I add a blank line before it, then hitting TAB hides and shows the block. Is that a bug? Or am I doing it wrong? Seems like it should work without the blank line. > > * Test > Some text > > #+BEGIN > Hide this > #+END > > M-x org-version => 9.5.1. This last case is actually a bug. As Tomas pointed, Org blocks have slightly different syntax: either #+begin_something or #+begin: typeofblock. The fact that you can fold the #+BEGIN..#+END in your second case should not happen. The fix is attached. Nicolas, Let me know if I miss something about special block parsing. Best, Ihor --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-org-element-current-element-Fix-BEGIN-parsed-as-spec.patch >From 289afdb9672eadaea119ebb2b0deecff4db3aa89 Mon Sep 17 00:00:00 2001 Message-Id: <289afdb9672eadaea119ebb2b0deecff4db3aa89.1640530104.git.yantar92@gmail.com> From: Ihor Radchenko Date: Sun, 26 Dec 2021 22:45:36 +0800 Subject: [PATCH] org-element--current-element: Fix #+BEGIN$ parsed as special block * lisp/org-element.el (org-element--current-element): Use `org-element-dynamic-block-open-re' to match blocks. Reported in https://list.orgmode.org/Ycay4s3iAdEGSwgt@tuxteam.de/T/#t --- lisp/org-element.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org-element.el b/lisp/org-element.el index eac39d429..ce251da38 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -4266,7 +4266,7 @@ (defun org-element--current-element (limit &optional granularity mode structure ((looking-at "CALL:") (beginning-of-line) (org-element-babel-call-parser limit affiliated)) - ((looking-at "BEGIN:? ") + ((looking-at org-element-dynamic-block-open-re) (beginning-of-line) (org-element-dynamic-block-parser limit affiliated)) ((looking-at "\\S-+:") -- 2.32.0 --=-=-=--