Commit Graph

17 Commits

Author SHA1 Message Date
Eric Schulte 44bb82d38e babel: `org-babel-ref-resolve-reference' doesn't break paren nesting when resolving indicies 2010-04-24 13:26:34 -06:00
Eric Schulte 927ff1125b babel: `org-babel-ref-index-list' now converts trivial lists to scalars
Thanks to Darlan Cavalcante Moreira for this suggestion.
2010-04-21 09:35:13 -06:00
Eric Schulte 8ef104195f babel: use wildcard "*" characters in `org-babel-ref-index-list' to index entire ranges 2010-04-02 08:46:13 -06:00
Dan Davison a23ca4529f babel: Get rid of parameter inheritance by reference blocks 2010-03-27 18:49:00 -04:00
Eric Schulte 692c569215 babel: smarter `org-babel-ref-split-args' -- fixes bug parsing indexed function-style args 2010-02-14 11:48:28 -07:00
Eric Schulte 2531d704c0 babel: now able to reference links as results 2010-02-09 20:30:28 -07:00
Eric Schulte dc5c41fbdc org-babel: fixed typo in reference resolution for #+results: lines 2009-11-29 10:00:19 -07:00
Eric Schulte 91661d2f3b org-babel: #+srcname: can now be called #+source: or #+function:
source name regular expression has been extracted into a variable
  and multiple aliases are allowed.
2009-11-20 10:42:51 -07:00
Eric Schulte 2f8d30a578 org-babel: now using #+results instead of #+resname
"results" is now an acceptable alias for "resname".  Org-babel
    will begin inserting results using the "results" option however
    either option will remain viable moving forward.
2009-11-20 10:42:50 -07:00
Eric Schulte 1453f0294d org-babel: Hash based caching of results in buffer
This commit expands the #+resname: line to include a sha1 hash of
  the contents of the source-code block (including header arguments).
  This hash is saved in raw text in the resname line.  When a source
  block is evaluated it's hash is recalculated and checked against the
  hash in it's results line, if they are equal the current results are
  returned with no recalculation.

  Optional prefix argument when evaluating a source block will force
  re-calculation.

  caching behavior can be inhibited through the use of the :nocache
  header argument.  for global inhibition of caching add :nocache to
  the `org-babel-default-header-args' variable.
2009-11-20 10:42:33 -07:00
Eric Schulte 1d2bab1fb8 org-babel: variable values are now indexable
it is now possible to only assign a portion of a value to a variable
  in a source block.  So for example the following will only assign
  the second and third lines of the table 'example-table' to the
  variable 'data'

  :var data=example-table[1:2]

  and the following will only assign the second column of the first row

  :var data=example-table[0,1]

  note that all indices are 0 based

  it is possible to index into the results of source-code blocks as
  well as tables.  any number of dimensions can be indexed as long as
  they are separated by ','s and ranges can be indexed using the ':'
  operator.  for more information on indexing behavior see
  `org-babel-ref-index-list'
2009-11-14 20:18:12 -07:00
Eric Schulte 082fb84c34 org-babel: cleaner passing of parameter to language specific files 2009-11-10 15:23:00 -07:00
Eric Schulte 62c8d0a835 org-babel: foreign-file references work, export is fully functional
1) source blocks can now reference source-blocks in other files using
   the filename:sourcename syntax

2) on export all references are now made to explicitly point to the
   original buffer using the filename:sourcename syntax.  This ensures
   that all references are correctly resolved on export, even when the
   referenced source block has already been processed.
2009-10-23 16:02:24 -06:00
Dan Davison 4dba8ad21f org-babel: a bug in reference-resolution caused by a typo 2009-10-19 23:33:13 -04:00
Dan Davison 0d10946cff org-babel: nested calls inherit header args from enclosing scopes
And when merging header args, those from enclosing scopes take
precedence. For example, output to file from a source block is
implemented by (a) sending the output to file, and (b) having the
source block return the file name as its result. Before this change,
the file name returned could be set by a referenced source block (a
nested call), regardless of the value of the :file header arg of the
top-level source block.
2009-10-19 23:33:03 -04:00
Dan Davison 286bf35fe5 org-babel: bugfix: tighten up regexp
Prior to this, reference resolution could fail with quoted
strings. E.g. this didn't work:

\#+srcname: py-id(a=1)
\#+begin_src python
  a
\#+end_src

\#+lob: py-id(a="1")
2009-10-19 23:32:14 -04:00
Eric Schulte c0554c7753 merging with the org-babel repository 2009-09-11 13:44:05 -06:00