emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Thomas S. Dye" <tsd@tsdye.com>
To: Lawrence Bottorff <borgauf@gmail.com>
Cc: emacs-orgmode Mailinglist <emacs-orgmode@gnu.org>,
	"Berry, Charles" <ccberry@ucsd.edu>
Subject: Re: Library of Babel confusion
Date: Tue, 10 Apr 2018 09:26:45 -1000	[thread overview]
Message-ID: <m23702vp56.fsf@tsdye.com> (raw)
In-Reply-To: <CAFAhFSWrZM-qsKsLfTX5nfep+Whe3geqZPxFXSstGqZ25Nyo-w@mail.gmail.com>

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 
> <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  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 ‘ob-core.el’.
>> |
>> | 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’s 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 ‘elisp-mode.el’.
>> |
>> | 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 ‘eval-expression-print-length’ and
>> | ‘eval-expression-print-level’.  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 ‘eval-expression-debug-on-error’ 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 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
>>
>>
>>


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

  reply	other threads:[~2018-04-11 19:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-03 20:31 Library of Babel confusion Lawrence Bottorff
2018-04-03 20:44 ` Nicolas Goaziou
2018-04-04 22:52   ` Lawrence Bottorff
2018-04-03 21:39 ` Berry, Charles
2018-04-06 22:15   ` Lawrence Bottorff
2018-04-06 23:59     ` Thomas S. Dye
2018-04-07  2:38       ` Berry, Charles
2018-04-10 18:55         ` Lawrence Bottorff
2018-04-10 19:26           ` Thomas S. Dye [this message]
2018-04-11 13:29             ` Lawrence Bottorff
2018-04-11 16:57               ` Thomas S. Dye
2018-04-11 18:20               ` Berry, Charles

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m23702vp56.fsf@tsdye.com \
    --to=tsd@tsdye.com \
    --cc=borgauf@gmail.com \
    --cc=ccberry@ucsd.edu \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).