From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id oK8HK7Q/HWA/VQAA0tVLHw (envelope-from ) for ; Fri, 05 Feb 2021 12:53:08 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id sLvlJrQ/HWC8CwAA1q6Kng (envelope-from ) for ; Fri, 05 Feb 2021 12:53:08 +0000 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 295929403CA for ; Fri, 5 Feb 2021 12:53:08 +0000 (UTC) Received: from localhost ([::1]:60674 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l80bh-0000tZ-Mo for larch@yhetil.org; Fri, 05 Feb 2021 07:53:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48226) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l80aY-0000sv-IN for emacs-orgmode@gnu.org; Fri, 05 Feb 2021 07:51:54 -0500 Received: from tempel.uberspace.de ([185.26.156.63]:33840) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l80aU-0002pa-Ns for emacs-orgmode@gnu.org; Fri, 05 Feb 2021 07:51:54 -0500 Received: (qmail 26006 invoked from network); 5 Feb 2021 12:51:40 -0000 Received: from localhost (HELO localhost) (127.0.0.1) by tempel.uberspace.de with SMTP; 5 Feb 2021 12:51:40 -0000 User-agent: mu4e 1.5.5; emacs 28.0.50 From: Christine =?utf-8?Q?K=C3=B6hn?= To: emacs-orgmode@gnu.org Subject: Bug: Double quotes in tables and arguments Date: Fri, 05 Feb 2021 13:51:38 +0100 Message-ID: <87r1lu7k4l.fsf@chark.eu> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.26.156.63; envelope-from=christine@chark.eu; helo=tempel.uberspace.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, 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.23 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" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.35 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 295929403CA X-Spam-Score: -2.35 X-Migadu-Scanner: scn1.migadu.com X-TUID: qBoTchwXdb3s --=-=-= Content-Type: text/plain Hi, I'm working with tokenized texts in org-mode tables including single characters such as double quotes. When trying to read a cell with an (unpaired) double quote at the beginning, the cell cannot be read ("End of file during parsing"). I've looked a bit into this (see attached file). At first, I thought it's a mere documentation issue: Double quotes probably have a special meaning. The documentation of org-bable-read (ob-core.el) does not mention a double quote as special character: > "Convert the string value of CELL to a number if appropriate. > Otherwise if CELL looks like lisp (meaning it starts with a > \"(\", \"\\='\", \"\\=`\" or a \"[\") then read and evaluate it as > lisp, otherwise return it unmodified as a string. Optional > argument INHIBIT-LISP-EVAL inhibits lisp evaluation for > situations in which is it not appropriate." This is how cells with double quotes at the beginning are read: > ((eq (string-to-char cell) ?\") (read cell)) I don't know why double quotes are handled as special characters and I did not find any documentation on it. This issue also exists when caching results from code blocks: If a result starts with an (unpaired) double quote and it is cached, it cannot be read anymore. Best, Christine --=-=-= Content-Type: text/x-org Content-Disposition: attachment; filename=quote_mwe.org #+NAME: print #+begin_src emacs-lisp :var data="" (print data) #+end_src Double quotes are preserved as long as there is no double quote as first character: #+NAME: ex1 | a" | Sourrounding double quotes are stripped: #+NAME: ex2 | "a" | #+CALL: print(data=ex2) #+RESULTS: | a | This is unexpected: #+NAME: ex2b | "this_stays"this_has_to_go | #+CALL: print(data=ex2b) #+RESULTS: | this_stays | (Unpaired) double quote at beginning results in "End of file during parsing": #+NAME: ex3 | " | #+CALL: print(data=ex3) Passing an argument with (unpaired) double quote as first character to code blocks works... #+NAME: ex-code1 #+begin_src emacs-lisp '("\"") #+end_src #+CALL: print(data=ex-code1) #+RESULTS: | " | ... as long as it's not from a cached result. #+NAME: ex-code3 #+begin_src emacs-lisp :cache yes '("\"") #+end_src #+RESULTS[f8bc0a680e2f0b8e579b262a13747cef1522cd72]: ex-code3 | " | This results in "End of file during parsing": #+CALL: print(data=ex-code3) --=-=-=--