From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH 1/3] ob-table: Fix org-sbe's handling of quotes in arguments Date: Wed, 14 Mar 2018 16:00:07 +0100 Message-ID: <87fu52ln2g.fsf@nicolasgoaziou.fr> References: <20180307225847.24068-1-git@thecybershadow.net> <20180307225847.24068-2-git@thecybershadow.net> <87muzcans9.fsf@nicolasgoaziou.fr> <9107300b-c95d-ad16-ca03-088d173c90d9@gmail.com> <87605yn4x3.fsf@nicolasgoaziou.fr> <8258182a-5d7e-d8c9-96c2-1a76dd9e143c@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40461) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ew8nL-0003fB-C1 for emacs-orgmode@gnu.org; Wed, 14 Mar 2018 11:58:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ew8nI-0004ul-AE for emacs-orgmode@gnu.org; Wed, 14 Mar 2018 11:58:27 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:55571) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ew8nI-0004tv-3R for emacs-orgmode@gnu.org; Wed, 14 Mar 2018 11:58:24 -0400 In-Reply-To: <8258182a-5d7e-d8c9-96c2-1a76dd9e143c@gmail.com> (Vladimir Panteleev's message of "Wed, 14 Mar 2018 14:03:56 +0000") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Vladimir Panteleev Cc: emacs-orgmode@gnu.org, Vladimir Panteleev Vladimir Panteleev writes: > I wrote about this in the cover letter too. $"foo" and $ "foo" are > both the same thing. Just to make it clear: I read the cover letter. My confusion doesn't come from the fact I may not have read it. > In both cases, they are two distinct lisp tokens. > The way $ is presented as a string/reference "prefix" is through > convention only. > > Or are you objecting on stylistic grounds, that the test case from my > patch doesn't follow the convention of omitting whitespace after the > $ token, thus making it look like a prefix? This is, of course, > subjective, but I would prefer to not perpetuate the illusion that > $"foo" is some magical Emacs Lisp language syntax for a new kind of > string literal, at least in the test suite. I disagree. You are testing an implementation detail here: the fact that "$" is not necessarily a prefix. According to the docstring, it should be, so the test should use that, too. What if we rewrite `org-sbe' at some point? The same goes for the next string. $"foo", or in your case, $"a\"b\"c" means nothing in `org-sbe' context. A reference should follow the dollar character, per `org-sbe' docstring. I suggest to make an equivalent test with, e.g., $"@1$1", where @1$1 refers to a field containing "a\"b\"c" or some such. I suggest to stick to the specifications, which, in this case, are the docstring, not the code. > The references are substituted with string literals before the > $-prefix handling occurs. This is why it doesn't work with ranges. I understand it doesn't work with ranges, but, per above, your tests are confusing, IMO. > I agree that it is all very confusing, and there is a lot of room for > improvement. That doesn't stand in the way of this patch series, > though. I don't think anything stands in the way, but I'd rather get the tests right, first. > No difference. As can be seen from org-sbe's implementation, the > normalization of symbols and string literals occurs before attempting > to resolve references. Something is rotten in the state of "ob-table.el", may think.