From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id kJs8M4cCDGZCLQEAe85BDQ:P1 (envelope-from ) for ; Tue, 02 Apr 2024 15:05:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id kJs8M4cCDGZCLQEAe85BDQ (envelope-from ) for ; Tue, 02 Apr 2024 15:05:11 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=DN5bBoFc; 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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1712063111; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-to:resent-from:resent-message-id: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=3UOhENj8cPboLa1jIbwYT7e0wWEdUnHGRBH9PbEa7sk=; b=QHxJ+6OzNtGVtPXD12kLMKcYlZwrlFKDcgPPyctJEtIm5RwnGVhv1TB9YROnTazL3vtOsx m43muD2QVVR2JkOjXQrNReD6l8+c255Is7L0IIc5yG3BmIT7aPepCbLJ+0InaTAy6kHGoN 8lfKGKXWO368O6zo8IrUXu+k24ulKM+P+4vAu8w4e1jxbTcJ2gPxptfkTkru09Ys0XqaDa ex6ZyNH0fVIfLNsHgYBx+zCFWagNNsmUVFq0vaQjKHLLevcjAlo1BrzvVdV7cGOhfgxZoO YK2BK8F4I/nI3Jy/6bF7eNBQo6csPITFoyNbRz6ZP+q83QrtiklbUmrnC6yRJw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=DN5bBoFc; 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=1712063111; a=rsa-sha256; cv=none; b=oqvod8M6np42GhnXvlLW8t3Lgx5vLZEk9K+ahcCc4niLR7/KOnUFbG7hSnT0V6Ut04I/8E MHXIWQEguTDejnfASibXlqTVjlCkK3p8n+yqzrN9jDbR/BzYvxyYIwcsqv6LZ7hF7duf5x matdxRXO5lASadJJm2gse3UFq8GC+8yFRq4YIDAiMvggoVFYcuZM3nFnhz72JcyP03qhsf 5vaO+q0K8Kaa2O6zHnH951oaldrsvJrd4836TTqskJBTd2NPp9j0P9LtJlmMt3QC8E9sUE E1yywI1BtB0plSTGDu7ddH4tGIGxETrHGrz+vL1FhTicIuKKsYWGo5oTxKdo1w== 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 5F6936A6D4 for ; Tue, 2 Apr 2024 15:05:11 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rrdoI-000750-6k; Tue, 02 Apr 2024 09:04:18 -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 1rrdoE-0006u2-GA for emacs-orgmode@gnu.org; Tue, 02 Apr 2024 09:04:14 -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 1rrdoA-0003zz-Dp for emacs-orgmode@gnu.org; Tue, 02 Apr 2024 09:04:12 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 7DF12240101 for ; Tue, 2 Apr 2024 15:04:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1712063048; bh=IWCP9RssITS7fH39E+FEFYo+zUtz8CwApsjDkVyhLao=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=DN5bBoFcWJ4zOGEBd6jpgPnvZpTU+jiB8KrwRbZ3m/n4c/FQ1WfFsJvdx9OUqm4Tg UL3dTrO8CwrAISunys33cUVZvZ1FywGpOXw4AC22in9GbeUg+7dIB9UjEMkMdLGw+o 3GWU1Xl75sEmGRJ8hQ3qBRA9vU1BNb8b3EhfSmRenBypzMe38BhgQiNYHfUYA/amEW jrj2CmmetyJC1jKgulblH75x/tjpAGrIQNbFVrhbVF02jjOv/bR3z5kIGkCYDCbUJQ 4LCj0uEqDYzUaTjmCJKKBisTG0CHRqNpqFaxuY9RYDfeObp7N0UPgcSmLn0AIAiP8z t/t9NK9YYxVaQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4V87PN0Bl2z6twx for ; Tue, 2 Apr 2024 15:04:07 +0200 (CEST) Resent-To: emacs-orgmode@gnu.org Resent-From: Ihor Radchenko Resent-Date: Tue, 02 Apr 2024 16:04:23 +0300 Resent-Message-ID: <87bk6rud9k.fsf@localhost> From: Ihor Radchenko To: Jeff Trull Subject: Re: [BUG] org-export-table-row-number off by one when special row present [9.6.23 ( @ /home/jet/.config/emacs/elpa/org-9.6.23/)] In-Reply-To: References: <87sf058iuz.fsf@localhost> Date: Tue, 02 Apr 2024 12:51:40 +0000 Message-ID: <87h6gkszab.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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_H4=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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: 5F6936A6D4 X-Spam-Score: -9.55 X-Migadu-Spam-Score: -9.55 X-Migadu-Scanner: mx10.migadu.com X-TUID: PuP0vH9S59v4 --=-=-= Content-Type: text/plain Jeff Trull writes: >> During export, table may be not the same as it appears in the original >> document - some rows may be omitted. `org-export-table-row-number' >> returns the coordinates in as-exported table, not in the original table. >> > > Agreed. I believe this behavior contradicts its documentation string: > > "... Return value is zero-indexed and ignores separators. The function > returns nil > for special rows and separators." > > The language is different for what rows are ignored ("separators") and for > what cells it will > return nil ("special rows and separators"). This is consistent with the > user-facing addresses, > which do not consider separator rows, but do consider column alignment rows. What about the attached patch? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-lisp-ox.el-org-export-table-row-number-Clarify-docst.patch >From 6457e6e3a9c112b9a1bc3a549a93f3cd6a64b2c3 Mon Sep 17 00:00:00 2001 Message-ID: <6457e6e3a9c112b9a1bc3a549a93f3cd6a64b2c3.1712062152.git.yantar92@posteo.net> From: Ihor Radchenko Date: Tue, 2 Apr 2024 15:49:01 +0300 Subject: [PATCH] lisp/ox.el (org-export-table-row-number): Clarify docstring --- lisp/ox.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/ox.el b/lisp/ox.el index c794c570f..8c7e092e3 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -5432,7 +5432,8 @@ (defun org-export-table-row-number (table-row info) "Return TABLE-ROW number. INFO is a plist used as a communication channel. Return value is zero-indexed and ignores separators. The function returns nil -for special rows and separators." +for separators and table rows that are marked to be ignored according +to the INFO plist." (when (eq (org-element-property :type table-row) 'standard) (let* ((cache (or (plist-get info :table-row-number-cache) (let ((table (make-hash-table :test #'eq))) -- 2.44.0 --=-=-= Content-Type: text/plain > In this case, it's not specific to any exporter. org-export--skip-p returns > true for column alignment rows with the following code: > > (table-cell > (and (org-export-table-has-special-column-p > (org-export-get-parent-table datum)) > (org-export-first-sibling-p datum options))) This part of the code is not for alignment rows, it is for special columns. > So these rows will be in the ignore-list for all exporters. This is no longer true on main. > ... And that's reasonable - when ignore-list is being used for > deciding what to export. The problem, as I see it, is that > org-export-table-row-number does not consider this when determining > the "address" of a cell. ?? `org-export-table-row-number' considers the ignore list because `org-element-map' considers it. > So, there is no bug here. >> > > I disagree :) and suggest the following change to org-export-row-number > (line 5390): > > info)) > > should become: > > (org-plist-delete info 'ignore-list))) > > which will make it consistent with its docstring and with user-facing > addresses. The docstring should be fixed, not the function behaviour. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--