From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vladimir Alexiev Subject: Re: org-babel-read should have option NOT to interpret as elisp Date: Mon, 28 Feb 2011 00:30:38 +0000 (UTC) Message-ID: References: <877hclbgxz.fsf@gmail.com> <87hbbpyrde.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=53627 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ptr0l-0004lT-TT for emacs-orgmode@gnu.org; Sun, 27 Feb 2011 19:30:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ptr0l-0000nj-3F for emacs-orgmode@gnu.org; Sun, 27 Feb 2011 19:30:51 -0500 Received: from lo.gmane.org ([80.91.229.12]:56032) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ptr0k-0000nZ-MN for emacs-orgmode@gnu.org; Sun, 27 Feb 2011 19:30:51 -0500 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Ptr0i-0000UD-QH for emacs-orgmode@gnu.org; Mon, 28 Feb 2011 01:30:48 +0100 Received: from 85.239.150.142 ([85.239.150.142]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 28 Feb 2011 01:30:48 +0100 Received: from vladimir by 85.239.150.142 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 28 Feb 2011 01:30:48 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org > What syntax would you suggest to indicate that a variable is to be > passed without the possibility of elisp evaluation I think this should be done with a header arg, since they have very flexible setup scheme: see (info "(org)Using header arguments") "values of header arguments can be set in six different ways" - Ideally, the arg should be attached to #+tblname: since it's a characteristic of the table itself - If attached to #+begin_src: then it will be dissociated from the table, and all :var's of that line will be forced to use the same arg. - But that's good enough since it can be set in various ways. For me most useful: -- org-babel-default-header-args: global -- #+BABEL: per file The header arg should be called :read-as (or :var-read). Considerations: - should be quite distinct so it can be used as a property name - should use dash so it's analogous to no-expand Its values should be: - literal: If a value looks like a number, it's read as a number. Else it's read as a literal string. - elisp or nil (default): If a value starts with one of ('` it's read as emacs lisp. Else it's read as 'literal'. - quoted: If a value starts with " then it's read as a quoted string: start and end quotes are stripped, and \" escaped quotes are unescaped (this is useful for embedding leading/trailing whitespace in strings). Else it's read as `literal'. - quoted_elisp: combination of `quoted' and `elisp' (I assume that using multiple values per arg is not supported) This above is about data coming from tables, since I haven't used the other two options (literal value and code block). The chosen solution should work for those too. Please note that org-babel-read says "This is taken almost directly from `org-read-prop'." so the chosen solution should be compatible with that. But I can't find such function.