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