From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: [PATCH] Make lexical eval default for elisp src blocks Date: Mon, 18 Apr 2016 13:56:07 -0400 Message-ID: References: <1460855140-36680-1-git-send-email-jkitchin@andrew.cmu.edu> <87inzeeuss.fsf@nicolasgoaziou.fr> <8760veerw2.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11469b983506a50530c61364 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45858) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1asDP7-0003lb-Oa for emacs-orgmode@gnu.org; Mon, 18 Apr 2016 13:56:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1asDP6-0007rl-G5 for emacs-orgmode@gnu.org; Mon, 18 Apr 2016 13:56:09 -0400 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]:37749) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1asDP6-0007rN-6Q for emacs-orgmode@gnu.org; Mon, 18 Apr 2016 13:56:08 -0400 Received: by mail-wm0-x22e.google.com with SMTP id n3so136402337wmn.0 for ; Mon, 18 Apr 2016 10:56:07 -0700 (PDT) In-Reply-To: <8760veerw2.fsf@nicolasgoaziou.fr> 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 , "emacs-orgmode@gnu.org" --001a11469b983506a50530c61364 Content-Type: text/plain; charset=UTF-8 thanks. I think I have addressed these in a new patch I just submitted. John ----------------------------------- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu On Mon, Apr 18, 2016 at 1:41 PM, Nicolas Goaziou wrote: > 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, > --001a11469b983506a50530c61364 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
thanks. I think I have addressed these in a new patch I ju= st submitted.

John
-----------------------------------
Professor John Kitchin=C2=A0
Doh= erty Hall A207F
Department of Chemical Engineering
Carnegie Mellon Un= iversity
Pittsburgh, PA 15213
412-268-7803

On Mon, Apr 18, 2016 at 1:41 PM, Nicolas Goa= ziou <mail@nicolasgoaziou.fr> wrote:
John Kitchin <jkitchin@andrew.cmu.edu> 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 fo= r
> lexical?

Two variables are needed: `org-babel-default-header-args:emacs-lisp&= #39; and
`org-babel-header-args:emacs-lisp'. The latter is used, e.g., in lintin= g
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.

>> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"(with-outp= ut-to-string %s)"
>> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"(progn %s)")=
>> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(org-babel-expand-body:emacs-l= isp
>> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 body params)))
>> > +
>> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(if (= listp lexical)
>> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0lexical
>> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0(string=3D "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"))?<= br>
Honestly, I don't remember how Babel handles parameters. It coul= d also
be '("yes" t) if the latter is recognized as a keyword. You g= et the
idea :)

Regards,

--001a11469b983506a50530c61364--