Commit Graph

443 Commits

Author SHA1 Message Date
Bastien Guerry 5fc740a230 Merge branch 'maint' 2013-01-08 15:04:40 +01:00
Bastien Guerry 72bc144c15 Update Copyright lines to match Emacs format. 2013-01-08 15:04:32 +01:00
Bastien Guerry 60b23bdeac Merge branch 'maint'
Conflicts:
	contrib/lisp/htmlize.el
	etc/schema/od-manifest-schema-v1.2-os.rnc
	etc/schema/od-schema-v1.2-os.rnc
	lisp/org-exp-blocks.el
2013-01-01 16:06:17 +01:00
Bastien Guerry 98cd4687a2 Update copyright years.
Happy new year!
2013-01-01 16:04:24 +01:00
Bastien Guerry 9333426c12 Re-apply commit 27bcf9a together with a workaround for `process-file'.
Thanks to Michael Albinus for hunting this bug and for providing
this workaround.
2012-12-21 09:45:53 +01:00
Bastien Guerry 483aa1312d Revert "Backport revno 111277 from Emacs trunk."
This reverts commit 27bcf9a70b.
2012-12-21 08:50:26 +01:00
Michael Albinus 27bcf9a70b Backport revno 111277 from Emacs trunk.
* ob.el (org-babel-temp-file): Fix setting of
`temporary-file-directory' on remote hosts.

* ob-eval.el (org-babel-shell-command-on-region): Use
`process-file' instead of `call-process-region'.  The latter one
does not work on remote hosts.
2012-12-20 15:49:19 +01:00
Eric Schulte ff0081847c requiring ob now pulls in all of Babel 2012-12-12 10:48:56 -07:00
Eric Schulte 0694965865 renaming lisp/ob.el to lisp/ob-core.el 2012-12-12 10:48:56 -07:00
Achim Gratz 01bf706f7f org-babel: fix bug introduced in commit 78cdf149
* lisp/ob.el (org-babel-result-cond): Macro expansion needs to unquote
  formal parameter `result-params´.
2012-12-12 10:48:56 -07:00
nrichard (geodiff-mac3) 2f9ddaf699 ob: Fix org-babel-edit-distance for insertion/deletion
* lisp/ob.el (org-babel-edit-distance): When insertion or deletion are
  needed, make sure the distance is incremented.  In addition, the now
  obsolete mmin function was removed.
2012-12-07 12:41:53 -07:00
Nicolas Goaziou 8783b89311 ob: Rename *org-babel-use-quick-and-dirty-noweb-expansion*
* lisp/ob.el (org-babel-use-quick-and-dirty-noweb-expansion): Renamed
  from *org-babel-use-quick-and-dirty-noweb-expansion*.
(org-babel-expand-noweb-references): Use new variable name.

This patch brings back the variable in the expected namespace.
2012-11-30 13:58:31 +01:00
Eric Schulte 78cdf14939 org-babel-result-cond - unified handling of results
* lisp/ob.el (org-babel-result-cond): This function should now be used
  by all language backends to handle the processing of raw code block
  output into scalar results, table results, or ignored results
  depending on the value of result-params.

* lisp/ob-C.el (org-babel-C-execute): Use org-babel-result-cond.
* lisp/ob-R.el (org-babel-R-evaluate-external-process): Use
  org-babel-result-cond.
  (org-babel-R-evaluate-session): Use org-babel-result-cond.
* lisp/ob-awk.el (org-babel-execute:awk): Use org-babel-result-cond.
* lisp/ob-clojure.el (org-babel-execute:clojure): Use
  org-babel-result-cond.
* lisp/ob-emacs-lisp.el (org-babel-execute:emacs-lisp): Use
  org-babel-result-cond.
* lisp/ob-fortran.el (org-babel-execute:fortran): Use
  org-babel-result-cond.
* lisp/ob-io.el (org-babel-io-evaluate): Use org-babel-result-cond.
* lisp/ob-java.el (org-babel-execute:java): Use org-babel-result-cond.
* lisp/ob-lisp.el (org-babel-execute:lisp): Use org-babel-result-cond.
* lisp/ob-maxima.el (org-babel-execute:maxima): Use
  org-babel-result-cond.
* lisp/ob-picolisp.el (org-babel-execute:picolisp): Use
  org-babel-result-cond.
* lisp/ob-python.el (org-babel-python-evaluate-external-process): Use
  org-babel-result-cond.
  (org-babel-python-evaluate-session): Use org-babel-result-cond.
* lisp/ob-scala.el (org-babel-scala-evaluate): Use org-babel-result-cond.
* lisp/ob-sh.el (org-babel-sh-evaluate): Use org-babel-result-cond.
* lisp/ob-shen.el (org-babel-execute:shen): Use org-babel-result-cond.
* lisp/ob-sql.el (org-babel-execute:sql): Use org-babel-result-cond.
* lisp/ob-sqlite.el (org-babel-execute:sqlite): Use
  org-babel-result-cond.
2012-11-18 21:58:38 -07:00
Eric Schulte c2223c8979 still execute code block even if :results none
* lisp/ob.el (org-babel-execute-src-block): Fixed bug introduced in
  d4b739f.
2012-11-17 17:54:08 -07:00
Eric Schulte d4b739fbf2 "none" header avoids result post-process
This patch introduces a new header argument which hide all code block
results from Emacs so that they are not processed into Emacs-lisp
objects; a process which may take a great deal of time for large
objects.

* lisp/ob.el (org-babel-common-header-args-w-values): Adding the new
  "none" header argument.
  (org-babel-execute-src-block): Don't do *any* result processing if the
  "none" header argument has been specified.
  (org-babel-sha1-hash): Remove the none header argument from
  header arg lists when calculating cache sums.
  (org-babel-insert-result): Flesh out some documentation.
2012-11-17 10:08:45 -07:00
Eric Schulte c2ebeea6f6 fix bug in drawer results (should not escape)
* lisp/ob.el (org-babel-insert-result): Don't escape results in drawers.
2012-11-06 06:20:43 -07:00
Nicolas Goaziou 2f2a80fe06 ob: Fix block evaluation in a narrowed buffer
* lisp/ob.el (org-babel-where-is-src-block-result): Insert new results
  keyword in current narrowed part of buffer, if necessary. Small
  refactoring.
(org-babel-insert-result): Do not widen buffer when new results have
to be inserted.  Therefore, results inserted after the last block of
a narrowed buffer still belong to the narrowed part of the buffer.
* testing/lisp/test-ob.el: Add tests.
* testing/lisp/test-ob-exp.el: Move test to test-ob.el
2012-10-28 16:21:30 +01:00
Bastien Guerry 4f0b3bfe0c Merge branch 'maint' 2012-10-02 13:07:09 +02:00
Bastien Guerry 5fc07bce0a Declare functions and variables. 2012-10-02 11:19:29 +02:00
Bastien Guerry 63d8c8ea0e ob.el: Minor code clean up. 2012-10-02 09:55:42 +02:00
Bastien Guerry e4c31cf98b Use generated-autoload-file: "org-loaddefs.el" as a local variable. 2012-10-02 08:50:46 +02:00
Nicolas Goaziou 2a95a47c5f Merge branch 'maint' 2012-10-01 21:37:48 +02:00
Nicolas Goaziou fac86b03fe Normalize comma-escaping of src-blocks and example-blocks
* lisp/org-src.el (org-escape-code-in-string,
  org-unescape-code-in-string, org-escape-code-in-region,
  org-unescape-code-in-region): New functions.
(org-edit-src-code, org-edit-src-exit): Use new functions.
* lisp/org.el (org-strip-protective-commas): Removed function.
* lisp/org-exp.el (org-export-select-backend-specific-text): Use new
  function.
* lisp/ob.el (org-babel-parse-src-block-match,
  org-babel-parse-inline-src-block-match, org-babel-insert-result):
  Always escape produced blocks, independently on the language of the
  block, if any.  Use new functions.
* doc/org.texi: Update documentation.
* testing/lisp/test-ob.el: Update test.
2012-10-01 21:24:00 +02:00
Bastien Guerry f155f5458e Merge branch 'maint' 2012-09-29 08:28:34 +02:00
Eric Schulte 7a06ed790a marginally less hacky comma escaping of org blocks
* ob.el (org-babel-insert-result): Replace key sequence with
  function call.  Use a more informative flag to the local function.
  (org-add-protective-commas): Declare a new external function.
* org-src.el (org-add-protective-commas): This should be its own
  function.
  (org-edit-src-exit): Use the new function.
2012-09-29 08:12:26 +02:00
Bastien Guerry 5ba6bd859a Merge branch 'maint' 2012-09-28 00:13:15 +02:00
Bastien Guerry b0c5030c85 ob.el (org-babel-insert-result): Comma-escape results inserted with ":results org"
* ob.el (org-babel-insert-result): Comma-escape results
inserted with ":results org".
2012-09-27 23:49:08 +02:00
Bastien Guerry b50c465c17 Merge branch 'maint' 2012-09-26 10:56:20 +02:00
Bastien Guerry 440b9388d4 ob.el: Reintroduce ":results org" but using "#+BEGIN_SRC org", not "#+BEGIN_ORG"
* ob.el (org-babel-common-header-args-w-values)
(org-babel-insert-result): Reintroduce ":results org" but
using "#+BEGIN_SRC org", not "#+BEGIN_ORG".

* org.texi (results): Update documentation for ":results
drawer" and ":results org".
2012-09-26 10:56:16 +02:00
Bastien Guerry a2408063f9 Merge branch 'maint' 2012-09-26 09:49:26 +02:00
Bastien Guerry 4ebfe4f030 ob.el: Remove "org" the list of predefined values for the ":results" parameter
* ob.el (org-babel-common-header-args-w-values): Remove "org"
the list of predefined values for the ":results" parameter.

This complete the previous fix (commit 203e50b).
2012-09-26 09:49:09 +02:00
Bastien Guerry 60626e7406 Merge branch 'maint' 2012-09-26 09:39:02 +02:00
Bastien Guerry 203e50b89b * ob.el (org-babel-insert-result): Remove support for ":results org"
* ob.el (org-babel-insert-result): Remove support for
":results org".

The insertion of #+BEGIN_ORG was confusing.  You can either use
":results raw" to insert the raw results or ":results drawer" to
wrap them into a :RESULTS: ... :END: drawer.
2012-09-26 09:38:49 +02:00
Bastien Guerry e4a01d0dde ob.el: Deprecate ":results wrap" in favor of ":results drawer"
* ob.el (org-babel-common-header-args-w-values)
(org-babel-insert-result): Deprecate ":results wrap" in favor
of ":results drawer".
2012-09-26 09:23:51 +02:00
Eric Schulte 0a6165a555 widen buffer restrictions when inserting results 2012-09-05 12:02:48 -06:00
Bastien Guerry a740781fe2 ob.el (org-babel-named-src-block-regexp-for-name): Generate a more general regexp
* ob.el (org-babel-named-src-block-regexp-for-name): Generate
a more general regexp.

Thanks to Loris Bennett for reporting this, and to Nicolas Girard for
pointing out what was the problem precisely.
2012-08-30 08:58:02 +02:00
Bastien Guerry 4b3f64fdcc ob.el: Find a src block head correctly when #+header(s) is before #+name
* ob.el (org-babel-where-is-src-block-head): Find a src block
head correctly when #+header(s) is before #+name.
2012-08-30 08:45:50 +02:00
Sean O'Halpin 4b6b6f4799 Make it possible to use buffer local noweb start/end patterns
* lisp/ob.el (org-babel-expand-noweb-references): Capture current
noweb start and end patterns then use to set buffer locals in
(with-temp-buffer) form.

This solves the problem that using different patterns for
org-babel-noweb-wrap-start and org-babel-noweb-wrap-end could be done
only globally.

TINYCHANGE
2012-08-26 19:26:01 +02:00
Bastien Guerry 8393a76f78 Always use the compatibility function `org-region-active-p'
* org.el (org-create-math-formula): Use the compatibility
function `org-region-active-p'.

* org-odt.el (org-export-as-odf): Ditto.

* ob.el (org-babel-demarcate-block): Ditto.
2012-08-20 05:45:25 +02:00
Bastien Guerry cacb08334a Merge branch 'org-no-properties' 2012-08-15 14:43:35 +02:00
Bastien Guerry b62604236d Replace `org-labels' by `let*'
* ob.el (org-babel-sha1-hash, org-babel-noweb-p): Replace
`org-labels' by `let*'.

* org-bibtex.el (org-bibtex-headline): Ditto.

* org-compat.el: Delete `org-labels'.
2012-08-15 09:56:35 +02:00
Bastien Guerry 9afc2ac56b ob-*.el: Use ̀org-no-properties' instead of `org-babel-clean-text-properties'
* ob.el (org-babel-get-src-block-info)
(org-babel-check-src-block, org-babel-current-result-hash)
(org-babel-parse-src-block-match, org-babel-read-link)
(org-babel-insert-result, org-babel-clean-text-properties):
Use ̀org-no-properties' instead of
`org-babel-clean-text-properties'.
(org-babel-clean-text-properties): Delete redundant function
`org-babel-clean-text-properties'.

* ob-tangle.el (org-babel-tangle-collect-blocks)
(org-babel-tangle-comment-links): Ditto.

* ob-table.el (sbe): Ditto.

* ob-lob.el (org-babel-lob-get-info)
(org-babel-lob-execute): Ditto.

* ob-exp.el (org-babel-exp-non-block-elements): Ditto.
2012-08-15 09:39:24 +02:00
Eric Schulte 37e19ea2d0 Revert "Don't use `org-labels'"
This reverts commit 9d4e1517b6.
2012-08-13 08:17:46 -06:00
Eric Schulte 9d4e1517b6 Don't use `org-labels'
Reworking the previous commit which attempted to remove org-labels.

* org-compat.el (org-labels): Remove.

* org-bibtex.el (org-bibtex-headline): Don't use `org-labels'.

* ob.el (org-babel-sha1-hash, org-babel-noweb-p): Ditto.
2012-08-13 07:42:17 -06:00
Bastien Guerry 525e96a97e Revert "Don't use `org-labels'"
This reverts commit ba16c3c6f5.
2012-08-13 06:37:57 +02:00
Bastien Guerry 09743f48d6 Fix many small typos. 2012-08-13 05:59:44 +02:00
Bastien Guerry 9a9d4e3666 Fix some warnings. 2012-08-13 00:36:15 +02:00
Bastien Guerry 70dd1196d2 Massive code clean-up.
Delete trailing whitespaces.
Indent all sexps correctly.
Sentences end with double spaces.
2012-08-11 19:10:44 +02:00
Bastien Guerry ba16c3c6f5 Don't use `org-labels'
* org-compat.el (org-labels): Remove.

* org-bibtex.el (org-bibtex-headline): Don't use `org-labels'.

* ob.el (org-babel-sha1-hash, org-babel-noweb-p): Ditto.
2012-08-11 10:43:56 +02:00
Bastien Guerry 6c7ac786aa ob.el: Don't use `org-flet'
* ob.el (org-babel-edit-distance, org-babel-sha1-hash)
(org-babel-get-rownames, org-babel-insert-result)
(org-babel-merge-params)
(org-babel-expand-noweb-references): Don't use `org-flet'.
Also indent some functions correctly.
2012-08-10 17:44:45 +02:00