From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lawrence Bottorff Subject: Library of Babel confusion Date: Tue, 3 Apr 2018 16:31:57 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000178c0b0568f7998c" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53223) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3Sb2-0002Xk-CT for emacs-orgmode@gnu.org; Tue, 03 Apr 2018 16:32:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3Sb1-0006BE-BA for emacs-orgmode@gnu.org; Tue, 03 Apr 2018 16:32:00 -0400 Received: from mail-ot0-x22a.google.com ([2607:f8b0:4003:c0f::22a]:36298) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f3Sb1-0006AF-5N for emacs-orgmode@gnu.org; Tue, 03 Apr 2018 16:31:59 -0400 Received: by mail-ot0-x22a.google.com with SMTP id n40-v6so20885518otd.3 for ; Tue, 03 Apr 2018 13:31:59 -0700 (PDT) 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: emacs-orgmode Mailinglist --000000000000178c0b0568f7998c Content-Type: text/plain; charset="UTF-8" I've been trying to grok LOB again. So I've cloned the worg git and library-of-babel.el is one of the files. org-babel-lob-injest didn't work, so I customized org-babel-lob-files and inserted .../worg/library-of-babel.el . . . and it did in fact get added to my init.el under the custom-set-variables: '(org-babel-lob-files (quote ("~/org/worg/library-of-babel.org"))) I checked org-babel-library-of-babel variable, and the new things seemed to be there, although it's rather mind-bending to know I will be calling LOB code that is internally stored inside of an association list. Now, in my org file I put this: #+lob: write(file="jsontest") and try C-c C-c on it. Nothing. My minibuffer says "local setup has been refreshed". How does one use, call a LOB function? Also, while I'm demonstrating my rank noobian-ness, I try this: #+name: myelsquare #+header: :var x=0 #+begin_src emacs-lisp (* x x) #+end_src #+call: myelsquare(x=6) #+RESULTS: : 36 but this results in #+name: myelsquare #+header: :var x=0 #+begin_src emacs-lisp (defun myelsquare (x) (* x x)) #+end_src #+call: myelsquare(x=6) #+RESULTS: : myelsquare2 After a #+call:... I use C-c C-c to evaluate it. What am I missing here? LB --000000000000178c0b0568f7998c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I've been trying to grok LOB again. So I've cloned= the worg git and library-of-babel.el is one of the files. org-babel-lob-in= jest didn't work, so I customized org-babel-lob-files and inserted .../= worg/library-of-babel.el . . . and it did in fact get added to my init.el u= nder the custom-set-variables:

=C2=A0'(org-babel-lob= -files (quote ("~/org/worg/lib= rary-of-babel.org")))

I checked org-b= abel-library-of-babel variable, and the new things seemed to be there, alth= ough it's rather mind-bending to know I will be calling LOB code that i= s internally stored inside of an association list.

Now, in my org file I put this:

#+lob: write(file= =3D"jsontest")

and try C-c C-c on it= . Nothing. My minibuffer says "local setup has been refreshed". H= ow does one use, call a LOB function? Also, while I'm demonstrating my = rank noobian-ness, I try this:

#+name: myelsq= uare
#+header: :var x=3D0
#+begin_src emacs-lisp
<= div>=C2=A0 (* x x)
#+end_src

#+call: mye= lsquare(x=3D6)

#+RESULTS:
: 36

but this results in

#+n= ame: myelsquare
#+header: :var x=3D0
#+begin_src emacs-= lisp
=C2=A0 (defun myelsquare (x)
=C2=A0 =C2=A0 =C2=A0 = (* x x))
#+end_src

#+call: myelsquare(x= =3D6)

#+RESULTS:
: myelsquare= 2

After a #+call:... I use C-c C-c to evalua= te it. What am I missing here?

LB
--000000000000178c0b0568f7998c-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Berry, Charles" Subject: Re: Library of Babel confusion Date: Tue, 3 Apr 2018 21:39:41 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41874) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3Teh-0002TL-72 for emacs-orgmode@gnu.org; Tue, 03 Apr 2018 17:39:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3Tee-0005CD-1s for emacs-orgmode@gnu.org; Tue, 03 Apr 2018 17:39:51 -0400 Received: from iport-bcv2-out.ucsd.edu ([132.239.0.73]:20559) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1f3Ted-0005BY-Hf for emacs-orgmode@gnu.org; Tue, 03 Apr 2018 17:39:47 -0400 In-Reply-To: Content-Language: en-US Content-ID: <498AE6BD53C6E44587272A765E49B8D1@AD.UCSD.EDU> 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: Lawrence Bottorff Cc: emacs-orgmode Mailinglist > On Apr 3, 2018, at 1:31 PM, Lawrence Bottorff wrote: >=20 > I've been trying to grok LOB again. So I've cloned the worg git and libra= ry-of-babel.el is one of the files. org-babel-lob-injest didn't work, Try=20 M-x org-babel-lob-ingest RET org/worg/library-of-babel.org RET Don't be a jester, be an ingester. ;-) > so I customized org-babel-lob-files and inserted .../worg/library-of-babe= l.el . . . and it did in fact get added to my init.el under the custom-set-= variables: >=20 > '(org-babel-lob-files (quote ("~/org/worg/library-of-babel.org"))) >=20 > I checked org-babel-library-of-babel variable, and the new things seemed = to be there, although it's rather mind-bending to know I will be calling LO= B code that is internally stored inside of an association list. >=20 > Now, in my org file I put this: >=20 > #+lob: write(file=3D"jsontest") See (info"(org) Evaluating code blocks") The proper idiom is #+call: write(file=3D"jsontest") Of course, there needs to be a proper 'write' src block in the file you ing= ested, etc. >=20 > and try C-c C-c on it. Nothing. My minibuffer says "local setup has been = refreshed". How does one use, call a LOB function? Also, while I'm demonstr= ating my rank noobian-ness, I try this: >=20 > #+name: myelsquare > #+header: :var x=3D0 > #+begin_src emacs-lisp > (* x x) > #+end_src >=20 > #+call: myelsquare(x=3D6) >=20 > #+RESULTS: > : 36 >=20 > but this results in >=20 > #+name: myelsquare > #+header: :var x=3D0 > #+begin_src emacs-lisp > (defun myelsquare (x) > (* x x)) > #+end_src >=20 > #+call: myelsquare(x=3D6) >=20 > #+RESULTS: > : myelsquare2 Is this *verbatim* ? Did you cut and paste everything (including the traili= ng `2') all at once? If so, I do not get it. I would have expected #+RESULTS: : myelsquare which is the correct behavior. To see why put point in the myelsquare src block and type C-c C-v v then move point to the end of the 'preview' buffer and type C-x C-e. Look at the value echo-ed in the minibuffer. If it still isn't clear maybe `M-x (symbol-function 'myelsquare)' will help= .=20 HTH, Chuck= From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Library of Babel confusion Date: Tue, 03 Apr 2018 22:44:00 +0200 Message-ID: <87r2nwvx4f.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38053) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3qWw-0002HK-Ju for emacs-orgmode@gnu.org; Wed, 04 Apr 2018 18:05:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3qWs-0000ou-Gp for emacs-orgmode@gnu.org; Wed, 04 Apr 2018 18:05:22 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:34213) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f3qWs-0000na-9o for emacs-orgmode@gnu.org; Wed, 04 Apr 2018 18:05:18 -0400 In-Reply-To: (Lawrence Bottorff's message of "Tue, 3 Apr 2018 16:31:57 -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: Lawrence Bottorff Cc: emacs-orgmode Mailinglist Lawrence Bottorff writes: > I've been trying to grok LOB again. So I've cloned the worg git and > library-of-babel.el is one of the files. org-babel-lob-injest didn't > work, What doesn't work? You call `org-babel-lob-ingest', specify a file, and it stores all source code blocks in the file for later use. > Now, in my org file I put this: > > #+lob: write(file="jsontest") This should be #+call: write(...) > > and try C-c C-c on it. Nothing. My minibuffer says "local setup has been > refreshed". How does one use, call a LOB function? Also, while I'm > demonstrating my rank noobian-ness, I try this: > > #+name: myelsquare > #+header: :var x=0 > > #+begin_src emacs-lisp > (* x x) > #+end_src > > #+call: myelsquare(x=6) > > #+RESULTS: : 36 > > but this results in > > #+name: myelsquare > #+header: :var x=0 > > #+begin_src emacs-lisp > (defun myelsquare (x) > (* x x)) > #+end_src > > #+call: myelsquare(x=6) > > #+RESULTS: > : myelsquare2 > > After a #+call:... I use C-c C-c to evaluate it. What am I missing > here? Your second block defines a function, but doesn't return its results. "#+call: myelsquare(...)" expects to find a block named "myelsquare", not an Elisp function named "myelsquare". Regards, -- Nicolas Goaziou From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lawrence Bottorff Subject: Re: Library of Babel confusion Date: Wed, 4 Apr 2018 18:52:35 -0400 Message-ID: References: <87r2nwvx4f.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000e5584b05690dad13" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50340) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3rGh-0004ut-D0 for emacs-orgmode@gnu.org; Wed, 04 Apr 2018 18:52:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3rGg-0007hb-62 for emacs-orgmode@gnu.org; Wed, 04 Apr 2018 18:52:39 -0400 Received: from mail-oi0-x22a.google.com ([2607:f8b0:4003:c06::22a]:45001) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f3rGf-0007gq-U9 for emacs-orgmode@gnu.org; Wed, 04 Apr 2018 18:52:38 -0400 Received: by mail-oi0-x22a.google.com with SMTP id j143-v6so20768511oih.11 for ; Wed, 04 Apr 2018 15:52:37 -0700 (PDT) In-Reply-To: <87r2nwvx4f.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: emacs-orgmode Mailinglist --000000000000e5584b05690dad13 Content-Type: text/plain; charset="UTF-8" The docs have this example: #+name: square #+header: :var x=0 #+begin_src python return x*x #+end_src #+call: square(x=6) ...so yes, "return", but with (defun myelsquare (x) (* x x)) isn't the final thing evaluated what is "returned" with Elisp? AFAIK there is no explicit return with Elisp. #+call can't really call a function, only named blocks of REPL-style calculator snippets? Also, today I find that a new start of Emacs doesn't load my LOB file, i.e., (custom-set-variables ... '(org-babel-lob-files (quote ("~/org/worg/library-of-babel.org"))) ... was being blown off, i.e., not populating the org-babel-library-of-babel variable. But today org-babel-lob-injest does seem to work, i.e., it did populate org-babel-library-of-babel. I wonder what's up. On Tue, Apr 3, 2018 at 4:44 PM, Nicolas Goaziou wrote: > Lawrence Bottorff writes: > > > I've been trying to grok LOB again. So I've cloned the worg git and > > library-of-babel.el is one of the files. org-babel-lob-injest didn't > > work, > > What doesn't work? You call `org-babel-lob-ingest', specify a file, and > it stores all source code blocks in the file for later use. > > > Now, in my org file I put this: > > > > #+lob: write(file="jsontest") > > This should be #+call: write(...) > > > > > and try C-c C-c on it. Nothing. My minibuffer says "local setup has been > > refreshed". How does one use, call a LOB function? Also, while I'm > > demonstrating my rank noobian-ness, I try this: > > > > #+name: myelsquare > > #+header: :var x=0 > > > > #+begin_src emacs-lisp > > (* x x) > > #+end_src > > > > #+call: myelsquare(x=6) > > > > #+RESULTS: : 36 > > > > but this results in > > > > #+name: myelsquare > > #+header: :var x=0 > > > > #+begin_src emacs-lisp > > (defun myelsquare (x) > > (* x x)) > > #+end_src > > > > #+call: myelsquare(x=6) > > > > #+RESULTS: > > : myelsquare2 > > > > After a #+call:... I use C-c C-c to evaluate it. What am I missing > > here? > > Your second block defines a function, but doesn't return its results. > "#+call: myelsquare(...)" expects to find a block named "myelsquare", > not an Elisp function named "myelsquare". > > Regards, > > -- > Nicolas Goaziou > --000000000000e5584b05690dad13 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The=C2=A0docs=C2=A0have this exa= mple:

#+name: square
#+header: :var x=3D0
#+begin_src python
return x*x
#+end_src

=
#+call: square(x=3D6)

...so yes, &q= uot;return", but with=C2=A0

(defun myels= quare (x)
=C2=A0 =C2=A0(* x x))

is= n't the final thing evaluated what is "returned" with Elisp? = AFAIK there is no explicit return with Elisp. #+call can't really call = a function, only named blocks of REPL-style calculator snippets?

Also, today I find that a new start of Emacs doesn't load my LOB= file, i.e.,

(custom-set-variables
...<= /div>
=C2=A0'(org-babel-lob-files (quote ("~/org/worg/library-of-babel.org")))
...

was bein= g blown off, i.e., not populating the org-babel-library-of-babel variable. = But today org-babel-lob-injest does seem to work, i.e., it did populate org= -babel-library-of-babel. I wonder what's up.


=

On Tue,= Apr 3, 2018 at 4:44 PM, Nicolas Goaziou <mail@nicolasgoaziou.fr&= gt; wrote:
Lawren= ce Bottorff <borgauf@gmail.com&= gt; writes:

> I've been trying to grok LOB again. So I've cloned the worg gi= t and
> library-of-babel.el is one of the files. org-babel-lob-injest didn'= ;t
> work,

What doesn't work? You call `org-babel-lob-ingest', specify = a file, and
it stores all source code blocks in the file for later use.

> Now, in my org file I put this:
>
> #+lob: write(file=3D"jsontest")

This should be #+call: write(...)

>
> and try C-c C-c on it. Nothing. My minibuffer says "local setup h= as been
> refreshed". How does one use, call a LOB function? Also, while I&= #39;m
> demonstrating my rank noobian-ness, I try this:
>
> #+name: myelsquare
> #+header: :var x=3D0
>
> #+begin_src emacs-lisp
>=C2=A0 =C2=A0(* x x)
> #+end_src
>
> #+call: myelsquare(x=3D6)
>
> #+RESULTS: : 36
>
> but this results in
>
> #+name: myelsquare
> #+header: :var x=3D0
>
> #+begin_src emacs-lisp
>=C2=A0 =C2=A0(defun myelsquare (x)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(* x x))
> #+end_src
>
> #+call: myelsquare(x=3D6)
>
> #+RESULTS:
> : myelsquare2
>
> After a #+call:... I use C-c C-c to evaluate it. What am I missing
> here?

Your second block defines a function, but doesn't return its res= ults.
"#+call: myelsquare(...)" expects to find a block named "mye= lsquare",
not an Elisp function named "myelsquare".

Regards,

--
Nicolas Goaziou

--000000000000e5584b05690dad13-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lawrence Bottorff Subject: Re: Library of Babel confusion Date: Fri, 6 Apr 2018 18:15:27 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000c11da805693564df" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37198) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f4Zdr-0001lz-52 for emacs-orgmode@gnu.org; Fri, 06 Apr 2018 18:15:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f4Zdp-000575-Hr for emacs-orgmode@gnu.org; Fri, 06 Apr 2018 18:15:31 -0400 Received: from mail-ot0-x22e.google.com ([2607:f8b0:4003:c0f::22e]:40534) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f4Zdp-00055V-9R for emacs-orgmode@gnu.org; Fri, 06 Apr 2018 18:15:29 -0400 Received: by mail-ot0-x22e.google.com with SMTP id j8-v6so2786559ota.7 for ; Fri, 06 Apr 2018 15:15:29 -0700 (PDT) In-Reply-To: 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: "Berry, Charles" , emacs-orgmode Mailinglist --000000000000c11da805693564df Content-Type: text/plain; charset="UTF-8" I guess I need more information. For example, what is C-c C-v v doing exactly? Then C-x C-e? And M-x (symbol-function 'myelsquare) doesn't work. Again, #+name: myelsquare #+header: :var x=0 #+begin_src emacs-lisp :var x=0 (defun myelsquare (x) (* x x)) #+end_src is Lisp code where the last thing should be returned. From library-of-babel.org: #+name: json #+begin_src emacs-lisp :var file='() :var url='() (require 'json) (cond (file (org-babel-with-temp-filebuffer file (goto-char (point-min)) (json-read))) (url (require 'w3m) (with-temp-buffer (w3m-retrieve url) (goto-char (point-min)) (json-read)))) #+end_src And this calling a sample json-containing file gives #+call: json(file="jsontest1") | glossary | (title . example glossary) | (GlossDiv (title . S) (GlossList (GlossEntry (ID . SGML) (SortAs . SGML) (GlossTerm . Standard Generalized Markup Language) (Acronym . SGML) (Abbrev . ISO 8879:1986) (GlossDef (para . A meta-markup language, used to create markup languages such as DocBook.) (GlossSeeAlso . [GML XML])) (GlossSee . markup)))) | which is correct, although not in list form. So again I'm looking at elisp code that is not in the form of a function. So I'm guessing "functions" cannot be #+call'ed, just "headless" elisp code. So what advantage does LOB offer? On Tue, Apr 3, 2018 at 5:39 PM, Berry, Charles wrote: > > > > On Apr 3, 2018, at 1:31 PM, Lawrence Bottorff wrote: > > > > I've been trying to grok LOB again. So I've cloned the worg git and > library-of-babel.el is one of the files. org-babel-lob-injest didn't work, > > > Try > > M-x org-babel-lob-ingest RET org/worg/library-of-babel.org RET > > Don't be a jester, be an ingester. ;-) > > > > so I customized org-babel-lob-files and inserted > .../worg/library-of-babel.el . . . and it did in fact get added to my > init.el under the custom-set-variables: > > > > '(org-babel-lob-files (quote ("~/org/worg/library-of-babel.org"))) > > > > I checked org-babel-library-of-babel variable, and the new things seemed > to be there, although it's rather mind-bending to know I will be calling > LOB code that is internally stored inside of an association list. > > > > Now, in my org file I put this: > > > > #+lob: write(file="jsontest") > > > See (info"(org) Evaluating code blocks") > > The proper idiom is > > #+call: write(file="jsontest") > > Of course, there needs to be a proper 'write' src block in the file you > ingested, etc. > > > > > and try C-c C-c on it. Nothing. My minibuffer says "local setup has been > refreshed". How does one use, call a LOB function? Also, while I'm > demonstrating my rank noobian-ness, I try this: > > > > #+name: myelsquare > > #+header: :var x=0 > > #+begin_src emacs-lisp > > (* x x) > > #+end_src > > > > #+call: myelsquare(x=6) > > > > #+RESULTS: > > : 36 > > > > but this results in > > > > #+name: myelsquare > > #+header: :var x=0 > > #+begin_src emacs-lisp > > (defun myelsquare (x) > > (* x x)) > > #+end_src > > > > #+call: myelsquare(x=6) > > > > #+RESULTS: > > : myelsquare2 > > > Is this *verbatim* ? Did you cut and paste everything (including the > trailing `2') all at once? If so, I do not get it. > > I would have expected > > #+RESULTS: > : myelsquare > > which is the correct behavior. > > To see why put point in the myelsquare src block and type C-c C-v v > > then move point to the end of the 'preview' buffer and type C-x C-e. > > Look at the value echo-ed in the minibuffer. > > If it still isn't clear maybe `M-x (symbol-function 'myelsquare)' will > help. > > HTH, > > Chuck > --000000000000c11da805693564df Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I guess I need more information. For example, what is=C2= =A0C-c C-v v doing exactly? Then=C2=A0C-x C-e? And=C2=A0=C2=A0M-x (symbol-f= unction 'myelsquare) doesn't work. Again,=C2=A0

=
#+name: myelsquare
#+header: :var x=3D0
#+begin_sr= c emacs-lisp :var x=3D0
=C2=A0 (defun myelsquare (x)
= =C2=A0 =C2=A0 (* x x))
#+end_src

i= s Lisp code where the last thing should be returned. From library-of-babel.org:

<= div>#+name: json
#+begin_src emacs-lisp :var file=3D'() :var = url=3D'()
=C2=A0 (require 'json)
=C2=A0 (cond
=C2=A0 =C2=A0(file
=C2=A0 =C2=A0 (org-babel-with-temp-fi= lebuffer file
=C2=A0 =C2=A0 =C2=A0 (goto-char (point-min))
<= div>=C2=A0 =C2=A0 =C2=A0 (json-read)))
=C2=A0 =C2=A0(url
=C2=A0 =C2=A0 (require 'w3m)
=C2=A0 =C2=A0 (with-temp-buffe= r
=C2=A0 =C2=A0 =C2=A0 (w3m-retrieve url)
=C2=A0 =C2=A0= =C2=A0 (goto-char (point-min))
=C2=A0 =C2=A0 =C2=A0 (json-read))= ))
#+end_src

And this calling a sa= mple json-containing file gives

#+call: json(file= =3D"jsontest1")

| glossary | (title = . example glossary) | (GlossDiv (title . S) (GlossList (GlossEntry (ID . SG= ML) (SortAs . SGML) (GlossTerm . Standard Generalized Markup Language) (Acr= onym . SGML) (Abbrev . ISO 8879:1986) (GlossDef (para . A meta-markup langu= age, used to create markup languages such as DocBook.) (GlossSeeAlso . [GML= XML])) (GlossSee . markup)))) |

which is corr= ect, although not in list form. So again I'm looking at elisp code that= is not in the form of a function. So I'm guessing "functions"= ; cannot be #+call'ed, just "headless" elisp code. So what ad= vantage does LOB offer?

On Tue, Apr 3, 2018 at 5:39 PM, Berry, Charles <ccberry@= ucsd.edu> wrote:


> On Apr 3, 2018, at 1:31 PM, Lawrence Bottorff <borgauf@gmail.com> wrote:
>
> I've been trying to grok LOB again. So I've cloned the worg gi= t and library-of-babel.el is one of the files. org-babel-lob-injest didn= 9;t work,


Try

M-x org-babel-lob-ingest RET org/worg/library-of-babel.org RET

Don't be a jester, be an ingester. ;-)


> so I customized org-babel-lob-files and inserted .../worg/library-of-b= abel.el . . . and it did in fact get added to my init.el under the custom-s= et-variables:
>
>=C2=A0 '(org-babel-lob-files (quote ("~/org/worg/library-of-= babel.org")))
>
> I checked org-babel-library-of-babel variable, and the new things seem= ed to be there, although it's rather mind-bending to know I will be cal= ling LOB code that is internally stored inside of an association list.
>
> Now, in my org file I put this:
>
> #+lob: write(file=3D"jsontest")


See (info"(org) Evaluating code blocks")

The proper idiom is

=C2=A0 =C2=A0 =C2=A0 =C2=A0 #+call: write(file=3D"jsontest")

Of course, there needs to be a proper 'write' src block in the file= you ingested, etc.

>
> and try C-c C-c on it. Nothing. My minibuffer says "local setup h= as been refreshed". How does one use, call a LOB function? Also, while= I'm demonstrating my rank noobian-ness, I try this:
>
> #+name: myelsquare
> #+header: :var x=3D0
> #+begin_src emacs-lisp
>=C2=A0 =C2=A0(* x x)
> #+end_src
>
> #+call: myelsquare(x=3D6)
>
> #+RESULTS:
> : 36
>
> but this results in
>
> #+name: myelsquare
> #+header: :var x=3D0
> #+begin_src emacs-lisp
>=C2=A0 =C2=A0(defun myelsquare (x)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(* x x))
> #+end_src
>
> #+call: myelsquare(x=3D6)
>
> #+RESULTS:
> : myelsquare2


Is this *verbatim* ? Did you cut and paste everything (including the= trailing `2') all at once? If so, I do not get it.

I would have expected

#+RESULTS:
: myelsquare

=C2=A0which is the correct behavior.

To see why put point in the myelsquare src block and type C-c C-v v

then move point to the end of the 'preview' buffer and type C-x C-e= .

Look at the value echo-ed in the minibuffer.

If it still isn't clear maybe `M-x (symbol-function 'myelsquare)= 9; will help.

HTH,

Chuck

--000000000000c11da805693564df-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thomas S. Dye" Subject: Re: Library of Babel confusion Date: Fri, 06 Apr 2018 13:59:05 -1000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; format=flowed Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f4bGl-0005jM-M0 for emacs-orgmode@gnu.org; Fri, 06 Apr 2018 19:59:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f4bGi-0008Db-Jt for emacs-orgmode@gnu.org; Fri, 06 Apr 2018 19:59:47 -0400 Received: from gproxy3-pub.mail.unifiedlayer.com ([69.89.30.42]:44289) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f4bGi-00080p-Be for emacs-orgmode@gnu.org; Fri, 06 Apr 2018 19:59:44 -0400 Received: from CMOut01 (unknown [10.0.90.82]) by gproxy3.mail.unifiedlayer.com (Postfix) with ESMTP id A75DC402BE for ; Fri, 6 Apr 2018 17:59:23 -0600 (MDT) In-reply-to: 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: Lawrence Bottorff Cc: emacs-orgmode Mailinglist , "Berry, Charles" Aloha Lawrence, #+name: myelsquare #+header: :var x=0 #+begin_src emacs-lisp :var x=0 (defun myelsquare (x) (* x x)) #+end_src #+RESULTS: myelsquare : myelsquare Assuming myelsquare has been evaluated: #+name: eval-myelsquare #+header: :var y=2 #+BEGIN_SRC emacs-lisp (myelsquare y) #+END_SRC #+RESULTS: eval-myelsquare : 4 #+call: eval-myelsquare(3) #+RESULTS: : 9 hth, Tom Lawrence Bottorff writes: > I guess I need more information. For example, what is C-c C-v v > doing > exactly? Then C-x C-e? And M-x (symbol-function 'myelsquare) > doesn't work. > Again, > > #+name: myelsquare > #+header: :var x=0 > #+begin_src emacs-lisp :var x=0 > (defun myelsquare (x) > (* x x)) > #+end_src > > is Lisp code where the last thing should be returned. From > library-of-babel.org: > > #+name: json > #+begin_src emacs-lisp :var file='() :var url='() > (require 'json) > (cond > (file > (org-babel-with-temp-filebuffer file > (goto-char (point-min)) > (json-read))) > (url > (require 'w3m) > (with-temp-buffer > (w3m-retrieve url) > (goto-char (point-min)) > (json-read)))) > #+end_src > > And this calling a sample json-containing file gives > > #+call: json(file="jsontest1") > > | glossary | (title . example glossary) | (GlossDiv (title . S) > (GlossList > (GlossEntry (ID . SGML) (SortAs . SGML) (GlossTerm . Standard > Generalized > Markup Language) (Acronym . SGML) (Abbrev . ISO 8879:1986) > (GlossDef (para > . A meta-markup language, used to create markup languages such > as DocBook.) > (GlossSeeAlso . [GML XML])) (GlossSee . markup)))) | > > which is correct, although not in list form. So again I'm > looking at elisp > code that is not in the form of a function. So I'm guessing > "functions" > cannot be #+call'ed, just "headless" elisp code. So what > advantage does LOB > offer? > > On Tue, Apr 3, 2018 at 5:39 PM, Berry, Charles > wrote: > >> >> >> > On Apr 3, 2018, at 1:31 PM, Lawrence Bottorff >> > wrote: >> > >> > I've been trying to grok LOB again. So I've cloned the worg >> > git and >> library-of-babel.el is one of the files. org-babel-lob-injest >> didn't work, >> >> >> Try >> >> M-x org-babel-lob-ingest RET org/worg/library-of-babel.org RET >> >> Don't be a jester, be an ingester. ;-) >> >> >> > so I customized org-babel-lob-files and inserted >> .../worg/library-of-babel.el . . . and it did in fact get added >> to my >> init.el under the custom-set-variables: >> > >> > '(org-babel-lob-files (quote >> > ("~/org/worg/library-of-babel.org"))) >> > >> > I checked org-babel-library-of-babel variable, and the new >> > things seemed >> to be there, although it's rather mind-bending to know I will >> be calling >> LOB code that is internally stored inside of an association >> list. >> > >> > Now, in my org file I put this: >> > >> > #+lob: write(file="jsontest") >> >> >> See (info"(org) Evaluating code blocks") >> >> The proper idiom is >> >> #+call: write(file="jsontest") >> >> Of course, there needs to be a proper 'write' src block in the >> file you >> ingested, etc. >> >> > >> > and try C-c C-c on it. Nothing. My minibuffer says "local >> > setup has been >> refreshed". How does one use, call a LOB function? Also, while >> I'm >> demonstrating my rank noobian-ness, I try this: >> > >> > #+name: myelsquare >> > #+header: :var x=0 >> > #+begin_src emacs-lisp >> > (* x x) >> > #+end_src >> > >> > #+call: myelsquare(x=6) >> > >> > #+RESULTS: >> > : 36 >> > >> > but this results in >> > >> > #+name: myelsquare >> > #+header: :var x=0 >> > #+begin_src emacs-lisp >> > (defun myelsquare (x) >> > (* x x)) >> > #+end_src >> > >> > #+call: myelsquare(x=6) >> > >> > #+RESULTS: >> > : myelsquare2 >> >> >> Is this *verbatim* ? Did you cut and paste everything >> (including the >> trailing `2') all at once? If so, I do not get it. >> >> I would have expected >> >> #+RESULTS: >> : myelsquare >> >> which is the correct behavior. >> >> To see why put point in the myelsquare src block and type C-c >> C-v v >> >> then move point to the end of the 'preview' buffer and type C-x >> C-e. >> >> Look at the value echo-ed in the minibuffer. >> >> If it still isn't clear maybe `M-x (symbol-function >> 'myelsquare)' will >> help. >> >> HTH, >> >> Chuck >> -- Thomas S. Dye http://www.tsdye.com From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Berry, Charles" Subject: Re: Library of Babel confusion Date: Sat, 7 Apr 2018 02:38:23 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59728) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f4dkf-0001zE-Rc for emacs-orgmode@gnu.org; Fri, 06 Apr 2018 22:38:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f4dka-0006kf-QZ for emacs-orgmode@gnu.org; Fri, 06 Apr 2018 22:38:49 -0400 Received: from iport-bcv3-out.ucsd.edu ([132.239.0.89]:25920) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1f4dka-0006e6-CA for emacs-orgmode@gnu.org; Fri, 06 Apr 2018 22:38:44 -0400 In-Reply-To: Content-Language: en-US Content-ID: 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: "Thomas S. Dye" Cc: emacs-orgmode Mailinglist , Lawrence Bottorff DQoNCj4gT24gQXByIDYsIDIwMTgsIGF0IDQ6NTkgUE0sIFRob21hcyBTLiBEeWUgPHRzZEB0c2R5 ZS5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JlZm9yZS4gSSBzaG91bGQg aGF2ZSBzYWlkIA0KDQoJTS06IChzeW1ib2wtZnVuY3Rpb24gJ215ZWxzcXVhcmUpIFJFVA0KDQpB bmQgdGhhdCB2YWx1ZSBpcyBgKGxhbWJkYSAoeCkgKCogeCB4KSknLiBXaGljaCBzaW1wbHkgc2hv d3MgeW91IGhhdmUgZGVmdW4nZWQgYSBmdW5jdGlvbiBhbmQgd2hhdCBpdCBpcy4NCg0KT25jZSB5 b3UgaGF2ZSBhbiBlbGlzcCBmdW5jdGlvbiwgdGhlIG5hdHVyYWwgd2F5IHRvIGNhbGwgaXQgaXMg c3JjX2VtYWNzLWxpc3B7KG15ZWxzcXVhcmUgMS41KX0uIA0KDQpPbmUgdGhpbmcgeW91IGNhbiBk byB3aXRoIExPQiBibG9ja3MgaXMgdXNlIHRoZW0gaW4gaGVhZGVyIGFyZ3Mgb2Ygc3JjIGJsb2Nr cyBqdXN0IGFzIHlvdSB3b3VsZCB1c2UgY2FsbHMgdG8gb3JkaW5hcnkgc3JjIGJsb2Nrcy4gDQoN CkhUSCwNCg0KQ2h1Y2sNCg0KDQo= From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lawrence Bottorff Subject: Re: Library of Babel confusion Date: Wed, 11 Apr 2018 09:29:26 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000c0a4b6056992a093" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49484) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f6FoX-000697-CN for emacs-orgmode@gnu.org; Wed, 11 Apr 2018 09:29:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f6FoV-0007p1-Ne for emacs-orgmode@gnu.org; Wed, 11 Apr 2018 09:29:29 -0400 Received: from mail-oi0-x234.google.com ([2607:f8b0:4003:c06::234]:44154) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f6FoV-0007oh-EW for emacs-orgmode@gnu.org; Wed, 11 Apr 2018 09:29:27 -0400 Received: by mail-oi0-x234.google.com with SMTP id j143-v6so1676200oih.11 for ; Wed, 11 Apr 2018 06:29:27 -0700 (PDT) In-Reply-To: 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: "Thomas S. Dye" Cc: emacs-orgmode Mailinglist , "Berry, Charles" --000000000000c0a4b6056992a093 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I'll try that, Thomas, but this was set up by simply doing the on-board customize, i.e., it needs to have this corrected. So how do I request this correction? On Tue, Apr 10, 2018 at 3:26 PM, Thomas S. Dye wrote: > Aloha Lawrence, > > You probably want (org-babel-lob-ingest &optional FILE) > > All the best, > Tom > > > Lawrence Bottorff writes: > > Thanks for the help. However, one mystery still remains: Why is this >> >> '(org-babel-lob-files (quote ("~/org/worg/library-of-babel.org"))) >> >> in my init.el's custom-set-variables not getting handled? I always have = to >> do an org-babel-lob-ingest to actually get library-of-babel.org loaded. >> >> On Fri, Apr 6, 2018 at 10:38 PM, Berry, Charles wrote= : >> >> >>> >>> > On Apr 6, 2018, at 4:59 PM, Thomas S. Dye > wrote: >>> > >>> >>> [Tom's response covering the main issues deleted] >>> >>> > hth, >>> > Tom >>> > >>> > Lawrence Bottorff writes: >>> > >>> >> I guess I need more information. For example, what is C-c >> C-v v >>> doing >>> >> exactly? Then C-x C-e? And M-x (symbol-function >> 'myelsquare) >>> doesn't >>> work. >>> >>> >>> `C-h k' is really your friend here. If you do not know it, try typing i= t >>> twice `C-h k C-h k'. >>> >>> As for the specific keystrokes mentioned above: >>> >>> ,----[ C-h k C-c C-v v ] >>> | C-c C-v v runs the command org-babel-expand-src-block (found in >>> | org-mode-map), which is an interactive autoloaded compiled Lisp >>> | function in =E2=80=98ob-core.el=E2=80=99. >>> | >>> | It is bound to C-c C-v v, C-c C-v C-v. >>> | >>> | (org-babel-expand-src-block &optional ARG INFO PARAMS) >>> | >>> | Expand the current source code block. >>> | Expand according to the source code block=E2=80=99s header >>> | arguments and pop open the results in a preview buffer. >>> | >>> | [back] >>> `---- >>> >>> In your case, it shows that the `mtelsquare' src block expands to: >>> >>> >>> ,---- >>> | (let ((x (quote 0))) >>> | (defun myelsquare (x) >>> | (* x x)) >>> | ) >>> `---- >>> >>> >>> ,----[ C-h k C-x C-e ] >>> | C-x C-e runs the command eval-last-sexp (found in global-map), which >>> | is an interactive compiled Lisp function in =E2=80=98elisp-mode.el=E2= =80=99. >>> | >>> | It is bound to C-x C-e. >>> | >>> | (eval-last-sexp EVAL-LAST-SEXP-ARG-INTERNAL) >>> | >>> | Evaluate sexp before point; print value in the echo area. >>> | Interactively, with prefix argument, print output into current buffer= . >>> | >>> | Normally, this function truncates long output according to the value >>> | of the variables =E2=80=98eval-expression-print-length=E2=80=99 and >>> | =E2=80=98eval-expression-print-level=E2=80=99. With a prefix argumen= t of zero, >>> | however, there is no such truncation. Such a prefix argument >>> | also causes integers to be printed in several additional formats >>> | (octal, hexadecimal, and character). >>> | >>> | If =E2=80=98eval-expression-debug-on-error=E2=80=99 is non-nil, which= is the default, >>> | this command arranges for all errors to enter the debugger. >>> | >>> | [back] >>> `---- >>> >>> So with point at the end of the preview buffer for myelsquare (which ha= s >>> one `let' expression it it) it has the same effect as running >>> `eval-buffer'. viz, the elisp function `myelsquare' is created. >>> >>> If you have gotten this far, there is an lisp function called >>> `myelsquare' >>> and the `symbol-function' expression will return its value when properl= y >>> `eval'ed. I misspoke before. I should have said >>> >>> M-: (symbol-function 'myelsquare) RET >>> >>> And that value is `(lambda (x) (* x x))'. Which simply shows you have >>> defun'ed a function and what it is. >>> >>> Once you have an elisp function, the natural way to call it is >>> src_emacs-lisp{(myelsquare 1.5)}. >>> >>> One thing you can do with LOB blocks is use them in header args of src >>> blocks just as you would use calls to ordinary src blocks. >>> >>> HTH, >>> >>> Chuck >>> >>> >>> >>> > > -- > Thomas S. Dye > http://www.tsdye.com > --000000000000c0a4b6056992a093 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I'll try that, Thomas, but this was set up by simply d= oing the on-board customize, i.e., it needs to have this corrected. So how = do I request this correction?

On Tue, Apr 10, 2018 at 3:26 PM, Thomas S. Dye <tsd@tsdye.c= om> wrote:
Aloha Lawrence,<= br>
You probably want (org-babel-lob-ingest &optional FILE)

All the best,
Tom


Lawrence Bottorff writes:

Thanks for the help. However, one mystery still remains: Why is this

=C2=A0'(org-babel-lob-files (quote=C2=A0 ("~/org/worg/library-of= -babel.org")))

in my init.el's custom-set-variables not getting handled? I always have= to
do an org-babel-lob-ingest to actually get library-of-babel.org loade= d.

On Fri, Apr 6, 2018 at 10:38 PM, Berry, Charles <ccberry@ucsd.edu> wrote:



> On Apr 6, 2018, at 4:59 PM, Thomas S. Dye <tsd@tsdye.com> > wrote:
>

[Tom's response covering the main issues deleted]

> hth,
> Tom
>
> Lawrence Bottorff writes:
>
>> I guess I need more information. For example, what is C-c >>= C-v v doing
>> exactly? Then C-x C-e? And=C2=A0 M-x (symbol-function >> = 9;myelsquare) doesn't
work.


`C-h k' is really your friend here. If you do not know it, try typing i= t
twice `C-h k C-h k'.

As for the specific keystrokes mentioned above:

,----[ C-h k C-c C-v v ]
| C-c C-v v runs the command org-babel-expand-src-block (found in
| org-mode-map), which is an interactive autoloaded compiled Lisp
| function in =E2=80=98ob-core.el=E2=80=99.
|
| It is bound to C-c C-v v, C-c C-v C-v.
|
| (org-babel-expand-src-block &optional ARG INFO PARAMS)
|
| Expand the current source code block.
| Expand according to the source code block=E2=80=99s header
| arguments and pop open the results in a preview buffer.
|
| [back]
`----

In your case, it shows that the `mtelsquare' src block expands to:


,----
| (let ((x (quote 0)))
| (defun myelsquare (x)
|=C2=A0 =C2=A0(* x x))
| )
`----


,----[ C-h k C-x C-e ]
| C-x C-e runs the command eval-last-sexp (found in global-map), which
| is an interactive compiled Lisp function in =E2=80=98elisp-mode.el=E2=80= =99.
|
| It is bound to C-x C-e.
|
| (eval-last-sexp EVAL-LAST-SEXP-ARG-INTERNAL)
|
| Evaluate sexp before point; print value in the echo area.
| Interactively, with prefix argument, print output into current buffer. |
| Normally, this function truncates long output according to the value
| of the variables =E2=80=98eval-expression-print-length=E2=80=99 and
| =E2=80=98eval-expression-print-level=E2=80=99.=C2=A0 With a prefix a= rgument of zero,
| however, there is no such truncation.=C2=A0 Such a prefix argument
| also causes integers to be printed in several additional formats
| (octal, hexadecimal, and character).
|
| If =E2=80=98eval-expression-debug-on-error=E2=80=99 is non-nil, whic= h is the default,
| this command arranges for all errors to enter the debugger.
|
| [back]
`----

So with point at the end of the preview buffer for myelsquare (which has one `let' expression it it) it has the same effect as running
`eval-buffer'. viz, the elisp function `myelsquare' is created.

If you have gotten this far, there is an lisp function called `myelsquare&#= 39;
and the `symbol-function' expression will return its value when properl= y
`eval'ed. I misspoke before. I should have said

=C2=A0 =C2=A0 =C2=A0 =C2=A0 M-: (symbol-function 'myelsquare) RET

And that value is `(lambda (x) (* x x))'. Which simply shows you have defun'ed a function and what it is.

Once you have an elisp function, the natural way to call it is
src_emacs-lisp{(myelsquare 1.5)}.

One thing you can do with LOB blocks is use them in header args of src
blocks just as you would use calls to ordinary src blocks.

HTH,

Chuck





--
Thomas S. Dye
http:= //www.tsdye.com

--000000000000c0a4b6056992a093-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Berry, Charles" Subject: Re: Library of Babel confusion Date: Wed, 11 Apr 2018 18:20:38 +0000 Message-ID: <389F9494-CEE4-4071-A5D0-213C8D0B69ED@ucsd.edu> References: Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43113) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f6KMR-0005Fh-0D for emacs-orgmode@gnu.org; Wed, 11 Apr 2018 14:20:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f6KMN-0000qZ-Nb for emacs-orgmode@gnu.org; Wed, 11 Apr 2018 14:20:46 -0400 Received: from iport-acv4-out.ucsd.edu ([132.239.0.7]:10978) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1f6KMN-0000om-8M for emacs-orgmode@gnu.org; Wed, 11 Apr 2018 14:20:43 -0400 In-Reply-To: Content-Language: en-US Content-ID: <43A7BD5025B4D744A385A6F6FF88DB79@AD.UCSD.EDU> 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: Lawrence Bottorff Cc: emacs-orgmode Mailinglist DQoNCj4gT24gQXByIDExLCAyMDE4LCBhdCA2OjI5IEFNLCBMYXdyZW5jZSBCb3R0b3JmZiA8Ym9y Z2F1ZkBnbWFpbC5jb20+IHdyb3RlOg0KPiANCj4gSSdsbCB0cnkgdGhhdCwgVGhvbWFzLCBidXQg dGhpcyB3YXMgc2V0IHVwIGJ5IHNpbXBseSBkb2luZyB0aGUgb24tYm9hcmQgY3VzdG9taXplLCBp LmUuLCBpdCBuZWVkcyB0byBoYXZlIHRoaXMgY29ycmVjdGVkLiBTbyBob3cgZG8gSSByZXF1ZXN0 IHRoaXMgY29ycmVjdGlvbj8NCg0KVGhlIGlkaW9tIFRvbSBnYXZlIHlvdSBpcyBjb3JyZWN0LiBU aGVyZSBhcmUgbm8gdmFyaWFibGVzIGZvciB5b3UgdG8gaGFuZGxlIHlvdXJzZWxmIC0gaXQgYWxs IGhhcHBlbnMgdW5kZXIgdGhlIGhvb2QuDQoNCkNodWNrDQoNCj4gDQo+IE9uIFR1ZSwgQXByIDEw LCAyMDE4IGF0IDM6MjYg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2VkLiBJIG1pc3Nwb2tl IGJlZm9yZS4gSSBzaG91bGQgaGF2ZSBzYWlkDQo+IA0KPiAgICAgICAgIE0tOiAoc3ltYm9sLWZ1 bmN0aW9uICdteWVsc3F1YXJlKSBSRVQNCj4gDQo+IEFuZCB0aGF0IHZhbHVlIGlzIGAobGFtYmRh ICh4KSAoKiB4IHgpKScuIFdoaWNoIHNpbXBseSBzaG93cyB5b3UgaGF2ZQ0KPiBkZWZ1bidlZCBh IGZ1bmN0aW9uIGFuZCB3aGF0IGl0IGlzLg0KPiANCj4gT25jZSB5b3UgaGF2ZSBhbiBlbGlzcCBm dW5jdGlvbiwgdGhlIG5hdHVyYWwgd2F5IHRvIGNhbGwgaXQgaXMNCj4gc3JjX2VtYWNzLWxpc3B7 KG15ZWxzcXVhcmUgMS41KX0uDQo+IA0KPiBPbmUgdGhpbmcgeW91IGNhbiBkbyB3aXRoIExPQiBi bG9ja3MgaXMgdXNlIHRoZW0gaW4gaGVhZGVyIGFyZ3Mgb2Ygc3JjDQo+IGJsb2NrcyBqdXN0IGFz IHlvdSB3b3VsZCB1c2UgY2FsbHMgdG8gb3JkaW5hcnkgc3JjIGJsb2Nrcy4NCj4gDQo+IEhUSCwN Cj4gDQo+IENodWNrDQo+IA0KPiANCj4gDQo+IA0KPiANCj4gLS0NCj4gVGhvbWFzIFMuIER5ZQ0K PiBodHRwOi8vd3d3LnRzZHllLmNvbQ0KPiANCg0K From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thomas S. Dye" Subject: Re: Library of Babel confusion Date: Tue, 10 Apr 2018 09:26:45 -1000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48487) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f6LFq-0007p0-9i for emacs-orgmode@gnu.org; Wed, 11 Apr 2018 15:18:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f6LFn-0005kh-Jq for emacs-orgmode@gnu.org; Wed, 11 Apr 2018 15:18:02 -0400 Received: from gproxy2-pub.mail.unifiedlayer.com ([69.89.18.3]:50371) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f6LFn-0005df-B8 for emacs-orgmode@gnu.org; Wed, 11 Apr 2018 15:17:59 -0400 Received: from cmgw3 (unknown [10.0.90.84]) by gproxy2.mail.unifiedlayer.com (Postfix) with ESMTP id 25FD11F79AC for ; Tue, 10 Apr 2018 13:27:04 -0600 (MDT) In-reply-to: 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: Lawrence Bottorff Cc: emacs-orgmode Mailinglist , "Berry, Charles" Aloha Lawrence, You probably want (org-babel-lob-ingest &optional FILE) All the best, Tom Lawrence Bottorff writes: > Thanks for the help. However, one mystery still remains: Why is=20 > this > > '(org-babel-lob-files (quote=20 > ("~/org/worg/library-of-babel.org"))) > > in my init.el's custom-set-variables not getting handled? I=20 > always have to > do an org-babel-lob-ingest to actually get library-of-babel.org=20 > loaded. > > On Fri, Apr 6, 2018 at 10:38 PM, Berry, Charles=20 > wrote: > >> >> >> > On Apr 6, 2018, at 4:59 PM, Thomas S. Dye =20 >> > wrote: >> > >> >> [Tom's response covering the main issues deleted] >> >> > hth, >> > Tom >> > >> > Lawrence Bottorff writes: >> > >> >> I guess I need more information. For example, what is C-c=20 >> >> C-v v doing >> >> exactly? Then C-x C-e? And M-x (symbol-function=20 >> >> 'myelsquare) doesn't >> work. >> >> >> `C-h k' is really your friend here. If you do not know it, try=20 >> typing it >> twice `C-h k C-h k'. >> >> As for the specific keystrokes mentioned above: >> >> ,----[ C-h k C-c C-v v ] >> | C-c C-v v runs the command org-babel-expand-src-block (found=20 >> in >> | org-mode-map), which is an interactive autoloaded compiled=20 >> Lisp >> | function in =E2=80=98ob-core.el=E2=80=99. >> | >> | It is bound to C-c C-v v, C-c C-v C-v. >> | >> | (org-babel-expand-src-block &optional ARG INFO PARAMS) >> | >> | Expand the current source code block. >> | Expand according to the source code block=E2=80=99s header >> | arguments and pop open the results in a preview buffer. >> | >> | [back] >> `---- >> >> In your case, it shows that the `mtelsquare' src block expands=20 >> to: >> >> >> ,---- >> | (let ((x (quote 0))) >> | (defun myelsquare (x) >> | (* x x)) >> | ) >> `---- >> >> >> ,----[ C-h k C-x C-e ] >> | C-x C-e runs the command eval-last-sexp (found in=20 >> global-map), which >> | is an interactive compiled Lisp function in =E2=80=98elisp-mode.el=E2= =80=99. >> | >> | It is bound to C-x C-e. >> | >> | (eval-last-sexp EVAL-LAST-SEXP-ARG-INTERNAL) >> | >> | Evaluate sexp before point; print value in the echo area. >> | Interactively, with prefix argument, print output into=20 >> current buffer. >> | >> | Normally, this function truncates long output according to=20 >> the value >> | of the variables =E2=80=98eval-expression-print-length=E2=80=99 and >> | =E2=80=98eval-expression-print-level=E2=80=99. With a prefix argume= nt of=20 >> zero, >> | however, there is no such truncation. Such a prefix argument >> | also causes integers to be printed in several additional=20 >> formats >> | (octal, hexadecimal, and character). >> | >> | If =E2=80=98eval-expression-debug-on-error=E2=80=99 is non-nil, whic= h is the=20 >> default, >> | this command arranges for all errors to enter the debugger. >> | >> | [back] >> `---- >> >> So with point at the end of the preview buffer for myelsquare=20 >> (which has >> one `let' expression it it) it has the same effect as running >> `eval-buffer'. viz, the elisp function `myelsquare' is created. >> >> If you have gotten this far, there is an lisp function called=20 >> `myelsquare' >> and the `symbol-function' expression will return its value when=20 >> properly >> `eval'ed. I misspoke before. I should have said >> >> M-: (symbol-function 'myelsquare) RET >> >> And that value is `(lambda (x) (* x x))'. Which simply shows=20 >> you have >> defun'ed a function and what it is. >> >> Once you have an elisp function, the natural way to call it is >> src_emacs-lisp{(myelsquare 1.5)}. >> >> One thing you can do with LOB blocks is use them in header args=20 >> of src >> blocks just as you would use calls to ordinary src blocks. >> >> HTH, >> >> Chuck >> >> >> -- Thomas S. Dye http://www.tsdye.com From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thomas S. Dye" Subject: Re: Library of Babel confusion Date: Wed, 11 Apr 2018 06:57:42 -1000 Message-ID: <873701smt5.fsf@tsdye.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47311) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f6NNH-0007wM-1V for emacs-orgmode@gnu.org; Wed, 11 Apr 2018 17:33:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f6NN8-0004m9-Td for emacs-orgmode@gnu.org; Wed, 11 Apr 2018 17:33:51 -0400 Received: from gproxy8-pub.mail.unifiedlayer.com ([67.222.33.93]:33767) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f6NN8-0004kh-LE for emacs-orgmode@gnu.org; Wed, 11 Apr 2018 17:33:42 -0400 Received: from cmgw2 (unknown [10.0.90.83]) by gproxy8.mail.unifiedlayer.com (Postfix) with ESMTP id 6ED8B1AB2BE for ; Wed, 11 Apr 2018 15:33:23 -0600 (MDT) In-reply-to: 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: Lawrence Bottorff Cc: emacs-orgmode Mailinglist , "Berry, Charles" Aloha Lawrence, Lawrence Bottorff writes: > I'll try that, Thomas, but this was set up by simply doing the=20 > on-board > customize, i.e., it needs to have this corrected. So how do I=20 > request this > correction? There are instructions here: https://orgmode.org/org.html#Feedback You'll need to indicate which customization option you've set and=20 what you expected to happen vs. what actually happened. I don't use customize and am not familiar with it, but when I=20 looked through the Babel section this morning I didn't find an=20 option to ingest a library of babel. Perhaps I missed it, or it=20 is found somewhere else? All the best, Tom > > On Tue, Apr 10, 2018 at 3:26 PM, Thomas S. Dye =20 > wrote: > >> Aloha Lawrence, >> >> You probably want (org-babel-lob-ingest &optional FILE) >> >> All the best, >> Tom >> >> >> Lawrence Bottorff writes: >> >> Thanks for the help. However, one mystery still remains: Why is=20 >> this >>> >>> '(org-babel-lob-files (quote=20 >>> ("~/org/worg/library-of-babel.org"))) >>> >>> in my init.el's custom-set-variables not getting handled? I=20 >>> always have to >>> do an org-babel-lob-ingest to actually get=20 >>> library-of-babel.org loaded. >>> >>> On Fri, Apr 6, 2018 at 10:38 PM, Berry, Charles=20 >>> wrote: >>> >>> >>>> >>>> > On Apr 6, 2018, at 4:59 PM, Thomas S. Dye >=20 >>>> > wrote: >>>> > >>>> >>>> [Tom's response covering the main issues deleted] >>>> >>>> > hth, >>>> > Tom >>>> > >>>> > Lawrence Bottorff writes: >>>> > >>>> >> I guess I need more information. For example, what is C-c=20 >>>> >> >> C-v v >>>> doing >>>> >> exactly? Then C-x C-e? And M-x (symbol-function >>=20 >>>> >> 'myelsquare) >>>> doesn't >>>> work. >>>> >>>> >>>> `C-h k' is really your friend here. If you do not know it,=20 >>>> try typing it >>>> twice `C-h k C-h k'. >>>> >>>> As for the specific keystrokes mentioned above: >>>> >>>> ,----[ C-h k C-c C-v v ] >>>> | C-c C-v v runs the command org-babel-expand-src-block=20 >>>> (found in >>>> | org-mode-map), which is an interactive autoloaded compiled=20 >>>> Lisp >>>> | function in =E2=80=98ob-core.el=E2=80=99. >>>> | >>>> | It is bound to C-c C-v v, C-c C-v C-v. >>>> | >>>> | (org-babel-expand-src-block &optional ARG INFO PARAMS) >>>> | >>>> | Expand the current source code block. >>>> | Expand according to the source code block=E2=80=99s header >>>> | arguments and pop open the results in a preview buffer. >>>> | >>>> | [back] >>>> `---- >>>> >>>> In your case, it shows that the `mtelsquare' src block=20 >>>> expands to: >>>> >>>> >>>> ,---- >>>> | (let ((x (quote 0))) >>>> | (defun myelsquare (x) >>>> | (* x x)) >>>> | ) >>>> `---- >>>> >>>> >>>> ,----[ C-h k C-x C-e ] >>>> | C-x C-e runs the command eval-last-sexp (found in=20 >>>> global-map), which >>>> | is an interactive compiled Lisp function in=20 >>>> =E2=80=98elisp-mode.el=E2=80=99. >>>> | >>>> | It is bound to C-x C-e. >>>> | >>>> | (eval-last-sexp EVAL-LAST-SEXP-ARG-INTERNAL) >>>> | >>>> | Evaluate sexp before point; print value in the echo area. >>>> | Interactively, with prefix argument, print output into=20 >>>> current buffer. >>>> | >>>> | Normally, this function truncates long output according to=20 >>>> the value >>>> | of the variables =E2=80=98eval-expression-print-length=E2=80=99 an= d >>>> | =E2=80=98eval-expression-print-level=E2=80=99. With a prefix argu= ment of=20 >>>> zero, >>>> | however, there is no such truncation. Such a prefix=20 >>>> argument >>>> | also causes integers to be printed in several additional=20 >>>> formats >>>> | (octal, hexadecimal, and character). >>>> | >>>> | If =E2=80=98eval-expression-debug-on-error=E2=80=99 is non-nil, wh= ich is=20 >>>> the default, >>>> | this command arranges for all errors to enter the debugger. >>>> | >>>> | [back] >>>> `---- >>>> >>>> So with point at the end of the preview buffer for myelsquare=20 >>>> (which has >>>> one `let' expression it it) it has the same effect as running >>>> `eval-buffer'. viz, the elisp function `myelsquare' is=20 >>>> created. >>>> >>>> If you have gotten this far, there is an lisp function called >>>> `myelsquare' >>>> and the `symbol-function' expression will return its value=20 >>>> when properly >>>> `eval'ed. I misspoke before. I should have said >>>> >>>> M-: (symbol-function 'myelsquare) RET >>>> >>>> And that value is `(lambda (x) (* x x))'. Which simply shows=20 >>>> you have >>>> defun'ed a function and what it is. >>>> >>>> Once you have an elisp function, the natural way to call it=20 >>>> is >>>> src_emacs-lisp{(myelsquare 1.5)}. >>>> >>>> One thing you can do with LOB blocks is use them in header=20 >>>> args of src >>>> blocks just as you would use calls to ordinary src blocks. >>>> >>>> HTH, >>>> >>>> Chuck >>>> >>>> >>>> >>>> >> >> -- >> Thomas S. Dye >> http://www.tsdye.com >> -- Thomas S. Dye http://www.tsdye.com From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49763) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5yQr-0004SL-24 for emacs-orgmode@gnu.org; Tue, 10 Apr 2018 14:55:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f5yQp-0007BX-EU for emacs-orgmode@gnu.org; Tue, 10 Apr 2018 14:55:53 -0400 Received: from mail-ot0-x22c.google.com ([2607:f8b0:4003:c0f::22c]:46619) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f5yQp-00079Q-7d for emacs-orgmode@gnu.org; Tue, 10 Apr 2018 14:55:51 -0400 Received: by mail-ot0-x22c.google.com with SMTP id v64-v6so13961114otb.13 for ; Tue, 10 Apr 2018 11:55:50 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Lawrence Bottorff Date: Tue, 10 Apr 2018 14:55:49 -0400 Message-ID: Content-Type: multipart/alternative; boundary="00000000000029fbd105698312fa" Subject: Re: Library of Babel confusion List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+kyle=kyleam.com@gnu.org Sender: "Emacs-orgmode" To: "Berry, Charles" Cc: emacs-orgmode Mailinglist --00000000000029fbd105698312fa Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks for the help. However, one mystery still remains: Why is this '(org-babel-lob-files (quote ("~/org/worg/library-of-babel.org"))) in my init.el's custom-set-variables not getting handled? I always have to do an org-babel-lob-ingest to actually get library-of-babel.org loaded. On Fri, Apr 6, 2018 at 10:38 PM, Berry, Charles wrote: > > > > On Apr 6, 2018, at 4:59 PM, Thomas S. Dye wrote: > > > > [Tom's response covering the main issues deleted] > > > hth, > > Tom > > > > Lawrence Bottorff writes: > > > >> I guess I need more information. For example, what is C-c C-v v doing > >> exactly? Then C-x C-e? And M-x (symbol-function 'myelsquare) doesn't > work. > > > `C-h k' is really your friend here. If you do not know it, try typing it > twice `C-h k C-h k'. > > As for the specific keystrokes mentioned above: > > ,----[ C-h k C-c C-v v ] > | C-c C-v v runs the command org-babel-expand-src-block (found in > | org-mode-map), which is an interactive autoloaded compiled Lisp > | function in =E2=80=98ob-core.el=E2=80=99. > | > | It is bound to C-c C-v v, C-c C-v C-v. > | > | (org-babel-expand-src-block &optional ARG INFO PARAMS) > | > | Expand the current source code block. > | Expand according to the source code block=E2=80=99s header > | arguments and pop open the results in a preview buffer. > | > | [back] > `---- > > In your case, it shows that the `mtelsquare' src block expands to: > > > ,---- > | (let ((x (quote 0))) > | (defun myelsquare (x) > | (* x x)) > | ) > `---- > > > ,----[ C-h k C-x C-e ] > | C-x C-e runs the command eval-last-sexp (found in global-map), which > | is an interactive compiled Lisp function in =E2=80=98elisp-mode.el=E2= =80=99. > | > | It is bound to C-x C-e. > | > | (eval-last-sexp EVAL-LAST-SEXP-ARG-INTERNAL) > | > | Evaluate sexp before point; print value in the echo area. > | Interactively, with prefix argument, print output into current buffer. > | > | Normally, this function truncates long output according to the value > | of the variables =E2=80=98eval-expression-print-length=E2=80=99 and > | =E2=80=98eval-expression-print-level=E2=80=99. With a prefix argument = of zero, > | however, there is no such truncation. Such a prefix argument > | also causes integers to be printed in several additional formats > | (octal, hexadecimal, and character). > | > | If =E2=80=98eval-expression-debug-on-error=E2=80=99 is non-nil, which i= s the default, > | this command arranges for all errors to enter the debugger. > | > | [back] > `---- > > So with point at the end of the preview buffer for myelsquare (which has > one `let' expression it it) it has the same effect as running > `eval-buffer'. viz, the elisp function `myelsquare' is created. > > If you have gotten this far, there is an lisp function called `myelsquare= ' > and the `symbol-function' expression will return its value when properly > `eval'ed. I misspoke before. I should have said > > M-: (symbol-function 'myelsquare) RET > > And that value is `(lambda (x) (* x x))'. Which simply shows you have > defun'ed a function and what it is. > > Once you have an elisp function, the natural way to call it is > src_emacs-lisp{(myelsquare 1.5)}. > > One thing you can do with LOB blocks is use them in header args of src > blocks just as you would use calls to ordinary src blocks. > > HTH, > > Chuck > > > --00000000000029fbd105698312fa Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks for the help. However, one mystery still remains: W= hy is this

=C2=A0'(org-babel-lob-files (quote ("= ;~/org/worg/library-of-babel.org")))


On Fri, Apr 6, 2018 at 10:38 PM, Berry, Charles = <ccberry@ucsd.edu<= /a>> wrote:


> On Apr 6, 2018, at 4:59 PM, Thomas S. Dye <
tsd@tsdye.com> wrote:
>

[Tom's response covering the main issues deleted]

> hth,
> Tom
>
> Lawrence Bottorff writes:
>
>> I guess I need more information. For example, what is C-c C-v v do= ing
>> exactly? Then C-x C-e? And=C2=A0 M-x (symbol-function 'myelsqu= are) doesn't work.


`C-h k' is really your friend here. If you do not know it, try t= yping it twice `C-h k C-h k'.

As for the specific keystrokes mentioned above:

,----[ C-h k C-c C-v v ]
| C-c C-v v runs the command org-babel-expand-src-block (found in
| org-mode-map), which is an interactive autoloaded compiled Lisp
| function in =E2=80=98ob-core.el=E2=80=99.
|
| It is bound to C-c C-v v, C-c C-v C-v.
|
| (org-babel-expand-src-block &optional ARG INFO PARAMS)
|
| Expand the current source code block.
| Expand according to the source code block=E2=80=99s header
| arguments and pop open the results in a preview buffer.
|
| [back]
`----

In your case, it shows that the `mtelsquare' src block expands to:


,----
| (let ((x (quote 0)))
| (defun myelsquare (x)
|=C2=A0 =C2=A0(* x x))
| )
`----


,----[ C-h k C-x C-e ]
| C-x C-e runs the command eval-last-sexp (found in global-map), which
| is an interactive compiled Lisp function in =E2=80=98elisp-mode.el=E2=80= =99.
|
| It is bound to C-x C-e.
|
| (eval-last-sexp EVAL-LAST-SEXP-ARG-INTERNAL)
|
| Evaluate sexp before point; print value in the echo area.
| Interactively, with prefix argument, print output into current buffer. |
| Normally, this function truncates long output according to the value
| of the variables =E2=80=98eval-expression-print-length=E2=80=99 and
| =E2=80=98eval-expression-print-level=E2=80=99.=C2=A0 With a prefix argume= nt of zero,
| however, there is no such truncation.=C2=A0 Such a prefix argument
| also causes integers to be printed in several additional formats
| (octal, hexadecimal, and character).
|
| If =E2=80=98eval-expression-debug-on-error=E2=80=99 is non-nil, whic= h is the default,
| this command arranges for all errors to enter the debugger.
|
| [back]
`----

So with point at the end of the preview buffer for myelsquare (which has on= e `let' expression it it) it has the same effect as running `eval-buffe= r'. viz, the elisp function `myelsquare' is created.

If you have gotten this far, there is an lisp function called `myelsquare&#= 39; and the `symbol-function' expression will return its value when pro= perly `eval'ed. I misspoke before. I should have said

=C2=A0 =C2=A0 =C2=A0 =C2=A0 M-: (symbol-function 'myelsquare) RET

And that value is `(lambda (x) (* x x))'. Which simply shows you have d= efun'ed a function and what it is.

Once you have an elisp function, the natural way to call it is src_emacs-li= sp{(myelsquare 1.5)}.

One thing you can do with LOB blocks is use them in header args of src bloc= ks just as you would use calls to ordinary src blocks.

HTH,

Chuck



--00000000000029fbd105698312fa--