Commit graph

444 commits

Author SHA1 Message Date
Dan Davison 2b273bce7d Different messages for :results output and value modes. 2009-07-16 01:16:49 -04:00
Dan Davison 213b045359 Updating main org file and tidying library-of-babel.org. 2009-07-11 23:59:51 -04:00
Dan Davison c1f8de5eec Cosmetic changes only: shortening lines to fit my screen. 2009-07-11 23:59:04 -04:00
Dan Davison 08eba0ceea Bugfix: my regexp was not allowing whitespace inside function call. 2009-07-11 23:51:01 -04:00
Dan Davison a0e0fe17f4 A neutral bug (unnecessary, but no consequences I believe). 2009-07-11 23:49:51 -04:00
Dan Davison 21d058869d Bugfix in org-babel-read (relevant to all branches).
I haven't managed to see why this is a 2. It breaks if cell is a
string of length 1. I'm changing it to a 1 (as it is in
org-collector.el), on the assumption that the 2 was erroneous.
2009-07-11 22:45:57 -04:00
Dan Davison cd4c794af6 Bugfix: Use let* instead of let 2009-07-11 13:39:05 -04:00
Dan Davison f622d8d288 Bugfix: In org-babel-merge-params.
Using symbol instead of string so that assq-delete-all works. This
will break if a variable has a name that is not a valid elisp symbol
-- unlikely? Possible? Also, fixing the argument parsing regexp, which
had been very lazily written.
2009-07-11 03:07:37 -04:00
Dan Davison ee749f4d70 Bugfix:
I had made org-babel-get-src-block-name automatically check whether it
was on a lob line. I'm reverting that.
2009-07-11 03:04:41 -04:00
Dan Davison 0a6fa24cc5 bugfix: org-babel-parse-header-arguments was creating nonsense when passed an empty string. 2009-07-11 03:01:54 -04:00
Dan Davison af6af0b848 Tightening up org-babel-lob-one-liner-regexp. 2009-07-10 23:15:16 -04:00
Dan Davison 44adc98505 Enabling LoB to put results in buffer, and slowly moving towards more
unified concept of function calls.

Previously LoB calls were not able to produce results in the
buffer. These changes go some way to allowing them to do that. [There
are still some bugs to deal with]. That meant changing org-babel.el so
that there is a notion of the `source block name' for a LoB line, in
order to construct a #+resname (currently I've made the name the same
as the function call).

I'm also slowly moving towards unifying the notion of `function calls'
a bit more: I've changed the org-babel-lob-one-liner-regexp so that
instead of a monolithic match it now matches first the function name,
and second the function arguments in
parentheses. org-babel-lob-get-info makes that match, and although it
still concatenates them and returns the string, the two elements can
be accessed immediately afterwards using match-string. So that
situation is very similar to org-babel-get-src-block-name, whose
job (in this branch) is also to parse the function *name* and the
function *arguments*. In a few places in the code (esp. function
names), I think the word `info' should be replaced with `call' or
`function call', which I believe more accurately indicates what the
`info' is: a function definition, together with bound
arguments/references.

The function call syntax, i.e. function-name(arg1=ref1), originally
introduced for references (and thereby in LoB), and which I'm
proposing we use throughout, raises the question of default arguments,
and those being over-ridden by supplied arguments, as in e.g. python,
and R.
2009-07-10 22:59:10 -04:00
Dan Davison 42fe3144b7 Some more bugs / TODOs, and some unimportant changes. 2009-07-10 21:13:21 -04:00
Dan Davison eb7206f744 Fixing function call-style source block arguments.
style syntax. There still needs to be work done on the regexps for
recognising #+srcname lines possibly with/without parenthesised
arguments. This change makes org-babel-block-name return nil rather
than fail when it doesn't find a src block head (e.g. in a #+lob
line), which seems sensible.

The sbe test table is failing half-way down at `simple ruby
arrays'. For some reason it is making a mini table ("| |") to the
right hand, and point keeps jumping out of the table. My ability to
debug sbe-related stuff is hampered by me not understanding the
code (I need to learn about macros).
2009-07-10 18:38:12 -04:00
Dan Davison 41381781bb Using function call() style source block arguments.
This is a rough, first-pass implementation using some code from
org-babel-ref.el. If we do go with this idea, I think we can find a
better implementation, hopefully using the same code for parsing
`function calls' (parameterised source block calls), whether they are
made directly at a source block, or as a reference in another function
call, or as a LoB call.
2009-07-10 01:35:15 -04:00
Dan Davison c1b72bfba8 Trivial typo fixing 2009-07-10 01:20:56 -04:00
Dan Davison 2bddc5fdf8 Revert "Moving non-language specific code out of language-specific files."
This reverts commit 0f541a680d.

See commit note for parent commit. Both reversions made for same reason.
2009-07-08 00:13:07 -04:00
Dan Davison 9772adef3e Revert "Altering org-babel-execute:emacs-lisp in accordance with preceding changes."
This reverts commit d8001facab.

Going back to original plan of simply passing (cmd body params) to the org-babel-execute:LANG functions.

The benefit of this is that languages will have access to the full params list. A downside is that code parsing the
params list and referencing variables is currently duplicated across the languages, so perhaps we can aim to reduce
that code duplication at some point.
2009-07-08 00:06:14 -04:00
Dan Davison 5cbc2d3803 Using the new org-babel-merge-params function to combine default args with header args provided. 2009-07-07 23:57:49 -04:00
Dan Davison 060e013c90 Adding Dan's incipient worg document 2009-07-07 19:57:25 -04:00
Dan Davison 7e80d01571 Now we have a function for merging params lists, so in theory this reversion can be reverted.
Revert "Revert "making :results replace the default""

This reverts commit dc702a3152.
2009-07-07 19:48:19 -04:00
Dan Davison 9d79afb3b3 Merge branch 'working-on-combining-params' into results 2009-07-07 19:46:10 -04:00
Dan Davison 5280e5ea4f Attempt at a working version of the org-babel-merge-params function. 2009-07-07 19:44:27 -04:00
Dan Davison d8001facab Altering org-babel-execute:emacs-lisp in accordance with preceding changes. 2009-07-05 23:09:28 -04:00
Dan Davison 0f541a680d Moving non-language specific code out of language-specific files.
Moved reference resolution out of language-specific files; changed
things so that we parse the header args list in org-babel.el, and
changed the argument list of the org-babel-execute:LANG functions
accordingly. In addition to hopefully resulting in easier maintenance,
this results in more streamlined org-babel-execute:LANG functions, and
hence less work to do when adding interpreters.
2009-07-05 22:36:51 -04:00
Dan Davison 6143bb7aad Streamlining/fiddling with org-babel-execute-src-block.
This includes an explicit implementation of the idea that no result is
returned in the case of :results output.
2009-07-05 21:57:42 -04:00
Dan Davison f7ea8ccb2e Added comment to org-babel-process-result explaining
results-processing changes and state they are currently in. Here's the
comment:

  You can see below the various fragments of results-processing
  code that were present in the language-specific files. Out of
  those fragments, I've moved the
  org-babel-python-table-or-results and
  org-babel-import-elisp-from-file functionality into the
  org-babel-*-evaluate functions. I think those should only be
  used in the :results value case, as in the 'output case we are
  not concerned with creating elisp versions of results.

  The rest of the functionality below, concerned with vectorising
  or scalarising results is commented out, has not yet been
  replaced, and may need to be reinstated in this function
2009-07-05 21:37:00 -04:00
Dan Davison dc702a3152 Revert "making :results replace the default"
This reverts commit a13cbf64b6.

I'm in favour of this change, but it seems that we need a more sophisticated way of combining plists before we can
change the default header args in this way. Otherwise, we get two entries for :results (one from the defaults and one
from the header args), whereas what we want is a single entry for :results with space-separated values.
2009-07-05 21:23:47 -04:00
Dan Davison df3b1b7223 Fixing results processing code.
When :results is 'value, the org-babel-LANG-evaluate functions are
responsible for returning an elisp representation of the *value* of
the block. This stage is maintained in the language-specific code
because different languages have different ways of doing it: python
and ruby use org-babel-LANG-table-or-string, whereas R and shell write
to file and then use org-babel-import-elisp-from-file. It could
however be put in the org-babel-execute:LANG function.
2009-07-05 21:23:17 -04:00
Dan Davison 9750226de7 Ruby version of previous commit.
Bug fix: I was missing out org-babel-table-or-string with external
    process evaluation (non-session).

    Also, I have renamed org-babel-ruby-table-or-results to org-babel-ruby-table-or-string.

    (the previous commit's message should have read org-babel-python-table-or-results...)
2009-07-05 19:59:24 -04:00
Dan Davison e45cf15b06 Bug fix: I was missing out org-babel-table-or-string with external
process evaluation (non-session).

Also, I have renamed org-babel-table-or-results to org-babel-table-or-string.
2009-07-05 19:55:54 -04:00
Dan Davison ad6eaadd39 Unimportant changes to org-babel.org (need for these to be merged into
master branch)
2009-07-05 19:24:29 -04:00
Dan Davison 305c90b892 First stage of results code simplification.
Results processing code has been moved out of language-specific
files (which all contained similar versions of essentially the same
code) and into the central org-babel.el. This commit maintains the
removed language-specific fragments commented out in org-babel.el. It
does not make an attempt to replace their functionality (the new
function org-babel-process-result currently does nothing).

Similarly, I intend to move the reference resolution code out of
language-specific files.
2009-07-05 19:23:32 -04:00
Dan Davison 07b69e8646 Removing results processing code from org-babel-R.el.
And removing default results-type case (results-type must always be
either output or value)
2009-07-05 19:19:14 -04:00
Dan Davison a285289603 Simplifying ruby results code.
Moving org-babel-ruby-table-or-results into the :results value branch of org-babel-evaluate-ruby
2009-07-05 19:17:47 -04:00
Dan Davison 500285da97 Removing results processing code from org-babel-ruby.el. 2009-07-05 19:16:44 -04:00
Dan Davison 93a964d236 Simplifying python results code.
Move org-babel-python-table-or-results into the :results value branch
of org-babel-python-evaluate, and get rid of default case (result-type
must always be either output or value). I wonder if the org-babel-trim
s are necessary: they don't seem to be needed in the code for ruby.
2009-07-05 19:16:08 -04:00
Dan Davison f4eaee5b46 Trivial cosmetic: shortening lines to fit screen 2009-07-05 19:12:06 -04:00
Dan Davison 337f77c10c Removing results processing from org-babel-python.el 2009-07-05 19:11:40 -04:00
Dan Davison afdf02b910 Removing results processing from org-babel-sh.el 2009-07-05 19:10:45 -04:00
Dan Davison 2fb922aaa7 Trivial cosmetic: shortening a line to make it fit on screen 2009-07-05 16:08:07 -04:00
Dan Davison a06c910f37 cosmetic: removing commented debugging code; shortening some lines 2009-07-05 15:52:41 -04:00
Dan Davison 3c932ad603 removing mention of 'babel' as a supported interpreter 2009-07-05 13:53:52 -04:00
Dan Davison 6087aa7c31 Making some lines shorter and other trivial cosmetics 2009-07-05 13:52:21 -04:00
Dan Davison a13cbf64b6 making :results replace the default 2009-07-05 13:50:25 -04:00
Dan Davison adcfa3c54b Some todos/bug notes in org-babel.org 2009-06-30 20:46:51 -04:00
Eric Schulte 74b9c8f125 slight simplification 2009-06-27 17:26:07 -07:00
Eric Schulte 978104f1ae broke tangled source block collection out into it's own function 2009-06-27 17:25:01 -07:00
Eric Schulte a7c0852264 updated .gitignore to ignore tangled files 2009-06-27 13:37:37 -07:00
Eric Schulte 87e07ee66d added completion message to `org-babel-tangle' 2009-06-27 13:36:51 -07:00