Jelajahi Sumber

Updating main org file and tidying library-of-babel.org.

Dan Davison 16 tahun lalu
induk
melakukan
213b045359
2 mengubah file dengan 66 tambahan dan 47 penghapusan
  1. 12 20
      library-of-babel.org
  2. 54 27
      org-babel.org

+ 12 - 20
library-of-babel.org

@@ -5,24 +5,15 @@
 
 
 [[http://downlode.org/Etext/library_of_babel.html][Full text of the Borges short story]]
 [[http://downlode.org/Etext/library_of_babel.html][Full text of the 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)
-
-
 * 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.
 
 
-
 #+srcname: R-plot(data=R-plot-example-data)
 #+srcname: R-plot(data=R-plot-example-data)
 #+begin_src R :session *R*
 #+begin_src R :session *R*
 plot(data)
 plot(data)
 "R plot complete"
 "R plot complete"
 #+end_src
 #+end_src
 
 
-
-
 #+tblname: R-plot-example-data
 #+tblname: R-plot-example-data
 | 1 |  2 |
 | 1 |  2 |
 | 2 |  4 |
 | 2 |  4 |
@@ -32,18 +23,19 @@ plot(data)
 
 
 #+lob: R-plot(data=R-plot-example-data)
 #+lob: R-plot(data=R-plot-example-data)
 
 
+#+resname: R-plot(data=R-plot-example-data)
+: R plot complete
 
 
-
-#+tblname: XX
-| 1 |      1 |
-| 2 |     .5 |
-| 3 |  .3333 |
-| 4 |    .25 |
-| 5 |     .2 |
-| 6 |  .1666 |
-| 7 | 0.1428 |
-
-#+srcname: python-identity(a=5)
+* Etc
+#+srcname: python-identity(a=1)
 #+begin_src python
 #+begin_src python
 a
 a
 #+end_src
 #+end_src
+
+#+srcname: python-add(a=1, b=2)
+#+begin_src python
+a + b
+#+end_src
+
+
+

+ 54 - 27
org-babel.org

@@ -191,7 +191,7 @@ would then be [[#sandbox][the sandbox]].
 #+end_src
 #+end_src
 
 
 
 
-* Tasks [27/42]
+* Tasks [28/43]
 ** TODO support for working with =*Org Edit Src Example*= buffers [2/4]
 ** TODO support for working with =*Org Edit Src Example*= buffers [2/4]
 *** TODO optionally evaluate header references when we switch to =*Org Edit Src*= buffer
 *** TODO optionally evaluate header references when we switch to =*Org Edit Src*= buffer
 That seems to imply that the header references need to be evaluated
 That seems to imply that the header references need to be evaluated
@@ -574,7 +574,6 @@ Another example is in the [[*operations%20in%20on%20tables][grades example]].
 *** Current design
 *** Current design
     This is covered by the [[file:library-of-babel.org][Library of Babel]], which will contain
     This is covered by the [[file:library-of-babel.org][Library of Babel]], which will contain
     ready-made source blocks designed to carry out useful common tasks.
     ready-made source blocks designed to carry out useful common tasks.
-
 ** PROPOSED Are we happy with current behaviour regarding vector/scalar output?
 ** PROPOSED Are we happy with current behaviour regarding vector/scalar output?
 This simple example of multilingual chaining produces vector output if
 This simple example of multilingual chaining produces vector output if
 there are spaces in the message and scalar otherwise.
 there are spaces in the message and scalar otherwise.
@@ -824,6 +823,8 @@ $0
 [[file:snippets/org-mode/sb][sb -- snippet]]
 [[file:snippets/org-mode/sb][sb -- snippet]]
 
 
 waiting for guidance from those more familiar with yasnippets
 waiting for guidance from those more familiar with yasnippets
+
+** DONE LoB: allow output in buffer
 ** DONE add a function to jump to a source-block by name
 ** DONE 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
    I've had an initial stab at that in org-babel-find-named-block
    (library-of-babel branch).
    (library-of-babel branch).
@@ -1913,7 +1914,7 @@ This could probably be added to [[file:lisp/org-babel-script.el][org-babel-scrip
 (see [[* file result types][file result types]])
 (see [[* file result types][file result types]])
 
 
 
 
-* Bugs [17/26]
+* Bugs [17/28]
 ** TODO Allow source blocks to be recognised when #+ are not first characters on the line
 ** TODO Allow source blocks to be recognised when #+ are not first characters on the line
    I think Carsten has recently altered the core so that #+ can have
    I think Carsten has recently altered the core so that #+ can have
    preceding whitespace, at least for literal/code examples. org-babel
    preceding whitespace, at least for literal/code examples. org-babel
@@ -1963,33 +1964,35 @@ even a third"
 ** TODO are the org-babel-trim s necessary?
 ** TODO are the org-babel-trim s necessary?
    at the end of e.g. org-babel-R-evaluate, org-babel-python-evaluate, but
    at the end of e.g. org-babel-R-evaluate, org-babel-python-evaluate, but
    not org-babel-ruby-evaluate
    not org-babel-ruby-evaluate
-** TODO use new merge function [[file:lisp/org-babel-ref.el::t%20nil%20org%20combine%20plists%20args%20nil][here]] and [[file:lisp/org-babel.el::params%20org%20combine%20plists%20params%20third%20info][here]]?
-   And at other occurrences of org-combine-plists?
-
-** TODO #+lob: calls fail if reference has single character name
-*** This doesn't work
-#+lob: R-plot(data=X)
-
-#+tblname: X
-| 1 |     1 |
-| 2 |    .5 |
-| 3 | .3333 |
-| 4 |   .25 |
-| 5 |    .2 |
-| 6 | .1666 |
+** results branch bugs
+*** TODO use new merge function [[file:lisp/org-babel-ref.el::t%20nil%20org%20combine%20plists%20args%20nil][here]] and [[file:lisp/org-babel.el::params%20org%20combine%20plists%20params%20third%20info][here]]?
+    And at other occurrences of org-combine-plists?
+*** TODO LoB: with output to buffer, not working in buffers other than library-of-babel.org
+    I haven't fixed this yet. org-babel-ref-resolve-reference moves
+    point around, inside a save-excursion. Somehow when it comes to
+    inserting the results (after possible further recursive calls to
+    org-babel-ref-resolve-reference), point hasn't gone back to the
+    lob line.
+*** TODO LoB: output to buffer adds creeping blank lines
+   Compare the results of
+#+lob: python-add(a=5, b=17)
+
+#+resname: python-add(a=5, b=17)
+: 22
+--------------------------------
 
 
-*** But this is OK
-#+tblname: XX
-| 1 |     1 |
-| 2 |    .5 |
-| 3 | .3333 |
-| 4 |   .25 |
-| 5 |    .2 |
-| 6 | .1666 |
-
-#+lob: R-plot(data=XX)
+#+begin_src python
+23
+#+end_src
 
 
+#+resname:
+: 23
+---------------------
 
 
+   Hmm, it's a bit confusing. I think it's to do with the fact that
+   LoB removes the entire (#+resname and result) and starts from
+   scratch, whereas #+begin_src only removes the result. I haven't
+   worked out what the correct fix is yet.
 ** DEFERRED weird escaped characters in shell prompt break shell evaluation
 ** DEFERRED weird escaped characters in shell prompt break shell evaluation
    E.g. this doesn't work. Should the shell sessions set a sane prompt
    E.g. this doesn't work. Should the shell sessions set a sane prompt
    when they start up? Or is it a question of altering
    when they start up? Or is it a question of altering
@@ -2018,6 +2021,30 @@ even a third"
    the user's regular emacs init.  I can't think of a way for us to
    the user's regular emacs init.  I can't think of a way for us to
    set this automatically, and we are SOL without a regexp to match
    set this automatically, and we are SOL without a regexp to match
    the prompt.
    the prompt.
+
+** DONE LoB: calls fail if reference has single character name
+   commit 21d058869df1ff23f4f8cc26f63045ac9c0190e2
+**** This doesn't work
+#+lob: R-plot(data=X)
+
+#+tblname: X
+| 1 |     1 |
+| 2 |    .5 |
+| 3 | .3333 |
+| 4 |   .25 |
+| 5 |    .2 |
+| 6 | .1666 |
+
+**** But this is OK
+#+tblname: XX
+| 1 |     1 |
+| 2 |    .5 |
+| 3 | .3333 |
+| 4 |   .25 |
+| 5 |    .2 |
+| 6 | .1666 |
+
+#+lob: R-plot(data=XX)
 ** DONE ruby evaluation not working under ubuntu emacs 23
 ** DONE ruby evaluation not working under ubuntu emacs 23
    With emacs 23.0.91.1 on ubuntu, for C-h f run-ruby I have the
    With emacs 23.0.91.1 on ubuntu, for C-h f run-ruby I have the
    following, which seems to conflict with [[file:lisp/langs/org-babel-ruby.el::let%20session%20buffer%20save%20window%20excursion%20run%20ruby%20nil%20session%20current%20buffer][this line]] in org-babel-ruby.el.
    following, which seems to conflict with [[file:lisp/langs/org-babel-ruby.el::let%20session%20buffer%20save%20window%20excursion%20run%20ruby%20nil%20session%20current%20buffer][this line]] in org-babel-ruby.el.