From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH] Make lexical eval default for elisp src blocks Date: Mon, 18 Apr 2016 19:41:33 +0200 Message-ID: <8760veerw2.fsf@nicolasgoaziou.fr> References: <1460855140-36680-1-git-send-email-jkitchin@andrew.cmu.edu> <87inzeeuss.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39160) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1asD8w-00052h-Ev for emacs-orgmode@gnu.org; Mon, 18 Apr 2016 13:39:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1asD8v-0003XV-FT for emacs-orgmode@gnu.org; Mon, 18 Apr 2016 13:39:26 -0400 Received: from relay3-d.mail.gandi.net ([2001:4b98:c:538::195]:38093) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1asD8v-0003WF-9p for emacs-orgmode@gnu.org; Mon, 18 Apr 2016 13:39:25 -0400 In-Reply-To: (John Kitchin's message of "Mon, 18 Apr 2016 13:09:41 -0400") 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: John Kitchin Cc: "emacs-orgmode@gnu.org" John Kitchin writes: > I just put it in because it is an option for the eval function, and it was > not difficult to implement. It might be useful for debugging. Fair enough. > Are you suggesting use defconst instead of defvar? Does it really need all > the things in org-babel-header-args:R? Or just the required default for > lexical? Two variables are needed: `org-babel-default-header-args:emacs-lisp' and `org-babel-header-args:emacs-lisp'. The latter is used, e.g., in linting to know what keywords are allowed in an emacs-lisp block and, if possible, the possible values for it. > no problem. Should all the assocs be replaced by assq, or just these > ones? I usually replace (assoc/member KEYWORD ...) with (assq/memq KEYWORD ...) whenever I modify a S-exp around it. You don't need to change this for parts you don't alter. >> > + "(with-output-to-string %s)" >> > + "(progn %s)") >> > + (org-babel-expand-body:emacs-lisp >> > + body params))) >> > + >> > + (if (listp lexical) >> > + lexical >> > + (string= "yes" lexical))))) >> >> There is no support for t. I think we should allow both :lexical >> t and :lexical yes. >> > > something like (member lexical '("yes" "t"))? Honestly, I don't remember how Babel handles parameters. It could also be '("yes" t) if the latter is recognized as a keyword. You get the idea :) Regards,