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