From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id 8B7cCskfAGVtBwAA9RJhRA:P1 (envelope-from ) for ; Tue, 12 Sep 2023 10:22:33 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 8B7cCskfAGVtBwAA9RJhRA (envelope-from ) for ; Tue, 12 Sep 2023 10:22:33 +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 B983B55802 for ; Tue, 12 Sep 2023 10:22:32 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=pwmhncMG; 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"; dmarc=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1694506953; a=rsa-sha256; cv=none; b=PjFo7jR2s4LidZgrj45GMsq2BwY9Bk2V893MtmbVIFVobz5Rv+BPL1wdESb9s/jiZXIzzW BxJOWBrTCgWSenPLS87Tl6dIrLzOVBPoDwQhlkmaYQ94DY2YOSwFjV0WZuSS/yP4ugT9l6 uz6XdDjUJP0MsLvjNjyifgoxS694nrkXhXPWLPMGseVYbU+7q4ewrEKgZ8NUxWWelz0DJT nQivNVLl6S08izyf4Vkyc6XZC2HrR00Wk8Zpf2MdJm8CFFOCy3uRyOdJnjDjoM3eq3qAHs EDMMmbR4Lz27UKz2n0tYWsCqt1cOrsNBxwGBaBqD1dRYOgBpHNxkobb4QQxByg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1694506953; 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=1OG+cy2Ey2khvqE57zfSaixfMxrbmVRQhmlDRO7wXhI=; b=JzOVzT/y3oiMkvoynDAMg5S4R8RO7g9LVH9DlRaMvLuuNwu0bJhWOTuwKcB+P+Kf+Ygvmj 2jbo1XD9J8F2fvpa7jno3h3chZH0P0VD9oWzaMRjH7wVkz3nmIzY1scsiC4L/MHDVh1XOL dtujMHb+pJzZjTcqXyaqF9ORuVL1TSGzfKV17T68pJ5e48BqMYw+JDM3+AUCH1/Q0o30Kq ZKaKG0y8QYclH7nt1wrFSUOlyWpPIGhOKbssbacECG1CiPjKURj5gPeqgZbY8jCz7jS0VW 9Ci3wN9hS6Hc37SfajJiVml+zh4uLQPn3aqLerFumar5ykzh03727eJTc+Id1A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=pwmhncMG; 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"; dmarc=pass (policy=none) header.from=posteo.net Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfyf8-0008NS-Ky; Tue, 12 Sep 2023 04:22:22 -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 1qfyf6-0008NK-Sd for emacs-orgmode@gnu.org; Tue, 12 Sep 2023 04:22:20 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfyf4-0005OO-5K for emacs-orgmode@gnu.org; Tue, 12 Sep 2023 04:22:20 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 9FA9B240107 for ; Tue, 12 Sep 2023 10:22:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1694506935; bh=1J4DuV4jNvwsWtrdD/1cXWDwpGwveDL+DtCejgPPZxk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=pwmhncMGR3l5lMORgT4nkm0rxvyFA2Wac4vWIhQZu+py1uRlhpkpt/8Gt9dEPGg2S m6Vhr0yoXPXQxmUPUrwXkoJBjzj8yKPMZll+dcQMXr0fNJBooq3cD6OMVjsDnoRm2x JMVqRe/dTsQ6KFduUL+ZAydlh4rYhTcENIAF9UVpUdSujkH/oKw/Aa1vazQ3L8rH99 RfJZ3gsc2ubmy1o5gUmakfNav/rKXm1T6ytxXX0YzBK80/PUw4d2tf+EkRV6dgAYt3 gAIcOA9uvlxkCfCwMv7VnLJ5dW7VgOMghNQWlj23lLjeS6Y6BRtdjlSm6kD5LH5BD6 H3QsXTpktQr0Q== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RlGlk1JRSz6txb; Tue, 12 Sep 2023 10:22:10 +0200 (CEST) From: Ihor Radchenko To: note meta Cc: emacs-orgmode@gnu.org Subject: [BUG] org-element-paragraph-separate is not accurate when detecting table.el tables (was: Some Issues I Encountered While Developing Metanote) In-Reply-To: References: Date: Tue, 12 Sep 2023 08:23:12 +0000 Message-ID: <87jzsviyvj.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.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-Migadu-Spam-Score: -7.42 X-Spam-Score: -7.42 X-Migadu-Queue-Id: B983B55802 X-Migadu-Scanner: mx2.migadu.com X-TUID: NhDV3CK2mFBE note meta writes: > 2. About Paragraph > > #+begin_example > +--+ > +--+ > +this is a paragraph+ > +this is a paragraph+ > #+end_example > > There should be only one paragraph above, but it's parsed as two: > > (org-data nil (section (:begin 1 :end 55 :contents-begin 1 :contents-end 55 > :post-blank 0 :post-affiliated 1 :parent #0) (paragraph (:begin 1 :end 6 > :contents-begin 1 :contents-end 6 :post-blank 0 :post-affiliated 1 :parent > #1)) (paragraph (:begin 6 :end 55 :contents-begin 6 :contents-end 55 > :post-blank 0 :post-affiliated 6 :parent #1)))) Confirmed. `org-element-paragraph-separate', which is used to determine paragraph boundaries incorrectly detects the above +--+ as table.el table boundary. It matches ^[ \t]*\+\(?:-+\+)+[ \t]*$ while the actual criteria to match table.el tables is much more complex: ;; There is no strict definition of a table.el ;; table. Try to prevent false positive while being ;; quick. (let ((rule-regexp (rx (zero-or-more (any " \t")) "+" (one-or-more (one-or-more "-") "+") (zero-or-more (any " \t")) eol)) (non-table.el-line (rx bol (zero-or-more (any " \t")) (or eol (not (any "+| \t"))))) (next (line-beginning-position 2))) ;; Start with a full rule. (and (looking-at-p rule-regexp) (< next limit) ;no room for a table.el table (save-excursion (end-of-line) (cond ;; Must end with a full rule. ((not (re-search-forward non-table.el-line limit 'move)) (if (bolp) (forward-line -1) (forward-line 0)) (looking-at-p rule-regexp)) ;; Ignore pseudo-tables with a single ;; rule. ((= next (line-beginning-position)) nil) ;; Must end with a full rule. (t (forward-line -1) (looking-at-p rule-regexp)))))) -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at