mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-25 16:02:52 +00:00
Updated notes on implementation of library functions.
This commit is contained in:
parent
b300b62b9c
commit
f1ba541bf3
|
@ -3,7 +3,12 @@
|
||||||
#+OPTIONS: H:3 num:nil toc:t
|
#+OPTIONS: H:3 num:nil toc:t
|
||||||
#+STARTUP: odd hideblocks
|
#+STARTUP: odd hideblocks
|
||||||
|
|
||||||
[[http://downlode.org/Etext/library_of_babel.html][Full text of Borges short story]]
|
(setq lob (org-babel-lob-parse-buffer))
|
||||||
|
(setq x (gethash 'plot lob))
|
||||||
|
(hash-table-count lob)
|
||||||
|
(maphash (lambda (key val) (insert key)) lob)
|
||||||
|
|
||||||
|
[[http://downlode.org/Etext/library_of_babel.html][Full text of the Borges short story]]
|
||||||
|
|
||||||
* Plotting code
|
* Plotting code
|
||||||
Plot column 2 (y axis) against column 1 (x axis). Columns 3 and beyond, if present, are ignored.
|
Plot column 2 (y axis) against column 1 (x axis). Columns 3 and beyond, if present, are ignored.
|
||||||
|
|
|
@ -116,6 +116,12 @@ and the results to be collected in the same table.
|
||||||
|
|
||||||
* Tasks [22/41]
|
* Tasks [22/41]
|
||||||
** TODO add a function to jump to a source-block by name
|
** TODO add a function to jump to a source-block by name
|
||||||
|
I've had an initial stab at that in org-babel-find-named-block
|
||||||
|
(library-of-babel branch).
|
||||||
|
|
||||||
|
At the same time I introduced org-babel-named-src-block-regexp, to
|
||||||
|
match src-blocks with srcname.
|
||||||
|
|
||||||
** TODO Create objects in top level (global) environment [3/5]
|
** TODO Create objects in top level (global) environment [3/5]
|
||||||
*sessions*
|
*sessions*
|
||||||
|
|
||||||
|
@ -882,11 +888,11 @@ msg + " y python"
|
||||||
one that comes to mind is the ability to treat a source-code block
|
one that comes to mind is the ability to treat a source-code block
|
||||||
like a function which accepts arguments and returns results. Actually
|
like a function which accepts arguments and returns results. Actually
|
||||||
this can be it's own TODO (see [[* source blocks as functions][source blocks as functions]]).
|
this can be it's own TODO (see [[* source blocks as functions][source blocks as functions]]).
|
||||||
*** Objectives
|
*** Objectives [Dan]
|
||||||
- We want to provide convenient off-the-shelf actions
|
- We want to provide convenient off-the-shelf actions
|
||||||
(e.g. plotting data) that make use of our new code evaluation
|
(e.g. plotting data) that make use of our new code evaluation
|
||||||
environment but do not require any actual coding.
|
environment but do not require any actual coding.
|
||||||
*** Design proposal
|
*** Initial Design proposal [Dan]
|
||||||
- *Input data* will be specified using the same mechanism as :var
|
- *Input data* will be specified using the same mechanism as :var
|
||||||
references, thus the input data may come from a table, or
|
references, thus the input data may come from a table, or
|
||||||
another source block, and it is initially available as an elisp
|
another source block, and it is initially available as an elisp
|
||||||
|
@ -909,6 +915,21 @@ msg + " y python"
|
||||||
be executed with the :data referent passed in using a :var arg.
|
be executed with the :data referent passed in using a :var arg.
|
||||||
- :showcode or something controlling whether to show the code
|
- :showcode or something controlling whether to show the code
|
||||||
|
|
||||||
|
*** Modification to design
|
||||||
|
I'm implementing this, at least initially, as a new interpreter
|
||||||
|
named 'babel', which has an empty body. 'babel' blocks take
|
||||||
|
a :srcname header arg, and look for the source-code block with
|
||||||
|
that name. They then execute the referenced block, after first
|
||||||
|
appending their own header args on to the target block's header
|
||||||
|
args.
|
||||||
|
|
||||||
|
If the target block is in the library of babel (a.o.t. e.g. the
|
||||||
|
current buffer), then the code in the block will refer to the
|
||||||
|
input data with a name dictated by convention (e.g. __data__
|
||||||
|
(something which is syntactically legal in all languages...). Thus
|
||||||
|
the babel block will use a :var __data__ = whatever header arg to
|
||||||
|
reference the data to be plotted.
|
||||||
|
|
||||||
** TODO share org-babel
|
** TODO share org-babel
|
||||||
how should we share org-babel?
|
how should we share org-babel?
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue