From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id cP37MTkzMmabmAAA62LTzQ:P1 (envelope-from ) for ; Wed, 01 May 2024 14:19:06 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id cP37MTkzMmabmAAA62LTzQ (envelope-from ) for ; Wed, 01 May 2024 14:19:05 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=j0diWrMu; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1714565945; 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=ZyTLv2eCI9H61UdJegcawYul8t1xD3yjzG62TgKFxV4=; b=qQncJVWoQQXfbmzITT6nbOoISriXg1U96sVfl5kVLZq8eL+LCfJ5+j0jRVdtMB1xG5pUhq dz2n1pL9yTr3j5fEVJheBM+ESDRAoX7uQe2Sn8McsuaCNQgX1XC2o+QR+6+tkwXXMBe5JR uWBWYrTelixcR2X8ToL1lONvp1BiqpnOnlS2HZVwKYuTJcaBlLChUy+2NjjGvIBjpflQCS O7OWzS504x3tKxfUCpaqocFVsuyPZWVPmuSACkRfPTzcDGHSXwurOeU4xtZk2GGH3m4PmW d0kYdrhOTSaLFLSXYPfljkYduuwqsYov1xLDElOIEHaFtEigVYG9E7l5JXzJ6w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1714565945; a=rsa-sha256; cv=none; b=NODi1mzTIlt+oylhGbj/Wug5XselbZA1L7CG5TW6Wk0OsF2Iz7MfUnIJJloBjEyw1n9yA1 oTx/ZdU0bp+ksUaAcfZhyb4LGomzPL3E7llOD9rjupS3Bqns8BC1eDPgrq2HeSKUU9ftyC ZoDzc8LTdtKbkgy48JcXgfU3bMpYJx9WpsIFfyHhvhffauA55mTZa4imHKFLkR8jAGsprI x1hvTwdKBu2iyoX/jy/7KMvRGCMbBfgvC3wsdhCd5iuer1MTlV9KX0F0FBpDeTdIY34A9P aYY+eiFSysvSSSrf2KS1C2wHp/oY6sPRtEYonHxB4ZxA6X8MjjMfZDElFJ5Now== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=j0diWrMu; dmarc=pass (policy=none) header.from=posteo.net; 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" 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 913BB7AAB for ; Wed, 01 May 2024 14:19:05 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s28uw-0002jB-Ee; Wed, 01 May 2024 08:18:34 -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 1s28uv-0002j0-9P for emacs-orgmode@gnu.org; Wed, 01 May 2024 08:18:33 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s28us-0006Nc-7h for emacs-orgmode@gnu.org; Wed, 01 May 2024 08:18:33 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 17364240028 for ; Wed, 1 May 2024 14:18:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1714565907; bh=Vy6FrbSfWC0YwcNJmYwoqAL61P8WL5dspHDWPs7Mejg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=j0diWrMuzpFuYe1amowEG011PMG8j02SW2+KTDlFw2Yq5CF9w90XQC57lViIndwpl z6SCxo97GxbPYzJj05cGXrFZGcV4UgX5sZbStywUa/TENmSvl8cuH5m6+5YLuUUFtg xR8ExHJ0pi2+6nYJNzhFVQGgQwfigbnLtw2rN2B6EBL5wxJkUzu7s5Ldh/N+xt0spQ blx559bhNOYl9myOFnFWdpLqzeo0IuGsg/lWEBDeJwFM6ctWdNYkwigokJq6jDWAt3 uODQbiXhN567tZBOx6Jyilu2nWnxSbKkBNkpo/aM6ViPm5f/exivwoscMhsmBlmvTv UDI6vheKkZd3w== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4VTx1G2G4fz6tvl; Wed, 1 May 2024 14:18:26 +0200 (CEST) From: Ihor Radchenko To: Max Nikulin Cc: emacs-orgmode@gnu.org Subject: Importing "quoted" strings in `org-babel-import-elisp-from-file' (was: [BUG] ob-shell: results missing leading quotes) In-Reply-To: References: <18f24d87b62.d55e94e24743657.3252620114689708448@excalamus.com> <87il00crdm.fsf@localhost> Date: Wed, 01 May 2024 12:19:35 +0000 Message-ID: <87jzkdenc8.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.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_H3=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: -6.60 X-Spam-Score: -6.60 X-Migadu-Queue-Id: 913BB7AAB X-Migadu-Scanner: mx11.migadu.com X-TUID: suPJ9l+pVj2b Max Nikulin writes: > On 29/04/2024 18:58, Ihor Radchenko wrote: >> >> The nested "..." are stripped on purpose via `org-babel-string-read'. >> Although this function dates back to R output processing and I do not >> fully understand why stripping nested quotes is useful for all possible >> babel backends. But that's a completely different story. > > I would say heuristics is quite fragile > > #+begin_src elisp :results verbatim > (org-babel-string-read "\"1 2\" 3 \"4 5\"") > #+end_src > > #+RESULTS: > : "1 2\" 3 \"4 5" > > Leading and trailing quote characters are not stripped in the case of > > #+begin_src elisp :results verbatim > (org-babel-read "\"1 2\" 3 \"4 5\"" t) > #+end_src Let's zoom out a bit. `org-babel-string-read' is used exclusively by `org-babel-import-elisp-from-file' Its effect is making the following tables look same for Org babel: | 1 | 2 | | 1 | 2 | | "1" | "2" | | 1 | 2 | I cannot find justification - this behavior has been introduced in ob-R from the very beginning (over 15 years ago) and then ported to ob-core. IMHO, the current behavior is not correct. Moreover, it is unexpected. Consider #+begin_src C :results output table :includes printf("1 2\n\"1\" \"2\""); #+end_src #+RESULTS[30c03a8e3f8a71e03d7892e6817cb45713bec424]: | 1 | 2 | | 1 | 2 | Why are the quotes dropped? And replacing the call to org-babel-string-read with org-babel-read does not break any tests... -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at