Commit Graph

235 Commits

Author SHA1 Message Date
Dan Davison 4cbedbff1a org-babel: Fix insertion of new results
Insertion of new results was failing if the block was followed by
end-of-buffer. Also, if the block was followed by non-empty lines, the
\#+resname was being inserted away from column 0.
2009-11-27 20:28:27 -07:00
Eric Schulte bec1643a40 org-babel-sh: fixed session-based evaluation for sh blocks 2009-11-27 12:31:28 -07:00
Eric Schulte 4b6d270b16 org-babel: bug fix, now possible to evaluate source blocks before the first heading 2009-11-20 19:38:23 -07:00
Eric Schulte 5b749d2fe9 org-babel: fixing documentation of `org-babel-tangle-langs' 2009-11-20 10:43:15 -07:00
Eric Schulte 222f5c23e8 org-babel: results are now foldable
pressing tab while on the front of a results line will fold the
  results in the same manner as tabbing on the front of a block will
  fold the block.  To automatically hide all blocks when entering a
  new file add the `org-babel-result-hide-all' function to your
  `org-mode-hook'
2009-11-20 10:43:14 -07:00
Eric Schulte 45cce02402 org-babel: caching bugfixes
- the match-string was thrown off by an earlier commit
  - now sorting the parameters to ensure consistent order when
  - generating hashes
2009-11-20 10:43:06 -07:00
Dan Davison 2f05cf41ff org-babel: allow header arg values to be lisp forms.
This allows e.g.

:file (format "%s/images/pca-scatter.png" dir)
2009-11-20 10:42:54 -07:00
Dan Davison bf6089d8de org-babel: allow aliases for #+lob
This introduces #+call as an alias for #+lob.
2009-11-20 10:42:53 -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 f4f38bd33a org-babel: results hashes are now hidden (for the most part)
The initial `org-babel-hash-show' characters of the hash will
   remain visible.  Pressing C-c C-c with the point on one of these
   initial characters will copy the hash to the kill ring, should you
   need to know it for any particular reason.
2009-11-20 10:42:48 -07:00
Eric Schulte 403c92f676 org-babel: set default behavior to non-caching in `org-babel-default-header-args'
This can be overridden with the use of the header argument :cache on
  the block, or subtree level.  To set the global behavior to caching
  add the following to your emacs init

  (setq org-babel-default-header-args
        (delete '(:nocache) org-babel-default-header-args))
2009-11-20 10:42:47 -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
Carsten Dominik 44aab15748 org-export-generic.el: Use `aput' 2009-11-20 06:54:18 +01:00
Carsten Dominik 764dc91fe3 org-git-gitrepos-p: Make definition XEmacs compatible. 2009-11-20 06:40:33 +01:00
Eric Schulte 4646bacfde org-babel-exp: fixed export bug
the problem is that we were searching back to the previous source
  block before source block execution.
2009-11-16 09:23:19 -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 d4a43d28e7 org-babel-exp: bug fix, once again allowing export of non-babel source blocks 2009-11-13 10:47:11 -07:00
Eric Schulte 56a81ee65a org-babel: no longer consumes src-block reference strings during export
Before this change to `org-babel-src-block-regexp' any strings
  following src-block switches were being removed during export.
2009-11-12 18:31:55 -07:00
Dan Davison a9069d8dfd org-babel: more robust version of :results value for python and perl.
In ':results value' ('functional') mode, a return statement is now
required in python and perl code.
2009-11-11 16:09:05 -05:00
Joel Boehland 838363f047 Change defn to def for session level variable declarations. Trim trailing whitespace. 2009-11-11 11:52:51 -07:00
Dan Davison 3547a6b64d org-babel: further cleaning of parameter-passing to language files
Also update docstrings of language execution functions to reflect
changes.
2009-11-10 15:23:26 -07:00
Eric Schulte 0fa68a53ba org-babel: language specific files using cleaner parameter passing 2009-11-10 15:23:18 -07:00
Eric Schulte 082fb84c34 org-babel: cleaner passing of parameter to language specific files 2009-11-10 15:23:00 -07:00
Carsten Dominik 04e9c05c64 Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode 2009-11-10 18:17:38 +01:00
Carsten Dominik d05a12bbd5 Remove org-export-freemind, it o longer seems to work 2009-11-10 17:31:30 +01:00
Carsten Dominik d5d6ff83bd Remove org-annotation-helper.el and org-browser-url.el
These packages are subsets of org-protocol.el
2009-11-10 17:06:18 +01:00
Eric Schulte 28881fa29d org-babel: added `org-babel-noweb-error-langs' to raise errors when noweb references can't be resolved 2009-11-10 08:59:17 -07:00
Eric Schulte 97e21c5b09 org-babel-clojure: one list tiny fix 2009-11-09 22:44:13 -07:00
Eric Schulte 103e0c4bf5 org-babel-clojure: minor bug fixes 2009-11-09 22:24:06 -07:00
Joel Boehland 78a3c5d57b org-babel-clojure: Added clojure language support to org-babel 2009-11-09 22:23:38 -07:00
Dan Davison bf3281692f org-babel-tangle: Save buffer at outset. 2009-11-09 09:32:05 -07:00
Dan Davison bec4551d8b org-babel: Add support for perl
Session-based evaluation is not supported.
2009-11-09 09:32:04 -07:00
Dan Davison 3ec02a953d org-babel-python: Silent bug fix.
The code worked because the unintended extra parentheses didn't cause problems.
2009-11-09 09:32:02 -07:00
Dan Davison 6875d4d8e3 org-babel: file output for ruby and python
With this change, if :file <filepath> is specified, ruby and python
blindly output a link to <filepath>. Responsibility for creating the
contents in <filepath> lies with the python/ruby code.
2009-11-09 09:32:01 -07:00
Dan Davison 210f85ce49 org-babel: store noweb-expanded code body in 'info' data structure 2009-11-09 09:32:00 -07:00
Carsten Dominik d23b72ec30 Add John Wiegley's org-learn.el to the contrib directory 2009-11-05 08:24:18 +01:00
Eric Schulte e3bf0b4a81 org-babel-haskell: org-babel-haskell-export-to-lhs now optionally preserves indentation
based either on the value of org-src-preserve-indentation or the
    presence of the -i switch
2009-11-04 17:46:55 -07:00
Eric Schulte 260007e61f org-babel-tangle: now careful to only add one shebang per file 2009-11-04 15:18:50 -07:00
Eric Schulte cd405fad22 org-babel-tangle: now conservative about whitespace insertion around tangled blocks 2009-11-04 15:14:45 -07:00
Dan Davison 43bd90ef81 org-babel: new header argument :results_switches
If present this should be followed by org-mode block switches to be
inserted with the results block.
2009-11-04 14:55:10 -07:00
Dan Davison ea2cd9b1c8 org-babel: make info structure available when removing/inserting results
This also eliminates two extra calls to org-babel-get-src-block-info.
2009-11-04 14:55:09 -07:00
Carsten Dominik 4523ae580b Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode 2009-11-02 22:12:51 +01:00
Carsten Dominik cfcc99c789 org-mac-iCal.el: work with calendar "groups"
Doug Hellmann writes:

> Some calendar systems (Google, Zimbra) handle subscriptions to
> multiple calendars (or to an account) by grouping them under a single
> caldav directory in the calendar tree.  org-mac-iCal assumes there is
> only one ics file created per caldav directory, so while it *creates*
> all of the needed merged ics files, it only copies one of them to
> ~/Library/Calendar before importing the contents into the diary.
2009-11-02 22:12:46 +01:00
Dan Davison f01fb927e1 org-babel: read results contained in generic org blocks 2009-11-02 06:50:28 -07:00
Dan Davison 13d670744e org-babel: set case-fold-search t when reading results 2009-11-02 06:50:26 -07:00
Eric Schulte 7edbb11a57 Merge branch 'ded-babel' 2009-11-01 14:40:17 -07:00
Dan Davison 43cd1aa2b9 org-babel: trim trailing newline from noweb-referenced material 2009-11-01 14:39:17 -05:00
Dan Davison 8b33a47410 org-babel: match multiple noweb references on same line correctly. 2009-11-01 14:38:17 -05:00
Dan Davison 3cf02c1afa org-babel: allow regexp to be supplied in org-babel-trim, as per docstring. 2009-11-01 14:36:47 -05:00