Commit Graph

900 Commits

Author SHA1 Message Date
Eric Schulte ad6c199ccc ob-mime: one-to-one mapping between output formats and hooks.
Suggested by Niels Giesen.

* contrib/lisp/org-mime.el (lambda): Removing the 'html-ascii hook as
  each hook should be used for a single format.
  (org-mime-compose): Making use of format specific hooks, and apply
  each format hook individually to the body of each mime part as
  appropriate.
2010-12-27 07:48:40 -07:00
Eric Schulte 7faadf42e9 collector: replace `org-read-prop' with `org-babel-read'
* contrib/lisp/org-collector.el (org-propview-collect): Removed
  org-read-prop and replaced with org-babel-read.
2010-12-20 12:11:46 -07:00
Eric Schulte 61470f6ae1 org-mime: hooks run in org-mode buffer when composing an email
Thanks to Ethan Ligon for suggesting this functionality.

  An example hook such as the following will record when emails have
  been composed

    (add-hook 'org-mime-send-subtree-hook
            (lambda ()
              (org-entry-put (point) "mail_composed" (current-time-string))))

* contrib/lisp/org-mime.el (org-mime-send-subtree-hook): Hooks run
  in the org-mode subtree when composing an email.
  (org-mime-send-buffer-hook): Hooks run in the org-mode buffer when
  composing an email.
2010-12-19 18:46:15 -07:00
Eric Schulte 76661a853a org-mime: adding format specific pre-export hooks
Thanks to Niels Giesen for suggesting this change.

* contrib/lisp/org-mime.el (lambda): Adding format specific pre-export
  hooks.
  (org-mime-compose): Call pre-export hooks before export.
2010-12-19 16:36:54 -07:00
Eric Schulte 96c70f3d7e org-mime: now exports subtrees, and can read mail headers from subtree properties
Much of this code is reworking of a very nice function shared on the
  mailing list by Matt Lundin.

* contrib/lisp/org-mime.el (org-mime-htmlize): Fixed indentation.
  (org-mime-try): Short macro for safely checking for properties.
  (org-mime-send-subtree): Drops the current subtree into a mail
  buffer possible exported and mime-encoded.
  (org-mime-send-buffer): Drops the current buffer into a mail
  buffer possible exported and mime-encoded.
  (org-mime-compose): Exports and mime-encodes a string of org-mode
  text for sending via email.
  (org-mime-org-buffer-htmlize): Create an email buffer containing the
  current org-mode file exported to html and encoded in both html and
  in org formats as mime alternatives.
  (org-mime-subtree): Create an email buffer containing the current
  org-mode subtree exported to a org format or to the format specified
  by the MAIL_FMT property of the subtree.
2010-12-17 14:20:44 -07:00
Eric Schulte f68f1e6055 org-mime: set message subject from buffer title
* contrib/lisp/org-mime.el (org-mime-org-buffer-htmlize): Set message
  subject from buffer title.
2010-12-16 18:25:00 -07:00
Eric Schulte 943b6701c4 org-mime: insert contents *before* signature
Thanks to Rainer M. Krug for reporting

* contrib/lisp/org-mime.el (org-mime-org-buffer-htmlize): Insert
  contents *before* signature.
2010-12-16 18:18:24 -07:00
Eric Schulte 3c66db85f0 org-mime: Use new org-export-string function
* contrib/lisp/org-mime.el (org-mime-htmlize): Use new
  org-export-string function.
  (org-mime-org-buffer-htmlize): Use new org-export-string function.
2010-12-16 18:12:08 -07:00
Paul M. Rodriguez 00d00fa0b0 org-velocity and org-remember
This patch supports org-capture (with fallback to org-remember) for
org-velocity.  It also effects some internal changes, principally due to
the use of `Electric-command-loop' to replace an expedient equivalent.
2010-11-15 11:22:54 +01:00
Eric Schulte a9c5797fa1 library of babel: aesthetic changes to elispgantt 2010-11-12 16:37:17 -07:00
Eric Schulte 2ae5721731 adding elispgantt to the library of babel
The =elispgantt= source block was sent to the mailing list by Eric
  Fraga.  It was modified slightly by Tom Dye.
2010-11-12 16:34:46 -07:00
Eric Schulte 859a1b277e org-mime: removed call to defunct function
* contrib/lisp/org-mime.el (org-mime-htmlize): removed call to defunct
  function
2010-10-27 12:04:10 -06:00
Eric Schulte e6c9936373 suggesting a new function org-export-string
The attached patch adds a new functions org-export-string.

,----
| org-export-string is a Lisp function in `org-exp.el'.
|
| (org-export-string STRING FMT &optional DIR)
|
| Export STRING to FMT using existing export facilities.
| During export STRING is saved to a temporary file whose location
| could vary.  Optional argument DIR can be used to force the
| directory in which the temporary file is created during export
| which can be useful for resolving relative paths.  Dir defaults
| to the value of `temporary-file-directory'.
`----

This function should be useful in user code, and can already reduce the
amount of code in ob-org.el and org-mime.el.

>From e51017e4d7051aad31384a470f0a695dca0d6716 Mon Sep 17 00:00:00 2001
From: Eric Schulte <schulte.eric@gmail.com>
Date: Sun, 17 Oct 2010 15:17:13 -0600
Subject: [PATCH] org-export-string -- exports a string of org-mode markup text

* lisp/org-exp.el (org-export-string): new function org-export-string
  can be used to convert a string of test in org-mode markup to a
  specified format

* contrib/lisp/org-mime.el (org-mime-htmlize): now using new
  org-export-string function for exportation

* lisp/ob-org.el (org-babel-execute:org): now using new
  org-export-string function for exportation
2010-10-22 06:48:32 -06:00
Eric Schulte b5967dfa88 library of babel: new code block for expanding headings
* contrib/babel/library-of-babel.org (Write): new code block for
  expanding headings
2010-09-21 09:49:41 -06:00
Carsten Dominik 3ad98da667 Update org-drill.el to version 1.4 2010-09-17 23:10:36 +02:00
Bastien Guerry 0307f8e81b contrib/lisp/org-wikinodes.el: fix tiny typo.
s/org-find-exact-headling-in-buffer/org-find-exact-headline-in-buffer

This was spotted by Jambunathan K.
2010-09-02 15:43:45 +02:00
Christian Egli 288d1bbb0d Make the number of printed weeks configureable
This is useful for the hipster PDA where you might want to print more
weeks than just four.
2010-08-31 08:24:40 +02:00
Carsten Dominik 580a1cb3f3 Update org-drill.el 2010-08-30 09:29:26 +02:00
Eric Schulte a89dc43e83 integrating ob-plantuml -- Thanks to Zhang Weize for this contribution!
* Makefile (LISPF): now compiling and installing ob-plantuml.el

* contrib/scripts/.gitignore : ignores the plantuml.jar file, so that
  it can be located next to ditaa.jar

* lisp/ob-plantuml.el: adding copyright notice and FSF attribution

  (org-plantuml-jar-path): now a defcustom

  (org-babel-execute:plantuml): now using org-babel-eval which
  displays error messages

* lisp/org.el (org-babel-load-languages): ob-plantuml is now part of
  org-babel-load-languages
2010-08-26 09:36:08 -06:00
Robert P. Goldman e50657d7cb Added a call to insert any bodynewline-paragraph value before the start of a line item. 2010-08-21 05:11:02 +02:00
Robert P. Goldman ee736317cb Add a test code file. 2010-08-21 05:10:46 +02:00
Robert P. Goldman e439e4da27 Substantially improved org-export-generic-fontify based on help from Carsten. 2010-08-21 05:10:28 +02:00
Robert P. Goldman daa6f98cab Partial solution to the fontification problem. Having some trouble with the MATCH-STRING calls, but mostly ok. 2010-08-21 05:10:20 +02:00
Robert P. Goldman dedea0721c Make newline-handling more flexible (per WH), declare keywords.
Followed Wes Hardaker's suggestion to make the translation of
newlines more flexible --- instead of making a boolean for
special translation of blank lines, I added the ability to
specify the translation.

Also added a macro for declaring generic translation keywords
with type information and documentation.  Hope this will make
the generic translator easier to use.
2010-08-21 05:10:11 +02:00
Robert P. Goldman adf2e016e0 Revision to handling of blank lines. Start of declaration protocol.
Followed Wes Hardaker's idea of permitting alternative rewrites for blank
lines, instead of making the blank line handler be a boolean and
hard-wiring a newline character.

Also added a declaration form, with type and documentation options, for the
keywords used in defining a generic export method.
2010-08-21 05:09:58 +02:00
Carsten Dominik 4a028cc7c0 Add org-static-mathjax to the contrib directory
Thanks to Jan Bker for this contribution.
2010-08-20 18:12:59 +02:00
Carsten Dominik 4ea5658a1a Add org-drill.el 2010-08-17 10:40:14 +02:00
Carsten Dominik 67e34d7eae Allow special blocks to start with white space before the \begin{}
* contrib/lisp/org-special-blocks.el (org-special-blocks-make-special-cookies):
Allow white space at beginning of line.
2010-08-16 13:59:24 +02:00
Carsten Dominik 2f9d095617 org-depend: Fix blocking logic
* contrib/lisp/org-depend.el (org-depend-block-todo): Fix blocking logic.

Paul Sexton writes:

> The value returned by org-depend-block-todo determines whether an item
> is considered "blocked", and thus whether it is shown dimmed (because
> this function is added to org-blocker-hook).
>
> o-d-b-t only returns true in a very limited set of conditions, so very
> often items which should show up as blocked, do not. To be honest I
> don't remember the exact details, but it did not work before I applied
> the patch, and has worked correctly ever since.
2010-08-11 11:16:11 +02:00
Ivanov Dmitry b36cf7a437 org-collector: better comments and more robust conversion of string to elisp
* contrib/lisp/org-collector.el (org-read-prop): added a more detailed
  comment, changed 2 if stements to 1 cond to make the code more
  comprehensible, added
    (condition-case nil
            (read prop)
            (error prop))
  instead of
    (read prop)
  so, if any error occurs during the conversion of prop to lisp
  expression - a string will be returned.
2010-08-10 09:22:24 -06:00
Eric Schulte 25ac9ea8dd library-of-babel: more control over exporting results to files
#+source: table
  #+begin_src emacs-lisp
    (mapcar
     (lambda (el) (number-sequence el (+ el 3)))
     (number-sequence 0 4))
  #+end_src

  writes the results out as csv file
  #+call: write(data=table, file="~/Desktop/example.csv") :results silent

  writes the results out as tab separated file
  #+call: write(data=table, file="~/Desktop/example.tsv") :results silent

  write the results out as a normal org-mode file
  #+call: write(data=table, file="~/Desktop/example.org") :results silent

* contrib/babel/library-of-babel.org: more control over exporting
  results to files
2010-08-08 22:23:53 -06:00
Carsten Dominik 251a3ca7c3 Add org-wikinodes.el as a contributed package
* contrib/lisp/org-wikinodes.el: New file.
* lisp/org-exp.el (org-export-preprocess-after-radio-targets-hook):
(org-export-define-heading-targets-headline-hook): New hooks.
* lisp/org.el (org-modules): Add entry for org-wikinodes.el.
(org-font-lock-set-keywords-hook): New hook.
(org-open-at-point-functions): New hook.
(org-find-exact-headling-in-buffer):
(org-find-exact-heading-in-directory): New functions.
(org-mode-flyspell-verify): Better cursor position for checking if
flyspell should ignore a word.
2010-08-06 15:08:45 +02:00
Eric Schulte 9c1c4b3f8d org-mime: fixed major error -- was exporting entire as text/plain mime part
Thanks to Ethan Ligon for pointing this out

* contrib/lisp/org-mime.el (org-mime-org-buffer-htmlize): fixed major
  error -- was exporting entire as text/plain mime part, now when
  region is active, only that region is exported
2010-07-30 15:08:27 -06:00
Eric Schulte 6b5cf346ae org-collector: don't include tags in collected headlines
Thanks to d.tchin for bringing this issue to light

* contrib/lisp/org-collector.el (org-propview-collect): don't include
  tags in collected headlines
2010-07-23 09:36:17 -07:00
Carsten Dominik fff87c2c9f Install Paul Rodriguez' org-velocity.el
* contrib/lisp/org-velocity.el: New file.
* contrib/README: List org-velocity.el
* lisp/org.el (org-modules): Add entry for org-velocity
2010-07-21 07:50:29 +02:00
Eric Schulte 15ca30bc86 library-of-babel: improving reading text/tables in from files
* contrib/babel/library-of-babel.org(read): adding explicit format
  argument

  (gdoc-read): explicit format argument, and passing the csv
  specification through to org-table-import

  also removing org example code blocks
2010-07-20 11:49:55 -07:00
Eric Schulte d6208a7fe5 library-of-babel: more flexible reading of files into elisp 2010-07-19 17:13:53 -07:00
Eric Schulte a618566cd6 library of babel: support for reading/writing to/from Google docs 2010-07-19 17:12:53 -07:00
Carsten Dominik d1347d01a6 Remove the various ChangeLog files
We are no longer using them - when a ChangeLog is need, we generate it
from the git history.
2010-07-19 12:59:30 +02:00
Carsten Dominik 4f26d13f52 org-mac-link-grabber.el: Add Firefox/vimperator 2010-07-06 14:00:09 +02:00
Stephen Eglen b06e81a099 2010-07-01 Stephen Eglen <stephen@gnu.org>
* contrib/README: Update list of emacs-lisp files so that list is in
sync with the files in lisp/ and in same order as 'ls -1' for
those files.
2010-07-01 13:49:41 +02:00
David Maus f98bb728aa resubmitted patch to contrib/lisp/org-mac-link-grabber.el
Anthony Lander wrote:
>[1  <text/plain; US-ASCII (7bit)>]
>This patch fixes an issue with opening AddressBook.app and
>Together.app links.

This is just a reply with the patch attached in a way the
patchtracker[1] will catch it.

  -- David

[1] http://patchwork.newartisans.com/project/org-mode/list/
2010-07-01 06:29:17 +02:00
Eric Schulte e0f0e26a43 library-of-babel: adding a booktabs latex exporting function 2010-06-30 11:53:10 -07:00
Eric Schulte 96961abd3b library-of-babel: back to a single function per table environment 2010-06-28 13:23:48 -07:00
Eric Schulte 5461d3e605 library-of-babel: adding function for LaTeX Table export
* contrib/babel/library-of-babel.org (Write): support for LaTeX table export
2010-06-28 10:08:52 -07:00
Eric Schulte 517837b3a1 library of babel: added json function for accessing local or remote json objects
A quick example of accessing remote json data from Babel code blocks.

  Evaluate the following to see a listing of parks in DC by ward.

  #+source: dc-parks
  #+begin_src emacs-lisp :var keys='(ward address) :var data=json(url="http://ogdi.cloudapp.net/v1/dc/RecreationParks?format=json")
    (append
     (list keys 'hline)
     (mapcar
      (lambda (lis) (mapcar (lambda (key) (cdr (assoc key lis))) keys))
      (cdr (car data))))
  #+end_src
2010-06-27 16:07:29 -07:00
Eric Schulte ec8edda165 babel: ob-oz is now up to date with the new naming schema
* contrib/babel/langs/ob-oz.el (ob-oz): brought ob-oz up to date with
  new naming schema
2010-06-23 16:40:48 -07:00
Eric Schulte 3429a496a3 merged with master 2010-06-22 11:55:19 -07:00
Carsten Dominik 80531d8d71 * contrib/lisp/org-special-blocks.el
(org-special-blocks-convert-latex-special-cookies): Allow arguments to
TeX macros
2010-06-22 14:51:48 +02:00
Eric Schulte 97ead27f78 babel: remove all language file reference to define language variables 2010-06-17 18:15:35 -07:00
Eric Schulte 93f6360793 removing contrib/babel/org-babel-install.el -- no longer required 2010-06-17 18:15:32 -07:00
Eric Schulte e0e4d76094 renaming all org-babel* function to ob* to conform with Emacs conventions 2010-06-17 18:15:32 -07:00
Eric Schulte 04152d3a06 moving org-babel into the main org-mode lisp directory
we are keeping two things in the contrib directory

  1) the library-of-babel.org file, this is with the goal of lowering
     the barrier of entry for contribution of functions to the library
     of babel

  2) we are also keeping a langs directory in the contrib directory
     because some language files do not have FSF copyright assignment
     -- current org-babel-oz.el is the only such file
2010-06-17 18:15:32 -07:00
Eric Schulte 4096c92e89 babel: don't remove protected items on exported block cleanup
* contrib/babel/lisp/org-babel-exp.el (org-exp-res/src-name-cleanup):
  don't remove protected items on exported block cleanup
2010-06-16 21:01:13 -07:00
Eric Schulte 512ad1e30d babel: org-babel-R is better about trimming preceding and trailing newlines
* contrib/babel/lisp/langs/org-babel-R.el (org-babel-R-evaluate):
  trimming preceding and trailing newlines of output results
2010-06-16 10:42:08 -07:00
Eric Schulte d45826943a babel: cleanup trailing newline after removed #+source and #+results lines
* contrib/babel/lisp/org-babel-exp.el (org-exp-res/src-name-cleanup):
  cleanup trailing newline after removed #+source and #+results lines
2010-06-16 10:16:22 -07:00
Eric Schulte becfc8979e babel: now using re-search-forward to find the end of source blocks
* contrib/babel/lisp/org-babel.el (org-babel-result-end): replacing
  search-forward with re-search-forward when finding the end of result
  blocks
2010-06-15 18:20:29 -07:00
Eric Schulte 689b51224f babel: make sure that source-code blocks don't consume their neighbors
* contrib/babel/lisp/org-babel.el (org-babel-where-is-src-block-result):
  on result insertion, ensure that code blocks don't overrun
  subsequent lines or source blocks
2010-06-15 16:36:07 -07:00
Eric Schulte b7e50cdc3d babel: cleaning up leftovers from block exportation
* contrib/babel/lisp/org-babel-exp.el (org-export-blocks-postblock-hook):
  adding function to cleanup leftovers after block exportation

  (org-exp-res/src-name-cleanup): function to cleanup leftovers from
  block exportation
2010-06-15 16:21:22 -07:00
Eric Schulte 74d337ef23 babel: fixed latex packages in org-babel-latex -- Thanks to William Henney
* contrib/babel/lisp/langs/org-babel-latex.el (org-babel-latex-body-to-tex-file):
  now calling `org-export-latex-fix-inputenc' to sort out encodings in
  latex package list
2010-06-14 14:45:33 -07:00
Eric Schulte 08d8331307 babel: fixed bug resulting from two inline src blocks on the same line
* contrib/babel/lisp/org-babel.el (org-babel-set-interpreters): less
  greedy regexp for inline source blocks ensures that there is no
  confusion when two inline blocks are on the same line.
2010-06-14 13:50:10 -07:00
Eric Schulte 18be132545 babel: adding buffer-wide header arguments behind #+BABEL:
e.g. placing the following at the top of your buffer

will result in all source-code blocks in the buffer having their
:session header argument set to "example"

* contrib/babel/lisp/org-babel-lob.el (org-babel-lob-execute): now
  included buffer-wide header arguments in lob header arguments

* contrib/babel/lisp/org-babel.el (org-babel-params-from-buffer): new
  function for grabbing header arguments from the top of the buffer

  (org-babel-parse-src-block-match): now includes buffer-wide header
  arguments

  (org-babel-parse-inline-src-block-match): now includes buffer-wide
  header arguments

  (org-babel-current-buffer-properties): buffer-local variable to hold
  buffer-wide header arguments
2010-06-14 12:15:11 -07:00
Eric Schulte 1da53c668a babel: bug fix in exporter wrt: contents of lob info lists
* contrib/babel/lisp/org-babel-exp.el (org-babel-exp-lob-one-liners):
  exportation of #+lob and #+call type lines is now correctly handling
  the addition of the indentation information to the info list
2010-06-11 10:16:56 -07:00
Eric Schulte a5712e4b0a babel: can open results which don't start on the first column
* contrib/babel/lisp/org-babel.el (org-babel-open-src-block-result):
  now able to handle results which don't start on the first column
2010-06-11 08:07:19 -07:00
Eric Schulte cc1c446791 babel: ensure positional invariance of the `info' list
* contrib/babel/lisp/org-babel.el (org-babel-get-src-block-info):
  ensure that info always has the same number of arguments in the same
  order
2010-06-10 21:36:57 -07:00
Eric Schulte 9311325030 babel: all org-babel elements should now work when indented
* contrib/babel/lisp/org-babel-lob.el
  (org-babel-lob-one-liner-regexp):
  (org-babel-lob-get-info):
  (org-babel-lob-execute):
  all org-babel elements should now work when indented

* contrib/babel/lisp/org-babel-ref.el
  (org-babel-ref-at-ref-p):
  all org-babel elements should now work when indented

* contrib/babel/lisp/org-babel.el
  (org-babel-set-interpreters):
  (org-babel-execute-src-block):
  (org-babel-expand-src-block):
  (org-babel-get-src-block-info):
  (org-babel-hash-at-point):
  (org-mode-hook):
  (org-babel-parse-src-block-match):
  (org-babel-where-is-src-block-result):
  (org-babel-read-result):
  (org-babel-insert-result):
  (org-babel-result-end):
  all org-babel elements should now work when indented
2010-06-10 14:36:08 -07:00
Eric Schulte a9c4439d5a babel: removed debug line
* contrib/babel/lisp/org-babel-exp.el (org-babel-exp-src-blocks):
  removed debug line
2010-06-10 10:16:45 -07:00
Eric Schulte 8021cf9288 babel: undo two troubling unintended tab insertions in previous commit
* contrib/babel/lisp/org-babel.el (org-babel-execute-src-block):
  undo to troubling unintentional tab insertions from the previous
  commit
2010-06-10 10:04:12 -07:00
Eric Schulte 0e9e01c3fd babel: results now indented to the level of the #+results: line
Thanks to Sébastien Vauban for pointing this out -- as well as the
  previous babel commit :)

* contrib/babel/lisp/org-babel.el (org-babel-insert-result):
  results are now indented to the level of any existing #+results
  line.
2010-06-10 10:02:07 -07:00
Eric Schulte 9a3e9ad865 babel: can now find table and result lines which don't start on column 0
* contrib/babel/lisp/org-babel-ref.el (org-babel-ref-resolve-reference):
  now able to recognize #+tblname, #+resname and #+results lines which
  do not start on column 0
2010-06-10 09:45:06 -07:00
Eric Schulte 799c15ffaf babel: adding simple "echo" function to library-of-babel 2010-06-09 21:03:21 -07:00
Eric Schulte 4fb9fa323e babel: fixed bug dealing with ignoring quoted inline code blocks
* contrib/babel/lisp/org-babel-exp.el (org-babel-exp-inline-src-blocks):
  fixed bug dealing with ignoring quoted inline code blocks
2010-06-08 16:27:44 -07:00
Eric Schulte 5068f4a5cf babel: don't evaluate inline code located in verbatim or quoted environments
* contrib/babel/lisp/org-babel-exp.el (org-babel-exp-inline-src-blocks):
  only evaluate inline source code blocks if they do not appear in a
  verbatim or quoted context

  (org-babel-in-example-or-verbatim): check if the point is currently
  located in a verbatim or quoted context
2010-06-08 16:19:54 -07:00
Eric Schulte 7361f79d4c babel: no longer automatically inserting '='s around inline code results
* contrib/babel/lisp/org-babel-exp.el (org-babel-exp-results):
  removing forced verbatim '=' tags from around inline source code
  results, if users want their results displayed in this way they can
  add the '='s easily themselves, but there is no way to remove '='s
  inserted automatically by Org-babel.
2010-06-08 16:06:32 -07:00
Eric Schulte ae234f787b babel: noweb references are now expanded in the pre-export buffer
this is required because in the temporary org-mode file used during
  export code blocks may be removed entirely leading to unresolved
  references

* contrib/babel/lisp/org-babel-exp.el (org-babel-exp-src-blocks):
  expanding noweb references during export now takes place in the
  pre-export buffer

  (org-babel-exp-inline-src-blocks): expanding noweb references during
  export now takes place in the pre-export buffer

  (org-babel-exp-results): ensure that the expanded body is passed
  through to org-babel-execute-src-block
2010-06-08 14:40:50 -07:00
Eric Schulte efbb07fe12 babel: number checking no longer fooled by strings ending in newlines
* contrib/babel/lisp/org-babel.el (org-babel-number-p): number
  checking is no longer fooled by strings ending in single newlines
2010-06-07 17:59:58 -07:00
Eric Schulte ef931fcd3a babel: resolving references outside of the visible portion of narrowed buffers
Thanks to Tom Dye for pointing out the need for this fix

* contrib/babel/lisp/org-babel.el (org-babel-expand-noweb-references):
  now able to find noweb references even outside of the narrowed
  portion of the buffer when the buffer is narrowed

* contrib/babel/lisp/org-babel-ref.el (org-babel-ref-resolve-reference):
  now able to resolve references which are located outside of the
  narrowed portion of the buffer when the buffer is narrowed
2010-06-07 17:38:35 -07:00
Eric Schulte 93ab492464 babel: updating results in place and adding `prepend' and `append' :results options
Thanks to Graham Smith for pointing out the need for in-place
  results updates

* contrib/babel/lisp/org-babel.el (org-babel-merge-params): adding
  append and prepend as exclusive options to the :results header
  argument

  (org-babel-insert-result): now updating results in place, and
  honoring the `prepend' and `append' :results header arguments
2010-06-07 16:50:59 -07:00
Eric Schulte 8d7ab3a4b7 babel: adding :noeval header argument to inhibit execution of code blocks on export
* contrib/babel/lisp/org-babel.el (org-babel-header-arg-names): adding
  :noeval header argument which can be specified to inhibit the
  execution of a source block during export.

* contrib/babel/lisp/org-babel-exp.el (org-babel-exp-do-export):
  adding :noeval header argument which can be specified to inhibit the
  execution of a source block during export.
2010-06-07 14:08:06 -07:00
Eric Schulte ac2e6fefee babel: more careful not to evaluate code blocks without sessions on export
* contrib/babel/lisp/org-babel-exp.el (org-babel-exp-do-export): now
  explicitly checking if session is equal to "none" on export
2010-06-07 13:35:28 -07:00
Eric Schulte aa794b50b9 babel: now removing existing results when exporting "code" or "none"
Thanks to Russell Adams for pointing this out

* contrib/babel/lisp/org-babel-exp.el (org-babel-exp-do-export):
  Removing existing results on export.
2010-06-07 13:20:22 -07:00
Eric Schulte 134de59fd7 babel: cleaning up indentation
* contrib/babel/lisp/org-babel.el (org-babel-expand-src-block-maybe):
  Cleaning up indentation

* contrib/babel/lisp/org-babel.el (org-babel-load-in-session-maybe):
  Cleaning up indentation
2010-06-07 13:14:52 -07:00
Eric Schulte 9c02bf4946 babel: more robust newline regexp in `org-babel-comint-with-output'
* contrib/babel/lisp/org-babel-comint.el (org-babel-comint-with-output):
  Placing a more general regexp substitution for matching newlines
  returned by comint.  This new option should definitely cover all
  cases.
2010-06-07 12:58:38 -07:00
Eric Schulte 8318845f6d babel: stashing away text dangling after the process mark in comint buffers
* contrib/babel/lisp/org-babel-comint.el (org-babel-comint-with-output):
  If there is dangling text left after the process mark in a comint
  buffer, it will now be safely stored away during babel execution,
  and then replaced when babel is finished with the buffer.

  This commit also fixes some indentation issues.
2010-06-07 12:25:58 -07:00
Eric Schulte 909f375ba6 babel: fixing indentation in org-babel-ruby.el
* contrib/babel/lisp/langs/org-babel-ruby.el (org-babel-execute:ruby):
  fixing indentation

* contrib/babel/lisp/langs/org-babel-ruby.el (org-babel-ruby-evaluate):
  fixing indentation
2010-06-07 12:13:37 -07:00
Eric Schulte 6e34e75888 babel: small wait on new ruby sessions to allow process to start
* contrib/babel/lisp/langs/org-babel-ruby.el (org-babel-ruby-initiate-session):
   Adding a small wait after stating a new ruby session.  This avoids
   errors with `ansi-color-process-output' not being able to find the
   process mark.
2010-06-07 12:08:43 -07:00
Eric Schulte dc2baab09c babel: protecting restrictions on `org-babel-execute-subtree' 2010-06-07 11:52:04 -07:00
Eric Schulte ee94addaac babel: now strips protective commas from code blocks on tangling 2010-06-07 11:46:11 -07:00
Eric Schulte 4e43e7fea8 babel: adding library-of-babel functions for file I/O
* contrib/babel/lisp/org-babel.el (org-babel-insert-result): Replaced
  call to `org-cycle' with a call to the simpler and more appropriate
  `org-table-align'.

* contrib/babel/library-of-babel.org (Read/Write): adding
  library-of-babel functions for file I/O
2010-06-06 19:56:09 -07:00
Eric Schulte 367d81d9dc babel: all code blocks with sessions are now evaluated on export
* contrib/babel/lisp/org-babel-exp.el (org-babel-exp-do-export):

  This brings babel more inline with Sweave, by ensuring that any code
  block which could change the state in a persistent session is
  executed.  Prior to this change the following org-mode text like would
  not export as expected because the x variable would not be
  initialized.

  ** inline expressions
     :PROPERTIES:
     :session:  *R*
     :END:

  #+begin_src R :exports code :results silent
    x<-5
  #+end_src

  the sum of 1 and 4 is equal to src_R{x}
2010-06-06 19:13:14 -07:00
Carsten Dominik f70956ff5a Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode 2010-06-04 21:02:41 +02:00
Bernt Hansen dc602f3b2e Emacs 22 support - use org-string-match-p
* contrib/lisp/org-special-blocks.el (org-special-blocks-make-special-cookies):
Emacs 22 doesn't have string-match-p
* lisp/org-freemind.el (org-freemind-write-mm-buffer):
(org-freemind-get-node-style):
Emacs 22 doesn't have string-match-p
* lisp/org-html.el (org-html-make-link):
Use new org-string-match-p for compatibility
2010-06-04 21:01:29 +02:00
Eric Schulte 507e06f586 org-mime: now allows style customization based on class attributes 2010-06-04 10:56:56 -06:00
Nicolas Goaziou 359a86cda4 babel-asymptote: now accepts variables in a variety of types 2010-06-04 09:51:18 -06:00
Eric Schulte 198780f1ff babel: adding some newline padding around tangle code blocks 2010-06-02 14:07:20 -06:00
Eric Schulte c5e3660fa9 babel: tangle works when buffer name and file name differ
Thanks to "w t" from the mailing list for reporting this bug and
  providing reproduction information.
2010-06-02 09:07:23 -06:00
Eric Schulte 47a6c25df3 org-babel-tangle: fixing indentation 2010-06-02 09:07:22 -06:00
Eric Schulte afab7897a5 babel: fixed error resolving references on export
Thanks to Nicolas Goaziou for reporting this problem
2010-06-02 09:07:01 -06:00
Eric Schulte b7e273f25d babel-exp: minor documentation and indentation changes 2010-06-02 09:07:00 -06:00
Eric Schulte 8fac7aa38b Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode 2010-05-28 08:48:22 -06:00
Eric Schulte ff58dacc7c babel: `org-babel-tangle-w-comments' controls comment insertion in tangled code
* contrib/babel/lisp/org-babel-tangle.el (org-babel-spec-to-string):
  The insertion of automatically generated comments into tangled code
  is now customizable through the `org-babel-tangle-w-comments'
  variable.
2010-05-28 08:48:03 -06:00
Dan Davison e5d8764de6 babel: Declare R-specific header arguments
* babel/lisp/langs/org-babel-R.el
(org-babel-header-arg-names:R):
New variable to contain R-specific header args
2010-05-28 09:53:13 -04:00
Dan Davison 71cd358e21 babel: check properties for language-specific header arguments
* contrib/babel/lisp/org-babel.el
(org-babel-params-from-properties):
Check for language-specific header arguments
(org-babel-parse-src-block-match):
Pass lang parameter when checking properties for header args
(org-babel-parse-inline-src-block-match):
Pass lang parameter when checking properties for header args
2010-05-28 09:50:20 -04:00
Michael Sperber 6fc2ea3b9b Xemacs incompatibilities
Carsten Dominik <carsten.dominik@gmail.com> writes:

> On May 17, 2010, at 4:39 PM, Michael Sperber wrote:
>
>> In particular, fixing the require won't be enough: org-babel-python.el
>> uses `run-python' and interacts with the inferior Python, whereas
>> python-mode.el defines `py-shell'.
>>
>> Should I try to abstract over the differences?
>
> Yes, this would be much appreciated. (I think, Eric or Dan?)

OK, I've attached a patch that makes `org-babel-python' work on XEmacs.
Most of the issues are pure XEmacs issues.  Notes:

- XEmacs doesn't have [[:digit:]] - I hope to rectify this in the
  future, but it seems there's no downside in this particular case to
  replacing by [0-9].
- XEmacs doesn't have `move-end-of-line', but does have `end-of-line'.
  I don't understand the intent of having both of these, but the code
  seems fine with `end-of-line'.
- It seems there are way too few `require's throughout org-babel.  I
  don't know if it's OK to add the ones I needed.
- `org-babel-python-evaluate' looked broken as-is: It doesn't use the
  `body' argument properly, the result is (I think) processed in the
  wrong order and not properly split into lines.  I've fixed all these,
  but a review is probably in order.
2010-05-26 22:45:01 -06:00
Eric Schulte 5d52daab10 babel: org-babel-execute-buffer is no longer flummoxed by hidden subtrees 2010-05-26 19:44:04 -06:00
Eric Schulte 8d78778c89 babel: updated key bindings in refcard
and removed a binding which was shadowing the `keyboard-quit'
2010-05-26 16:55:48 -06:00
Eric Schulte 4f113630f8 org-babel-exp: no longer throws errors on empty bodies 2010-05-25 20:20:13 -06:00
Eric Schulte ceeb4681ef babel: tangled files which include shebang lines are now made executable 2010-05-25 20:01:20 -06:00
Eric Schulte 6151c88f10 babel: replaced `line-number-at-pos' with `count-lines' 2010-05-25 17:31:34 -06:00
Eric Schulte d84699459e babel: xemacs variable compatibility check -- thanks to Volker Zell 2010-05-25 17:29:41 -06:00
Carsten Dominik cdef6061bf Fix typo 2010-05-20 05:42:24 +02:00
Carsten Dominik 5eb7bf8a03 Add Anthony Lander's org-mac-link-grabber.el 2010-05-19 23:49:40 +02:00
Eric Schulte 2139651c0d babel: org-babel-clean-text-properties now checks for valid argument
thanks to Michael Sperber for pointing this out
2010-05-17 17:13:20 -06:00
Eric Schulte 236f209b25 babel: changes to org-babel key bindings 2010-05-17 17:08:32 -06:00
Carsten Dominik 38b4fcc90c XEmacs compatibility 2010-05-14 14:40:44 +02:00
Eric Schulte b7555ae433 babel: new keymap `org-babel-map' and new prefix keys "C-c C-v" 2010-05-12 23:51:41 -06:00
Carsten Dominik 4b1ee671b8 Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode 2010-05-11 23:31:38 +02:00
Carsten Dominik 7a0619cbe8 Fix bug in org-git-link.el 2010-05-11 23:31:30 +02:00
Eric Schulte 98af57cdbd babel: ob-sh.el now respects the :results "scalar" option 2010-05-07 17:18:38 -06:00
Eric Schulte 37f9639a43 Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode 2010-05-04 09:58:25 -06:00
Eric Schulte a16e887fff org-mime: now using `temporary-file-directory' instead of "/tmp" -- thanks to Uday S Reddy for catching this 2010-05-04 09:49:07 -06:00
Dan Davison 2d1025298e babel: More concise matlab/octave code template
Patch by Christopher Long
2010-05-03 21:45:27 -04:00
Dan Davison 245d98786d babel: matlab: detect end of evaluation under Emacs Link
Currently, this uses the presence of a temporary file to signal that
Matlab Emacs Link evaluation is not yet complete.

Emacs Link support added in collaboration with Christopher Long.
2010-05-03 21:45:01 -04:00
Benjamin Andresen c133dd394e babel: Fix org-babel-screen after expand changes 2010-05-02 21:30:13 -04:00
Dan Davison d2b9343029 babel: Avoid trouble with '%' in matlab/octave output
Patch by Christopher Long
2010-05-02 18:26:22 -04:00
Dan Davison 65a98e3282 babel: fix editing error in org-babel-octave.el 2010-05-02 00:41:53 -04:00
Dan Davison 1a43a5939b Merge branch 'octave-matlab' 2010-04-30 18:26:37 -04:00
Dan Davison a61de7b130 babel: matlab: don't try matlab-shell if using emacs link 2010-04-30 18:23:36 -04:00
Eric Schulte a3cc050a96 babel: `org-babel-get-colnames' no longer requires hline 2010-04-30 13:03:46 -06:00
Dan Davison 6f399c20b6 babel: Allow EmacsLink to be used for matlab session evaluation
To use EmacsLink, the user will need to set
org-babel-matlab-with-emacs-link to a non-nil value, and also arrange
that (matlab-with-emacs-link) evaluates to a non-nil value.
2010-04-30 14:39:31 -04:00
Dan Davison 10a07a644b babel: R: allow forcing of colnames without hline 2010-04-30 14:14:27 -04:00
Dan Davison 7f3e64bfb4 babel: R: output colnames when other languages would 2010-04-30 14:14:13 -04:00
Robert P. Goldman 413e6b4eee Add handling of blockquote and output formats that must be flowed.
Added a handler for blockquotes.

Also added :body-newline-paragraph to the org-set-generic-type.  This is
intended to help handling output formats (like tikiwiki) where newlines are
treated as paragraph separators, instead of being used to fill (i.e., the
destination is expected to do the word-wrapping).  If this is set to T then
org-export-generic will emit a newline character when it sees a blank
line.  This should be used in concert with a value like "%s " for
:body-line-format and nil for :body-line-wrap.
2010-04-29 15:57:03 +02:00
Eric Schulte 6a1f5b2bcb babel: ob-emacs-lisp now wraps body in a progn on execute 2010-04-27 13:55:48 -06:00
Dan Davison 837e898936 babel: Fall back to generic expand function during tangling 2010-04-27 15:02:55 -04:00
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 b8adc74894 babel: ob-emacs-lisp and ob-clojure now only wrap bodies in `let' forms when variables are present 2010-04-24 09:21:14 -06:00
Eric Schulte bc0a6c624d babel: adding :no-expand option to code blocks to inhibit body expansion 2010-04-24 09:08:27 -06:00
Eric Schulte c12e18b6cf babel: org-babel-reassemble-table checks for matching table/name dimensions 2010-04-23 11:54:31 -06:00
Dan Davison b8c4bb27ba babel: Use org-src edit buffer for expanded body preview 2010-04-23 10:10:01 -06:00
Eric Schulte 2f71d79e5e org-babel-c: now using org-babel-read on outline-property parameters 2010-04-23 10:10:00 -06:00
Eric Schulte 9124e9055d fixed bug in org-babel-execute:C 2010-04-23 10:10:00 -06:00
Eric Schulte 59251c8d08 babel: fixed bug in org-babel-execute:gnuplot related to body-expand changes 2010-04-23 10:10:00 -06:00
Dan Davison d0dde7c6d5 babel: flip default values of :hlines header arg 2010-04-23 10:10:00 -06:00
Dan Davison 9fdd058669 org-babel-expand-body:R 2010-04-23 10:10:00 -06:00
Eric Schulte 32c7ae42c3 babel: remove superfluous newlines from tangled C code bodies 2010-04-23 10:10:00 -06:00
Eric Schulte 03f13106fb babel: adding org-babel-expand-body:generic for languages w/o body expansion support 2010-04-23 10:10:00 -06:00
Eric Schulte 626cb079e4 babel: fixed bug in org-babel-expand-body:sass 2010-04-23 10:10:00 -06:00
Dan Davison 7decdec3b2 babel: erase previous contents of preview buffer 2010-04-23 10:10:00 -06:00
Dan Davison 8872454566 org-babel-expand-body:R 2010-04-23 10:10:00 -06:00
Eric Schulte 0917218da5 babel: fixed bug in org-babel-expand-body:python 2010-04-23 10:10:00 -06:00
Eric Schulte 9ff31a5110 babel: bound `org-babel-expand-src-block' to (C-c M-b p) 2010-04-23 10:09:59 -06:00
Eric Schulte 0734bf96ba org-babel-expand-body:sql 2010-04-23 10:09:59 -06:00
Eric Schulte 1fdc012e3d org-babel-expand-body:sh 2010-04-23 10:09:59 -06:00
Eric Schulte e6c979f0d7 org-babel-expand-body:screen 2010-04-23 10:09:59 -06:00
Eric Schulte 35434e1389 org-babel-expand-body:sass 2010-04-23 10:09:59 -06:00
Eric Schulte 394031eb38 org-babel-expand-body:ruby 2010-04-23 10:09:59 -06:00
Eric Schulte 1bcafa5d9f org-babel-expand-body:python 2010-04-23 10:09:59 -06:00
Eric Schulte 598dc1ad67 org-babel-expand-body:perl 2010-04-23 10:09:59 -06:00
Eric Schulte 41663b0ce4 org-babel-expand-body:oz 2010-04-23 10:09:59 -06:00
Eric Schulte 2759b6621d org-babel-expand-body:octave 2010-04-23 10:09:59 -06:00
Eric Schulte 8e9f4eec88 org-babel-expand-body:ocaml 2010-04-23 10:09:58 -06:00
Eric Schulte e07aced178 org-babel-expand-body:matlab 2010-04-23 10:09:58 -06:00
Eric Schulte 7bd0712ac2 org-babel-expand-body:latex 2010-04-23 10:09:58 -06:00
Eric Schulte dd500005ef org-babel-expand-body:haskell 2010-04-23 10:09:58 -06:00
Eric Schulte 58c8ddd5c6 org-babel-expand-body:gnuplot 2010-04-23 10:09:58 -06:00
Eric Schulte 01918dffc4 org-babel-expand-body:dot 2010-04-23 10:09:58 -06:00
Eric Schulte 4d862912b2 org-babel-expand-body:ditaa 2010-04-23 10:09:58 -06:00
Eric Schulte b805089eb8 org-babel-expand-body:css 2010-04-23 10:09:58 -06:00
Eric Schulte 6d61edd1ea org-babel-expand-body:clojure 2010-04-23 10:09:58 -06:00
Eric Schulte 4ba08f9b5b org-babel-expand-body:asymptote 2010-04-23 10:09:58 -06:00
Eric Schulte 34eed9b48d org-babel-expand-body:c, org-babel-expand-body:c++ 2010-04-23 10:09:58 -06:00
Eric Schulte 8c8c96972e org-babel-expand-body:emacs-lisp 2010-04-23 10:09:58 -06:00
Eric Schulte 2fe12b99f4 babel: adding new function `org-babel-expand-src-block'
org-babel-expand-body:lang function needs to be implemented by every
  language, and is used to expand the body of a code block for
  execution or tangling
2010-04-23 10:09:57 -06:00
Dan Davison 788779e16c babel: typo in org-babel-get-rownames 2010-04-23 10:09:57 -06:00
Dan Davison c777e729fb babel: bring R row- and col-names into line with others 2010-04-23 10:09:57 -06:00
Julien Barnier bd3c85ed60 babel: add :rownames header arg for R 2010-04-23 10:09:57 -06:00
Dan Davison d5dd160b23 babel: bug fix in org-babel-get-colnames 2010-04-23 10:09:57 -06:00
Eric Schulte b9aa92ba21 org-babel: splitting `org-babel-pick-name' into it's own function
also renaming org-babel-manicure-tables to org-babel-disassemble-tables
2010-04-23 10:09:57 -06:00
Eric Schulte bfc93ca808 babel: added row/col-name support to all applicable languages 2010-04-23 10:09:57 -06:00
Eric Schulte 10b3da72fc babel: adding row/col-names functions
adding a suite of functions to org-babel.el which can be used to
  handle hlines, rownames, and columnnames in input tables.  These
  functions can be called from any org-babel-language.el file.

  done in close collaboration with Dan Davison
2010-04-23 10:09:57 -06:00
Eric Schulte 0c8b86e9a9 org-babel: keep within 80 columns
this is exclusively whitespace and indentation changes, with the
  goal of cleaning up the file, and keep all lines within 80 columns
2010-04-23 10:09:57 -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
Carsten Dominik c6ea2a1457 Use overlay-in and overlay-at instead of compatibility functions 2010-04-20 12:17:06 +02:00
Carsten Dominik 97e20048b2 Use `add-to-invisibility-spec' directly 2010-04-18 19:41:05 +02:00
Carsten Dominik b35b9914e6 Revert "Use `add-to-invisibility-spec' directly"
This reverts commit c2e5b13a2d.
2010-04-18 19:38:10 +02:00
Carsten Dominik c2e5b13a2d Use `add-to-invisibility-spec' directly 2010-04-18 19:26:30 +02:00
Carsten Dominik bb0ef787b7 Require calendar already on top level in org.el 2010-04-18 16:50:13 +02:00
Carsten Dominik f45e6a28b1 Use the normal overlay API, not Org's one 2010-04-18 16:49:58 +02:00
Eric Schulte 3652689944 org-mime: removed short string " xx " from semi syntax 2010-04-16 09:21:36 -06:00
Eric Schulte 3b5c85fb95 org-mime: WL is now fully supported -- thanks to Eric S. Fraga 2010-04-15 09:40:03 -06:00
Eric Schulte a2769bef61 org-mime: bug fixes, thanks to Eric S Fraga and Andrew Hyatt for their debugging help 2010-04-14 09:12:41 -06:00
Eric Schulte b617a457ae org-mime: change `org-mime-org-export' to more closely mimic `org-run-like-in-org-mode' 2010-04-12 11:21:59 -06:00
Eric Schulte 70ba21e699 babel: new function `org-babel-tangle-publish' allows for tangling during project publish 2010-04-11 23:58:44 -06:00
Eric Schulte 7cbb35920d org-babel-c: new header argument ":main no" allows inhibiting main wrap 2010-04-10 15:54:40 -06:00
Eric Schulte 99a07f1d4a org-babel-c: cleaning up header arguments 2010-04-10 15:43:31 -06:00
Eric Schulte 0e8c9f7a49 org-babel: no longer over evaluating header arguments 2010-04-10 15:43:19 -06:00
Eric Schulte 3386a702f8 org-babel: all languages now returning lists as pure emacs-lisp, not quoted emacs-lisp 2010-04-10 15:15:06 -06:00
Eric Schulte 722dd7eb5c org-mime: cleaned `org-mime-default-header' from text/plain exports 2010-04-10 15:15:05 -06:00
Dan Davison 59d499ff51 babel: Allow table to end neatly with terminal hline
Prior to this, a terminal hline would leave dangling empty cells:

 #+TBLNAME: A
 |---+---+---|
 | a | b | c |
 |---+---+---|

 #+begin_src emacs-lisp :var tab=A
 tab
 #+end_src

 #+results:
 |---+---+---|
 | a | b | c |
 |---+---+---|
 |   |   |   |
2010-04-10 16:49:40 -04:00
Dan Davison 8c827ba5ba babel: Allow output tables to start with 'hline 2010-04-10 16:12:28 -04:00
Eric Schulte 98b4ae28a9 babel: allow lisp quoted expansion of variable values when starting with ` 2010-04-09 19:06:07 -06:00
Eric Schulte 8258daf439 added org-mime.el to contrib -- allows HTML email composition with Org-mode
see http://orgmode.org/worg/org-contrib/org-mime.php for
  documentation

  much thanks to everyone on the "using orgmode to send html mail"
  thread (see http://thread.gmane.org/gmane.emacs.orgmode/23153)
  especially David Maus for ideas, discussion, and suggestions
2010-04-09 10:26:57 -06:00
Dan Davison f846663ce6 babel: Do not add indentation to perl code.
Thanks to Łukasz Stelmach.
2010-04-09 08:45:18 -04:00
Dan Davison 0f83b2d203 babel: allow disabling of noweb expansion during tangling 2010-04-08 16:14:28 -04:00
Dan Davison 38d6bf3f6c babel: allow assigning of variables when preparing R session
This is already in place for other languages, but seems to have been
forgotten for R.
2010-04-08 15:26:08 -04:00
Eric Schulte caaf755192 babel: org-babel-latex adjusts to the new org latex setup 2010-04-07 22:43:37 -06:00
Dan Davison e48b8bf577 babel: return string results from matlab as strings
Thanks to Bob Jansen
2010-04-07 18:44:58 -04:00
Dan Davison f03c981fc0 babel: return string results from octave as strings
Thanks to Darlan Cavalcante
2010-04-07 15:51:04 -04:00
Eric Schulte 8d405783cb babel: safer modification of `call-process-region' 2010-04-04 17:15:12 -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 40a8933ba6 babel: allow R to produce svg format output 2010-04-01 18:45:59 -04:00
Carsten Dominik c1ee3cc3d9 Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode 2010-03-31 00:16:13 +02:00
Carsten Dominik 28b1059f09 Snow Leopard compatibility for org-mac-iCal.el 2010-03-31 00:16:07 +02:00
Dan Davison 3637efe647 babel: Don't use language major-mode when expanding noweb references
There is no longer any need for the language major mode.
2010-03-30 10:20:18 -04:00
Dan Davison e32c066874 babel: check that language major-mode is available during tangling 2010-03-30 10:20:10 -04:00
Eric Schulte 2675848d37 babel: org-babel-c now responds to :cmdline header argument 2010-03-29 12:26:53 -06:00
Bernt Hansen f2abb650fb Add completions for checkbox targets
Add the new property values to the completion list.
2010-03-28 22:10:24 -04:00
Eric Schulte e8a125bed7 babel: now taking headline properties into account for lob calls 2010-03-28 16:53:00 -06:00
Dan Davison a23ca4529f babel: Get rid of parameter inheritance by reference blocks 2010-03-27 18:49:00 -04:00
Dan Davison 36351d26a9 Merge branch 'master' of git://repo.or.cz/org-mode 2010-03-27 16:18:27 -04:00
Dan Davison 47571965d4 babel: don't process emacs-lisp params twice 2010-03-27 15:59:53 -04:00
Eric Schulte 8ecc86d49e babel: better variable initialization for org-babel-c 2010-03-27 08:20:38 -06:00
Eric Schulte fc28dd538b babel: shorter language names no longer shadow larger names
Previously "R" could overshadow "Ruby", and "C" could overshadow
  "Clojure", causing blocks of the longer language name to fail to
  load. This issue has now been fixed
2010-03-26 20:54:16 -06:00
Eric Schulte 22e4cd9b6d babel: org-babel-c more robust, better error messages and c++ support 2010-03-26 19:35:31 -06:00
Eric Schulte b61019489c babel: org-babel-C now displays compilation error messages 2010-03-26 17:12:43 -06:00
Eric Schulte e3fbc98b26 babel: removed errant reference to R from org-babel.el 2010-03-26 16:28:25 -06:00
Eric Schulte 17790c7dad babel: limited initial support for C and similar languages 2010-03-26 16:28:23 -06:00
Eric Schulte f400632f94 babel: when passing values from a table an extra '$' prefix forces literal
thanks to Maurizio Vitale for the suggestion.  This allows literal
  values to be passed to code blocks through `sbe' without forcing the
  use of quotes inside the table.
2010-03-25 11:09:38 -06:00
Eric Schulte 727aa263cb babel: src block regexps are more robust to embedded "[begin|end]_src" in block body 2010-03-22 15:19:33 -06:00
Eric Schulte 32bbd3f3bb babel: variable references which look like lisp forms are now evaluated
for example, the following simple example
    #+begin_src emacs-lisp :var two=(+ 1 1)
      (sqrt two)
    #+end_src

    #+results:
    : 1.4142135623730951

  Or this more interesting usage, which pulls variable values from
  headline properties
    *** example headline w/property
        :PROPERTIES:
        :special:  89
        :last-name: schulte
        :END:

    #+begin_src emacs-lisp :var special=(string-to-number (org-entry-get nil "special" t))
      (+ special 1)
    #+end_src

    #+results:
    : 90

    #+begin_src emacs-lisp :var last-name=(org-entry-get nil "last-name" t))
      (message "hello %s" last-name)
    #+end_src

    #+results:
    : hello schulte
2010-03-22 15:19:32 -06:00
Dan Davison abf0a50d1b babel: Ensure that inline code blocks produce string output on export 2010-03-19 10:08:16 -04:00
Dan Davison adb2f3f590 babel: Add octave and matlab support 2010-03-18 14:45:39 -04:00
Dan Davison aa0e4b86ce babel: Fix org-babel-load-file
This was broken by 29a2ab0047
2010-03-18 14:30:54 -04:00
Dan Davison 73d8e57685 babel: Allow tramp syntax when supplying :tangle filename
Patch by Rémi Vanicat.
2010-03-17 21:03:21 -04:00
Dan Davison 29a2ab0047 babel: when tangling do not add extension if filename supplied 2010-03-17 20:09:06 -04:00
Dan Davison 6976d9fc79 babel: org-babel-switch-to-session [C-c M-b z]
org-babel-pop-to-session is an alias of this
2010-03-16 12:57:28 -04:00
Dan Davison 485781ed40 babel: set default-directory in org-babel-pop-to-session 2010-03-13 14:02:47 -05:00
Dan Davison f4ae431706 babel: Make code block params available when initiating session 2010-03-13 14:02:31 -05:00
Dan Davison 215d11c092 babel: New hook org-babel-after-execute-hook
Runs at the end of org-babel-execute-src-block
2010-03-13 14:02:22 -05:00
Dan Davison ba4d698fa1 babel: Provide notification of errors during code execution
This deals with external process :results value mode for R, ruby,
python, perl and clojure: if the shell process has a non-zero exit
code, a buffer containing stderr is displayed.
2010-03-05 11:32:18 +00:00
Dan Davison 4e9a2d4efd babel: Fix bug in shell-command-on-region
Prior to this commit,

OUTPUT-BUFFER nil
REPLACE 'replace
ERROR-BUFFER 'current-buffer

resulted in stdout going with stderr to the current buffer, contra the
docstring. With this change stdout is discarded in this case. The
docstring does stipulate that stdout always should go to *Shell
Command Output*; this change does not make that happen in this case.
2010-03-05 11:32:11 +00:00
Dan Davison 05986e95ea babel: Introduce org-babel copy of shell-command-on-region
At this commit, org-babel-shell-command-on-region is a direct copy of
shell-command-on-region. In addition to switching to use the org-babel
version, we change the argument passed so that they agree with the
docstring of s-c-o-r.

Despite the change in arguments, the same behaviour results because
s-c-o-r does not behave as documented in emacs23. Future commits will
be able to fix these bugs in the org-babel version, as necessary.
2010-03-05 11:32:04 +00:00
Dan Davison ed7b8bfcca babel: clojure: read results remotely when necessary 2010-03-03 22:00:08 +00:00
Dan Davison 54c7b04734 babel: clojure: use shell-command-on-region 2010-03-03 21:59:32 +00:00
Dan Davison a8c1a49b77 babel: Read perl results remotely when necessary. 2010-03-03 16:11:04 +00:00
Dan Davison 9c36b20a25 babel: make output file links track changed directory 2010-03-02 14:51:01 +00:00
Dan Davison 486bc2fe64 babel: Use file-name-as-directory to form default-directory 2010-03-02 14:51:01 +00:00
Eric Schulte f0f511916a babel: org-babel-oz.el now uses unix-style newline characters 2010-03-01 08:31:05 -07:00
Dan Davison 44c8487e2d babel: fix bug with remote working directory
This change fixes a bug in the remote execution branch, involving the
way that org-babel-tramp-handle-call-process-region is used
to (conditionally) handle calls to call-process-region. When
org-babel-execute-src-block called itself recursively (e.g. when
resolving a reference to another src block), a circular binding of
symbols and values resulted.
2010-02-27 18:19:18 -05:00
Dan Davison 322fe431c5 babel: Write R input data remotely when necessary. 2010-02-27 18:19:09 -05:00
Eric Schulte a705bf5925 babel: wrapped `org-babel-make-remote-file-name' in conditional as `org-babel-maybe-remote-file' 2010-02-27 18:18:37 -05:00
Dan Davison 24cdeea122 babel: read remote results from remote files
When using ':results value' in certain situations, results are written
to file by the foreign language process and subsequently read from
file by emacs into an elisp table structure. If the foreign language
process is running remotely, then the results are written
remotely. These changes ensure that in that case, an appropriate
remote file name is constructed to read the remote data.
2010-02-27 14:14:08 -05:00
Dan Davison 2056d7d419 babel: Allow shell-command-on-region to execute remotely
These changes solve two problems: both are discussed in the following thread

http://lists.gnu.org/archive/html/tramp-devel/2010-02/msg00025.html

of which a summary follows.

Firstly, shell-command-on-region does not work with tramp in the same
way that shell-command does. I.e. whereas

(let ((default-directory "/user@remote-host:"))
  (shell-command "hostname" t))

gives the remote hostname,

(let ((default-directory "/user@remote-host:"))
  (shell-command-on-region (point) (mark) "hostname" t))

does not.

The reason is that shell-command-on-region calls call-process-region,
which does not use a tramp handler for remote files. However, such a
file handler does exist (unused) in the tramp sources:
tramp-handle-call-process-region. There is a slight problem in that
there is a bug in that function definition in current tramp (which has
persisted because the function is not normally used).

Therefore, we define an org-babel version of
tramp-handle-call-process-region which fixes the bug, and we bind
call-process-region to org-babel-tramp-handle-call-process-region for
the duration of org-babel-execute-src-block.
2010-02-27 14:14:08 -05:00
Dan Davison b3d5a1eb39 babel: working directories and remote execution
This introduces a new header argument :dir. For the duration of source
block execution, default-directory is set to the value of this header
argument. Consequences include:

- external interpreter processes run in that directory
- new session processes run in that directory (but existing ones are unaffected)
- relative paths for file output are relative to that directory

The name of a directory on a remote machine may be specified with
tramp syntax (/user@host:path), in which case the interpreter
executable will be sought in tramp-remote-path, and if found will
execute on the remote machine in the specified remote directory.
2010-02-27 14:14:08 -05:00
Dan Davison 5f8a57ad48 babel: change implementation of external R process evaluation
Use shell-command-on-region, bringing R into line with ruby, python,
clojure, shell. In addition to consistency (and perhaps efficiency),
this will also be preferable in the case of a remote R process because
it means that transfer of the input to the remote process is dealt
with automatically by tramp.
2010-02-27 14:14:08 -05:00
Eric Schulte 522f30bc9f babel: tiny doc tweak 2010-02-27 14:14:07 -05:00
Dan Davison cc7052540b babel: allow point to move to end of comint buffer 2010-02-27 14:14:07 -05:00
Dan Davison 283ebcb43b babel: New const variable org-babel-header-arg-names
This is used when checking for babel header args in org properties.
2010-02-27 14:14:07 -05:00
Dan Davison 82d7585810 babel: Tighten result and source line regexps
Anchored to beginning of line, with optional whitespace indenting.
2010-02-25 17:58:46 -05:00
Dan Davison 5833fbd358 babel: Make colnames header arg expect use "yes" for true. 2010-02-25 17:58:46 -05:00
Dan Davison 4064c31fa7 babel: get rid of unused variable 2010-02-25 17:58:46 -05:00
Dan Davison fc693eb5e2 babel: treat python tuples as lists 2010-02-25 17:58:45 -05:00
Dan Davison a95c05773e babel: Fix unquoting of strings
Before this change we have

 #+begin_src ruby :results value :session
 ["1", "3"]
 #+end_src

 #+results:
 : 1", "3

 After, we have

 #+begin_src ruby :results value :session
 ["1", "3"]
 #+end_src

 #+results:
 | 1 | 3 |
2010-02-25 17:58:45 -05:00
Dan Davison 6f62066ac6 babel: Fix export bug.
Introduced at 747f425f00
2010-02-25 15:12:47 -05:00
Dan Davison eb521ae95e Remove org-R from contrib
org-babel should be used to execute R code from org-mode.
2010-02-24 12:42:48 -05:00
Eric Schulte 8625e5c0bc babel: gnuplot can now return it's string output -- when session is set to "none" 2010-02-23 08:16:25 -07:00
Dan Davison a2d94ffc8e babel: prevent quoting of strings in shell variables 2010-02-23 07:31:43 -07:00
Carsten Dominik 6a5f6deaac Fix bug in org-git-link.el.
Patch by David Maus
2010-02-20 20:34:39 +01:00
Eric Schulte 753d1402d8 babel: avoid infinite loop in org-babel-execute-buffer -- Thanks to Stephan Schmitt 2010-02-16 13:34:09 -07:00
Eric Schulte 574f1b590e babel: adding support for the OZ programming language -- Thanks to Torsten Anders!
For information on the OZ programming language see
  http://www.mozart-oz.org/, for information on using Org-babel with
  OZ see the OZ specific documentation on Worg at
  http://orgmode.org/worg/org-contrib/babel/languages/org-babel-doc-oz.php
2010-02-16 13:28:08 -07:00
Dan Davison 1e96482389 babel: check pdf file existence before deleting 2010-02-15 10:29:56 -07:00
Dan Davison 747f425f00 babel: only add srcname property for source blocks which actually have names 2010-02-15 10:07:23 -07: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 25f76ffa44 babel: now including source code block arguments w/source name on export
This change provides for better export of named source-code blocks,
  with specific support for more attractive html export.  The arguments
  are included with the source code name, and both the source code name
  and code body are wrapped in a div to support styling with css.  For
  example the following CSS can be used to associate a source-code block
  name with it's code body, and to slightly indent the body.

.org-src-container {
  border-left: 4px solid gray;
  padding: 0.5em 0.5em 0.5em 1em; }
  .org-src-container pre {
    margin-left: 1em; }
2010-02-10 13:34:00 -07:00
Carsten Dominik 9196dc9bbe Fix list export in org-export-generic
Patch by Robert Goldman
2010-02-10 11:36:58 +01:00
Eric Schulte 2531d704c0 babel: now able to reference links as results 2010-02-09 20:30:28 -07:00
Eric Schulte db1fe2a619 babel: greatly simplified block exportation 2010-02-09 19:09:19 -07:00
Eric Schulte df418de954 babel-clojure: slight change allowing strings to be passed in as variables 2010-02-08 13:17:37 -07:00
Eric Schulte 2829f77e2b babel: org-babel-load-file no longer fails when `file-truename' returns nil 2010-02-08 13:17:06 -07:00
Eric Schulte b59ebe6ec2 babel: org-babel-load-file will no longer strip portions of file names which appear to be extensions 2010-02-07 11:42:55 -07:00
Eric Schulte a60a83fbb6 babel: better handling of table in shell scripts 2010-02-07 10:17:20 -07:00
Eric Schulte 047ac8ab1b babel: shell command used by org-babel-sh is now configurable using the org-babel-sh-command variable 2010-02-07 09:36:56 -07:00
Eric Schulte e4bc599745 org-babel-latex: allow pdf/png generation directly from latex source blocks 2010-02-06 09:54:10 -07:00
Eric Schulte 3ce4962447 babel: added :shebang and :comments header arguments for finer control over tangled output 2010-02-05 19:04:50 -07:00
Eric Schulte 131441dbd2 babel: load-file works for symlinks -- Thanks to Martin Kühl 2010-02-04 09:43:11 -07:00
Carsten Dominik fd6cc29909 Make org-export-generic.el provide org-export-generic
This is in addition to providing org-generic.
2010-02-04 07:33:27 +01:00
Christian Egli 04c86c50c7 Add more documentation and handle non-standard diary-file location 2010-02-01 10:37:19 +01:00
Carsten Dominik 9321460f3e Make org-exp-bibtex.el require org and org-exp 2010-01-31 17:53:28 +01:00
Dan Davison 21849af58b babel: can now tangle files without extensions 2010-01-28 09:58:52 -07:00
Carsten Dominik a2cf93f5d6 Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode 2010-01-26 10:50:11 +01:00
Eric Schulte b59a57e890 babel: bug fix related to "no longer overwriting non-babel src blocks" commit
this fixes a bug introduced in commit
  d154f27947
2010-01-25 23:54:03 -07:00
Carsten Dominik 2e53d9b137 Remove comma after means in many docstrings
Stephen Eglen says these commas should not be there.
2010-01-21 16:15:40 +01:00
Carsten Dominik 3ddd5ac49c Add org-secretary.el by Juan Reyero 2010-01-20 10:15:50 +01:00
Eric Schulte d154f27947 babel: no longer overwriting non-babel src blocks org-exp-blocks: adding progress-marker local variable
the progress-marker local variable set inside of a let in
  org-exp-blocks is used to constrain searches in org-babel-exp to
  ensure that a babel block doesn't overwrite non-babel src blocks
2010-01-18 13:36:27 -07:00
Eric Schulte aa72dfc54f babel: implement org-babel-load-session:* for R, clojure, gnuplot, python, ruby and sh 2010-01-11 10:14:30 -07:00
Eric Schulte 1e8107faf7 babel: improve doc strings for org-babel-execute-buffer and org-babel-execute-subtree 2010-01-11 08:47:29 -07:00
Joel Boehland baa98c1f14 Added support to name the slime-output-buffer (slime-repl) to the name of the respective org-babel session
Signed-off-by: Joel Boehland <joel.boehland@evocomputing.com>
2010-01-09 14:25:18 -07:00
Eric Schulte 682d7a3193 babel: fixed bug where :exports was forced to "results" whenever :file was set 2010-01-09 12:44:02 -07:00
Carsten Dominik 588a42d4fd org-exp-generic.el: Fix bug with closing bodies
Reported by Christian Lasarczyk, patch by Wes Hardaker
2010-01-08 17:34:44 +01:00
Joel Boehland 7121a5e9c8 babel: add session support for clojure 2010-01-06 17:38:35 -07:00
Eric Schulte cd587c7148 babel: now exports source code block names
When exporting to html the source-code block name will be included
   as a <label> immediately preceding the exported code.  This <label>
   is decorated with the 'org-src-name' css class.

   When exporting to LaTeX with the listings package the source-code
   block name will be included as a listings \title for the code
   block.  Currently the name will not be exported when the listings
   package is not in use.
2010-01-05 08:33:08 -07:00
Carsten Dominik ca5396e063 Fix bug in org-export-generic.el 2010-01-03 14:14:31 +01:00
Eric Schulte 0d82a1f2bc babel: fixed type in org-babel-keys 2010-01-01 15:55:11 -07:00
Eric Schulte da03a848e5 babel: now correctly combining nested tangle header arguments 2009-12-30 17:37:03 -07:00
Eric Schulte 2a2a76c2a3 babel: typo 2009-12-30 17:05:05 -07:00
Eric Schulte e9acf4276e babel: adding keys bindings for org-babel functions in org-babel-keys.el 2009-12-30 16:15:55 -07:00
Eric Schulte 80d41a9121 babel: inheriting properties from higher levels, tracking more properties 2009-12-28 18:04:25 -07:00
Eric Schulte 126f7a3582 org-babel: :cache header argument now uses standard "yes" "no" arguments 2009-12-22 10:11:23 -07:00
Eric Schulte 4815da4b16 org-babel: noweb references are not activated by default 2009-12-18 13:35:30 -07:00
Eric Schulte 0ec408cd9a org-babel: no quotes around strings in table output -- Thanks to Francesco Pizzolante 2009-12-18 11:10:03 -07:00
Eric Schulte 904a37a850 babel: noweb insertions are now placed behind the line prefix of the <<>> reference
So, for example since the following <<example>> noweb reference
  appears behind the SQL comment syntax the entire inserted body will
  also be SQL commented

-- <<example>>

  expands to

-- this is the
-- multi-line body of example

  Note that noweb replacement text which does *not* contain any
  newlines will not be affected by this change, so it is still
  possible to use inline noweb references.

  Thanks to Sébastien Vauban for this idea.
2009-12-17 11:22:00 -07:00
Eric Schulte 0969873888 org-babel-gnuplot: variable expansion in gnuplot source-code with '$' character
Variable names in gnuplot source code preceded by the '$' character
  will be expanded to their value before the code is executed.  For
  example the following will results in the evaluation of 'plot
  sin(x)' by gnuplot.

  "sin(x)"

  plot $fun
2009-11-30 21:01:43 -07:00
Benjamin Andresen c1ee488f45 org-babel-screen: now parsing it's own parameters 2009-11-30 07:20:51 -07:00
Eric Schulte dc5c41fbdc org-babel: fixed typo in reference resolution for #+results: lines 2009-11-29 10:00:19 -07:00
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
Carsten Dominik 7d75d03e40 Merge branch 'master' of git+ssh://repo.or.cz/srv/git/org-mode 2009-11-01 20:14:05 +01:00
Carsten Dominik 274add3c85 Use diary-file variable to point to diary file
Patch by Doug Hellman
2009-11-01 18:20:07 +01:00
Dan Davison c84903f1b3 org-babel: export of functional-style source blocks
A "functional-style" source block is one in which the name is followed
immediately by a parenthesised argument. An example is the following
"function", which generates n uniform random numbers:

\#+srcname: rand(n)
\#+begin_src R
runif(n)
\#+end_src

With these changes, such source blocks are passed over to the export
machinery in the following form:

\#+begin_src org-babel-lob
<function-def-keyword> rand(n):
\#+end_src
\#+begin_src R <switches>
<indent>runif(n)
\#+end_src

where <function-def-keyword> is the value of
org-babel-function-def-export-keyword, which defaults to "function",
<switches> are the src block switches that belonged to the original
block, and <indent> is the whitespace indent of the function body, the
width of which is determined by org-babel-function-def-export-indent.
org-babel-lob is a simple major mode responsible for fontification of
the blocks corresponding to the function definition line (as opposed
to the function body).
2009-11-01 10:05:42 -05:00
Dan Davison 75299025d6 org-babel: use org-babel-get-src-block-info during export 2009-11-01 10:05:42 -05:00
Dan Davison 872d9157d9 org-babel: include functional-style args in org-babel-get-src-block-info list
This adds a new terminal (sixth) element to the list returned from
org-babel-get-src-block-info. It is used when exporting the code of
"functional style" code blocks, i.e. those in which the name of the
block is followed by a parenthesised argument list (or an empty pair
of parentheses).
2009-11-01 10:05:42 -05:00
Dan Davison d97f767632 org-babel: avoid inserting blank line at bottom of exported code blocks 2009-11-01 10:05:42 -05:00
Dan Davison 64cd40700e org-babel: Reinstate switches when exporting blocks of code 2009-11-01 10:05:42 -05:00
Dan Davison a0d03014ab org-babel: internal change: defer breaking up of info list in org-babel-exp.el 2009-11-01 10:05:42 -05:00
Dan Davison 72691f1ff7 org-babel: Single function to return all source block info.
- org-babel-get-src-block-info returns the name of the block as a new
  fifth element.

- org-babel-get-src-block-info incorporates the parenthesised variable
  references into the header arg list, with precendence given to
  explicit :var references, as before.

- remove function org-babel-get-src-block-name

- remove function org-babel-get-src-block-function-args

org-babel-get-src-block-function-args now returns a list
  (lang body params-alist switches srcname)
where, unless a non-nil value for the optional argument is passed,
params-alist contains any :var entries acquired from the parenthesised
argument list following the srcname.
2009-11-01 10:05:42 -05:00
Dan Davison dcc669f20a org-babel: parse src block switches
The switches are flags like -n and must *precede* the first colon
after the language (i.e. precede the first header argument). So the
general src block syntax is
\#+begin_src lang <switches> :header1 val1 :header2 val2 ...
...

org-babel-get-src-block-info now returns a list
(lang body params-alist switches)
2009-11-01 10:05:41 -05:00
Dan Davison c7d3844bd9 org-babel: annotate org-babel-src-block-regexp with comments for clarity 2009-11-01 10:05:41 -05:00
Dan Davison c6fb5d94d0 org-babel: update authorship records 2009-11-01 10:05:41 -05:00
Dan Davison 7cea83d870 org-babel-exp: ensure presence of `org-current-export-file' before resolving foreign file references 2009-10-29 09:00:50 -06:00
Eric Schulte e01839a826 org-babel-latex: initial support for exporting latex from org-babel 2009-10-28 16:13:53 -06:00
Eric Schulte f4d5b6dd49 org-babel noweb reference evaluation
noweb references which include ()s are now evaluated.  It is
  possible to pass arguments to the noweb references using the existing
  lob argument syntax.  So after this commit the following

<<example-block>>

  will insert the body of "example-block", and the following

<<example-block()>>

  will insert the results of "example-block", and the following

<<example-block(a=9)>>

  will insert the results of "example-block" with argument "a" set to
  the literal value of 9
2009-10-28 16:13:33 -06:00
Carsten Dominik 848b2039a1 Add org-git-link.el by Raimar Finken 2009-10-28 12:14:41 +01:00
Dan Davison 962a1e0608 org-babel: fix inline source block regexp
This satisfies the requirements that
1. the src_lang{} construct is preceded by whitespace
2. this whitespace is not consumed by the replacement text
2009-10-26 21:51:43 -06:00
Dan Davison 512b376bb5 org-babel: allow multiple spaces/tabs between "src" and lang 2009-10-26 21:51:42 -06:00
Dan Davison 2f82ee771a org-babel: use %s to format inline result when it is a string.
This avoids returning quote characters with the string.
2009-10-26 21:51:41 -06:00
Dan Davison 3fa8c7dfff org-babel: enforce canonical (lang body params) order of arguments 2009-10-26 21:51:39 -06:00
Eric Schulte 1771e61cfc org-babel-exp: simplification of org-babel-lob-mode 2009-10-25 12:52:17 -06:00
Eric Schulte 6851f07f92 org-babel-exp: adding org-babel-lob-mode for fontification of lob lines 2009-10-25 10:47:12 -06:00
Dan Davison 70a5963563 org-babel: avoid false positive matches for inline and #+lob constructs
This forces the #+lob regexp to match at the beginning of a line (with
optional preceding whitespace), and requires inline code blocks to be
surrounded by some whitespace.
2009-10-25 10:47:07 -06:00
Dan Davison 5f1ea1ce70 org-babel: By default, don't use session for inline blocks 2009-10-25 10:47:06 -06:00
Dan Davison ed0f4a36e9 org-babel: Export code and/or results of #+lob function calls.
Currently, python fontification is used for export of these lines, due
to some similarity between python function call syntax and #+lob call
syntax. This is implemented as a language type "babel", mapped to
python in org-src-lang-modes.
2009-10-24 15:27:43 -06:00
Eric Schulte 824c8c0dba org-babel: behaviour-neutral changes anticipating subsequent work on export
merging original change by Dan Davison which generalizes the types
  of blocks exported by org-babel to include the following types
  - inline
  - lob
  - block
2009-10-23 16:02:29 -06:00
Eric Schulte 6ef0dd44bd org-babel-exp: exporting inline src blocks now respects different :results type 2009-10-23 16:02:28 -06:00
Eric Schulte 4539c8998c org-babel-exp when exporting blocks, don't return results as string
rather execute normally using org-babel-insert-results to insert the
  results in the buffer
2009-10-23 16:02:27 -06: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
Eric Schulte 540fa74513 org-babel-exp.el is now working for inline blocks 2009-10-23 16:02:23 -06:00
Carsten Dominik bdb6992813 Apply patch to fix registry
Patch by Andreas Burtzlaff
2009-10-22 15:23:58 +02:00
James TD Smith 04ea1a3b14 Some small fixes in org-registry.
org-registry-assoc-all removed matching links from the registry. This meant
subsequent calls with the same parameters would return nothing.

Add another function for finding entries in the register, which used find-if to
get entries satisfying a predicate.
2009-10-21 10:42:50 +02:00
Dan Davison c168c6ccaa org-babel: improve prompt when choosing file to tangle 2009-10-20 10:17:42 -04:00
Dan Davison 32cfddf7b1 org-babel: fix #+lob line regexp 2009-10-20 09:48:03 -04:00
Dan Davison 68a1240db8 org-babel: ensure that result is returned when using :results output
One half of this patch is a revert of c167a4ac32.

These changes are necessary so that :results output works correctly
with #+lob calls. For example the following example did not work:

--------------------------------------------------
3. :results output org -> doesn't work with #+lob:
--------------------------------------------------
\#+srcname: randthree(n,max)
\#+begin_src ruby
number = n
maximum = max
puts "* Random numbers\n" +
"Here are some random numbers: " +
(1..number).collect {|x| (rand * maximum).ceil }.join(", ") +
"."
\#+end_src

\#+lob: randthree(n=3,max=10) :results output org
2009-10-20 09:24:15 -04:00