From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id YNt8Cw0K6mW6ZQEAe85BDQ:P1 (envelope-from ) for ; Thu, 07 Mar 2024 19:40:13 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id YNt8Cw0K6mW6ZQEAe85BDQ (envelope-from ) for ; Thu, 07 Mar 2024 19:40:13 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=brtZaYNN; 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=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1709836813; 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=iasxQhp1ezZB57fUVWoyZoDt/D4x/+EhmT60vRQb2JU=; b=XNOA043WMteDL1HzZh6Eef2srAn7CLR1ysQHaAXdFHIwW07TC5eHhpb59NMEUOUGYSNmIZ rz/QW6QYRpWSYArkc2cM/D5ScVaU2ZQadKVUro0nHPfEJWFgs/ydbD00E8muq1l0+Jw00I miWWNi7FxNRWISj3itCnSXhEoNsjPUzrmhHt2ufYkDcz1+iLtyavAM5j/DYhnSNbKqbj/E EhfYN+fDZ/4piKdqLmYWTQEsYJ1qqTVOTyOzs2FGYa41C++1Qkj7S7heOH/j3MeO8jVM6f tuA4ukRm3HXt60FdF4k9wPZOXWNKrMu6vd2Rnf8aWNLqGXMdBmyCEWkZJ6D7Kw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=brtZaYNN; 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=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1709836813; a=rsa-sha256; cv=none; b=NvbwwXVNVQqEFuirb0KHxCrjyTrQa49qNL7GiYynSzeozQBvi5RECqgIVqXWyaf3gNL4sb h2pOFfFclLNmRSTff+SJrW4WRd8nSjLavhky7YorLUrHPvmuMRsPf9n8z5A06ckMtvUdyL 2pjKcL4pK1Eiy9yrPBA1bdEhbLyTVW7Rhey5nfDsY2p8fvJNDFHOiRKROtkW0hInAWDrjw SUeROKt5BmXdA5Ltlr1hkZzjfVBMf2E01U1XyYifhlc7Ft1tOYuiFXJNLqVZ0zgdxPmpCd c3BauBz1HLCjeHJhb7Q8vnA1D4eY0nb5MATJa09LW4KerBA10FBJV6yLUP1Vew== 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 DB5675146D for ; Thu, 7 Mar 2024 19:40:12 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1riIeR-0006MW-FZ; Thu, 07 Mar 2024 13:39:31 -0500 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 1riIeQ-0006MM-Aa for emacs-orgmode@gnu.org; Thu, 07 Mar 2024 13:39:30 -0500 Received: from mail-qv1-xf2f.google.com ([2607:f8b0:4864:20::f2f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1riIeO-0003h9-H9 for emacs-orgmode@gnu.org; Thu, 07 Mar 2024 13:39:29 -0500 Received: by mail-qv1-xf2f.google.com with SMTP id 6a1803df08f44-690a9648c39so5626766d6.1 for ; Thu, 07 Mar 2024 10:39:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709836767; x=1710441567; darn=gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=iasxQhp1ezZB57fUVWoyZoDt/D4x/+EhmT60vRQb2JU=; b=brtZaYNNIBXFEACVrzyJREl+S7YPY0bTpLL05FyLBmRpAT9ahZfNbkaLFHiVNmDg9E Q58u9iNXYSnsCSgYxSPp8Fb4WF/eQGo4tE6Ch/ERBgsMzU7KibIcc2EL/iFXuoAb+0OY GL/ey+wQfO9IL/ssCiiFiDjAsFdzpM7fMYBcqydODBhNPe4KUflr07O1JSAYblZ8Ku5s IAVFt3D62UoRWuMQNJA1rpBjN3b36sCUN1ikk+tSWY5J+c3eoKU5TpxArAf3P06fBiRP BMfVg74qmtLzoTVDx75UDj3VtWJLmzI98mbV5H6OQpyvPq4vElNhaJ1YIeTJXnbhUAm8 42TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709836767; x=1710441567; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=iasxQhp1ezZB57fUVWoyZoDt/D4x/+EhmT60vRQb2JU=; b=TlJTqtR8TYXKsa0D0f41LiD26T692VFTqOB51qSTHjTNSdvkEO8BM0FUaxUpiJPf6I FLBYTtdSdA/wb315ehvu1Bvp8WiZHNLFZxfdZrbIxM30HXd2GooFtD1T2T/3zH/OIL74 UqKr1X1IbuFiAr+owUMMCl4IXaUIEj26CHiKcwY8DHHyVjgqpVnJ+6VZjDFXi1sHZfFY b3GszEssG8jimlHjZiE6Z+Bo4l5oNtvkv5PNfU7vTxQrQ0rkXXTqSn5oE4GYmIkg8Mwv l8PrStnWzVBfu4EkVF5h5cNb2hBPrEysdMDCnsknRIIMsHKcJWmF7lVk39jLq/4HGk1f VmRQ== X-Gm-Message-State: AOJu0YzxAax4sAGF6PSxHnBCAUoS+VZ3S0O62doUxRpt+RIII1CBWiNw 3n1dvhsPBnuTuENOnqxCtnyadrgLCxLvukxgY0/Gac7qZGb5yWUwGpk251kiKmlgbchbyIVt7ix rTp4mX/UH9rRhtO7TxIIhD78VHYQ= X-Google-Smtp-Source: AGHT+IFUG8IoMKrHmILaLGFMrXfn+Nhw3GE95J88i4i9Zo11NYx7+Ls328kbx7oVMPGoKAd/n7YwifNUOob4oew1g5s= X-Received: by 2002:ad4:4dcf:0:b0:690:ab19:c931 with SMTP id cw15-20020ad44dcf000000b00690ab19c931mr2276410qvb.20.1709836767088; Thu, 07 Mar 2024 10:39:27 -0800 (PST) MIME-Version: 1.0 References: <87wmqexjoj.fsf@localhost> In-Reply-To: <87wmqexjoj.fsf@localhost> From: Paul Stansell Date: Thu, 7 Mar 2024 18:38:50 +0000 Message-ID: Subject: Re: [BUG] With R using ":var d=data" breaks ":colnames yes" [9.7-pre (release_9.6.10-881-g595a32] To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Content-Type: multipart/alternative; boundary="000000000000205809061316653e" Received-SPF: pass client-ip=2607:f8b0:4864:20::f2f; envelope-from=paulstansell@gmail.com; helo=mail-qv1-xf2f.google.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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -8.17 X-Spam-Score: -8.17 X-Migadu-Queue-Id: DB5675146D X-Migadu-Scanner: mx13.migadu.com X-TUID: eTTntIm3g/Jm --000000000000205809061316653e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Ihor, Thanks for your advice, it helps a lot. Sorry for submitting something that wasn't a bug. Paul On Thu, 7 Mar 2024 at 13:16, Ihor Radchenko wrote: > Paul Stansell writes: > > > It seems that using ":var d=3Ddata" breaks ":colnames yes" in the heade= r of > > an R code block. > > ... > > #+name: data > > |--------+--------| > > | x | y | > > |--------+--------| > > | 111.89 | 88.37 | > > | 392.12 | 297.33 | > > |--------+--------| > > It is expected. > :colnames yes implies: > > The =E2=80=98colnames=E2=80=99 header argument accepts =E2=80=98yes= =E2=80=99, =E2=80=98no=E2=80=99, or =E2=80=98nil=E2=80=99 > values. The default value is =E2=80=98nil=E2=80=99: if an input tab= le has column > names--because the second row is a horizontal rule--then Org > removes the column names, processes the table, puts back the column > names, and then writes the table to the results block. Using > =E2=80=98yes=E2=80=99, Org does the same to the first row, even if t= he initial > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > table does not contain any horizontal rule. When set to =E2=80=98no= =E2=80=99, Org > does not pre-process column names at all. > > In your table, the first row is a horizontal line, so Org tries to parse > the first line as column names. And fails, of course. > > I guess that we can make `org-babel-get-colnames' smarter and make it > skip the leading hlines. > > -- > Ihor Radchenko // yantar92, > Org mode contributor, > Learn more about Org mode at . > Support Org development at , > or support my work at > --000000000000205809061316653e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Ihor,

Thanks for your advice, it hel= ps a lot.=C2=A0 Sorry for submitting something=C2=A0that wasn't a bug.<= /div>

Paul

On Thu, 7 Mar 2024 at 13:16, Ihor Radche= nko <yantar92@posteo.net> = wrote:
Paul Stan= sell <paulst= ansell@gmail.com> writes:

> It seems that using ":var d=3Ddata" breaks ":colnames y= es" in the header of
> an R code block.
> ...
> #+name: data
> |--------+--------|
> |=C2=A0 =C2=A0 =C2=A0 x |=C2=A0 =C2=A0 =C2=A0 y |
> |--------+--------|
> | 111.89 |=C2=A0 88.37 |
> | 392.12 | 297.33 |
> |--------+--------|

It is expected.
:colnames yes implies:

=C2=A0 =C2=A0 =C2=A0The =E2=80=98colnames=E2=80=99 header argument accepts = =E2=80=98yes=E2=80=99, =E2=80=98no=E2=80=99, or =E2=80=98nil=E2=80=99
=C2=A0 =C2=A0 =C2=A0values.=C2=A0 The default value is =E2=80=98nil=E2=80= =99: if an input table has column
=C2=A0 =C2=A0 =C2=A0names--because the second row is a horizontal rule--the= n Org
=C2=A0 =C2=A0 =C2=A0removes the column names, processes the table, puts bac= k the column
=C2=A0 =C2=A0 =C2=A0names, and then writes the table to the results block.= =C2=A0 Using
=C2=A0 =C2=A0 =C2=A0=E2=80=98yes=E2=80=99, Org does the same to the first r= ow, even if the initial
=C2=A0 =C2=A0 =C2=A0^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
=C2=A0 =C2=A0 =C2=A0table does not contain any horizontal rule.=C2=A0 When = set to =E2=80=98no=E2=80=99, Org
=C2=A0 =C2=A0 =C2=A0does not pre-process column names at all.

In your table, the first row is a horizontal line, so Org tries to parse the first line as column names. And fails, of course.

I guess that we can make `org-babel-get-colnames' smarter and make it skip the leading hlines.

--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,=
or support my work at <https://liberapay.com/yantar92>
--000000000000205809061316653e--