0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-08-25 05:32:51 +00:00
Commit graph

6523 commits

Author SHA1 Message Date
Eric Schulte cea9fd7421 sanding off some rough corners left by the reworking of process-params
* lisp/ob.el (org-babel-execute-src-block): generally using the new
  more informative params
  (org-babel-process-params): don't forget the :var portion of
  variable assignments
2010-10-21 13:06:55 +01:00
Eric Schulte c60e09eaa4 ob-table: simplified to reflect to var resolution
* lisp/ob-table.el (sbe): simplified to reflect to var resolution
2010-10-21 13:06:55 +01:00
Eric Schulte 8562273b27 ob-ref: don't forget arguments to referenced code blocks
* lisp/ob-ref.el (org-babel-ref-resolve): bringing the referent
  arguments back to their params before evaluation
2010-10-21 13:06:55 +01:00
Eric Schulte dc9401f95b ob-ref: cleanup of variable usage and indentation
* lisp/ob-ref.el (org-babel-ref-resolve): cleanup of variable usage
and indentation
2010-10-21 13:06:55 +01:00
Dan Davison a5ac523ec9 babel: Update sbe macro to new parameter processing
* ob-table.el (sbe): Use `org-babel-process-params params'
	instead of `org-babel-expand-variables'.
2010-10-21 13:06:54 +01:00
Dan Davison 369cf54146 babel:removing calls to ob-process-params, and updating use of results
* lisp/ob-C.el (org-babel-C-execute): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * lisp/ob-R.el (org-babel-execute:R): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
      (org-babel-R-variable-assignments): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * lisp/ob-asymptote.el (org-babel-execute:asymptote): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * lisp/ob-clojure.el (org-babel-execute:clojure): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * lisp/ob-dot.el (org-babel-execute:dot): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * lisp/ob-emacs-lisp.el (org-babel-expand-body:emacs-lisp): removing
      call to org-babel-process-params which should no longer be called
      from within a language file
      (org-babel-execute:emacs-lisp): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * lisp/ob-haskell.el (org-babel-execute:haskell): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * lisp/ob-js.el (org-babel-execute:js): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * lisp/ob-lisp.el (org-babel-execute:lisp): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * lisp/ob-ocaml.el (org-babel-execute:ocaml): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * lisp/ob-octave.el (org-babel-execute:octave): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * lisp/ob-perl.el (org-babel-execute:perl): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * lisp/ob-python.el (org-babel-execute:python): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * lisp/ob-ruby.el (org-babel-execute:ruby): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * lisp/ob-scheme.el (org-babel-execute:scheme): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * lisp/ob-screen.el (org-babel-execute:screen): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
      (org-babel-prep-session:screen): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * lisp/ob-sh.el (org-babel-execute:sh): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * lisp/ob-sql.el (org-babel-execute:sql): removing call to
      org-babel-process-params which should no longer be called from
      within a language file
    * ob-haskell.el (org-babel-execute:haskell): Remove reference
      to processed params
    * ob-clojure.el (org-babel-execute:clojure): Remove reference
      to processed params
    * ob-R.el (org-babel-execute:R): Remove reference to processed
      params
2010-10-21 13:06:54 +01:00
Dan Davison 542f77d3f5 babel: sql: Use generic expansion function
* ob-sql.el (org-babel-execute:sql): Use generic expansion
	function
	(org-babel-expand-body:sql): Delete function
2010-10-21 13:06:03 +01:00
Dan Davison 07c84b293c babel: shell: New variable assignment and expansion scheme
* ob-sh.el (org-babel-execute:sh): Use generic expansion
	function
	(org-babel-expand-body:sh): Delete function
	(org-babel-prep-session:sh): Change name of called function
	(org-babel-variable-assignments:sh): Change function name
2010-10-21 13:06:03 +01:00
Dan Davison 19081f12f7 babel: screen: New variable assignment and expansion scheme
* ob-screen.el (org-babel-execute:screen): Use generic
	expansion function
	(org-babel-expand-body:screen): Delete function
	(org-babel-prep-session:screen): Remove references to
	processed params
2010-10-21 13:06:03 +01:00
Dan Davison c1ad98ae0e babel: sass: Use generic expansion function
* ob-sass.el (org-babel-execute:sass): Use generic expansion
	function
	(org-babel-expand-body:sass): Delete function
2010-10-21 13:06:03 +01:00
Dan Davison 2fc9b08a23 babel: ruby: New variable assignment and expansion scheme
* ob-ruby.el (org-babel-execute:ruby): Use generic expansion
	function
	(org-babel-prep-session:ruby): Use new variable assignment
	function
	(org-babel-variable-assignments:ruby): New function
	(org-babel-expand-body:ruby): Delete function
2010-10-21 13:06:03 +01:00
Dan Davison 2699f4e9bc babel: python: New variable assignment and expansion scheme
* ob-python.el (org-babel-execute:python): Use generic
	expansion function
	(org-babel-prep-session:python): Change name of called function
	(org-babel-variable-assignments:python): Change function name
	(org-babel-expand-body:python): Delete function
2010-10-21 13:06:03 +01:00
Dan Davison 33f836e701 babel: plantuml: Delete unnecessary language-specific expansion function
* ob-plantuml.el (org-babel-expand-body:plantuml): Delete
    function (automatically handled by generic version)
2010-10-21 13:06:02 +01:00
Dan Davison 84dd553936 babel: perl: New variable assignment and expansion scheme
* ob-perl.el (org-babel-execute:perl): Use generic expansion
	function
	(org-babel-expand-body:perl): Delete function
	(org-babel-variable-assignments:perl): New function
2010-10-21 13:06:02 +01:00
Dan Davison ee5d7af7b9 babel: org: Delete unnecessary language-specific expansion function
* ob-org.el (org-babel-expand-body:org): Delete
    function (automatically handled by generic version)
2010-10-21 13:06:02 +01:00
Dan Davison 58a24fa325 babel: octave and matlab: New variable assignment and expansion scheme
* ob-octave.el (org-babel-execute:octave): Use generic
	expansion function
	(org-babel-variable-assignments:octave): Change name of
	function
	(org-babel-variable-assignments:matlab): New defalias
	(org-babel-prep-session:octave): Change name of function
	(org-babel-expand-body:matlab): Delete function
	(org-babel-expand-body:octave): Delete function
2010-10-21 13:06:02 +01:00
Dan Davison 590fae34e1 babel: ocaml: New variable assignment and expansion scheme
* ob-ocaml.el (org-babel-execute:ocaml): Use generic expansion
	function
	(org-babel-variable-assignments:ocaml): New function
	(org-babel-expand-body:ocaml): Delete function
2010-10-21 13:06:02 +01:00
Dan Davison 42ddb16dbf babel: mscgen: Delete unnecessary language-specific expansion function
* ob-mscgen.el (org-babel-expand-body:mscgen): Delete
    function (automatically handled by generic version)
2010-10-21 13:06:02 +01:00
Dan Davison 67fd5e730e babel: javascript: New variable assignment and expansion scheme
* ob-js.el (org-babel-execute:js): Use new variable assignment
	function
	(org-babel-expand-body:js): Delete function
	(org-babel-prep-session:js): Use new variable assignment
	function
	(org-babel-variable-assignments:js): New function
2010-10-21 13:06:02 +01:00
Dan Davison 1ab30746dc babel: haskell: New variable assignment scheme
* ob-haskell.el (org-babel-execute:haskell): Use generic
	expansion function
	(org-babel-expand-body:haskell): Delete function
	(org-babel-prep-session:haskell): Use variable assignment function
	(org-babel-variable-assignments:haskell): New function
2010-10-21 13:06:02 +01:00
Dan Davison 02a10a2bdb babel: gnuplot: New variable assignment scheme
* ob-gnuplot.el (org-babel-expand-body:gnuplot): Use variable
	assignment function
	(org-babel-prep-session:gnuplot): Use variable assignment
	function
	(org-babel-variable-assignments:gnuplot): New function
2010-10-21 13:06:02 +01:00
Dan Davison b24139309d babel: ditaa: Delete unnecessary language-specific expansion function
* ob-ditaa.el (org-babel-expand-body:ditaa): Delete
    function (automatically handled by generic version)
2010-10-21 13:06:01 +01:00
Dan Davison b4cded9221 babel: css: Delete unnecessary language-specific expansion function
* ob-css.el (org-babel-expand-body:css): Delete
	function (automatically handled by generic version)
2010-10-21 13:06:01 +01:00
Dan Davison 4eee123e17 babel: asymptote: New variable assignment scheme
* ob-asymptote.el (org-babel-execute:asymptote): Use generic
	expansion function
	(org-babel-expand-body:asymptote): Delete function
	(org-babel-variable-assignments:asymptote): New function
2010-10-21 13:06:01 +01:00
Dan Davison e3d9d21802 babel: R: New variable assignment scheme
* ob-R.el (org-babel-expand-body:R): Use new function
	`org-babel-variable-assignments:R'; don't trim body.
	(org-babel-execute:R): Respond to changes in
	`org-babel-expand-body:R'
	(org-babel-prep-session:R): Called function is now named
	`org-babel-variable-assignments:R'
	(org-babel-variable-assignments:R): Receives processed-params
	as new optional argument
2010-10-21 13:06:01 +01:00
Dan Davison 86418567cd babel: C: Don't trim body when expanding
* ob-C.el (org-babel-C-expand): Don't trim body
2010-10-21 13:06:01 +01:00
Dan Davison bdbc4961c8 babel: scheme: Fix bug in obtaining variable references
* ob-scheme.el (org-babel-expand-body:scheme): Fix bug in
	obtaining variable references
2010-10-21 13:06:01 +01:00
Dan Davison a6720e38a3 babel: tangle: Respond to changes in generic expansion function
* ob-tangle.el (org-babel-tangle-collect-blocks): Supply
	variable assignment lines to generic expansion command
2010-10-21 13:06:01 +01:00
Dan Davison 83332fb69c babel: New version of generic expansion function
* ob.el (org-babel-expand-src-block): Supply variable
	assignment lines to generic expansion function
	(org-babel-expand-body:generic): Prepend body with optional
	variable assignment lines
2010-10-21 13:06:01 +01:00
Eric Schulte 43c712fccb unifying ob-process-params and ob-expand-variables
* lisp/ob-exp.el (org-babel-exp-results): replaced old function call

* lisp/ob-lob.el (org-babel-lob-execute): replaced old function call

* lisp/ob-ref.el (org-babel-ref-parse): removed obsolete optional
  params argument, also no longer chokes when handed an
  already-resolved reference

  (org-babel-ref-resolve): removed obsolete optional params argument

* lisp/ob.el (org-babel-ref-parse): updated function declaration
  (org-babel-get-src-block-info): replaced old function call
  (org-babel-header-arg-names): indentation
  (org-babel-execute-src-block): now expanding all parameters using
  the newly combined org-babel-process-params
  (org-babel-switch-to-session-with-code): indentation
  (org-mode-hook): indentation
  (org-babel-process-params): now packages all results into the
  parameter alist and does variable expansion, this should no longer
  be called from inside of language functions
  (org-babel-expand-noweb-references): updated function call for newly
  removed obsolete function parameter
2010-10-21 13:06:01 +01:00
Eric Schulte fd97cb9386 ob-lob: now working with the new variable resolution setup
* lisp/ob-lob.el (org-babel-lob-execute): now expanding variable
  references before execution

* lisp/ob.el (org-babel-merge-params): better indentation, and finally
  sorted out the proper replacement of conflicting variable
  definitions
2010-10-21 13:06:00 +01:00
Eric Schulte 71d50277b5 ob: only sort parameters if it's required for caching
* lisp/ob.el (org-babel-execute-src-block): only sort parameters if
  it's required for caching
2010-10-21 13:06:00 +01:00
Eric Schulte 1412447d61 babel evaluation once again working in tables
* lisp/ob-table.el (sbe): reworking for better indentation and to
  integrate the new variable resolution
2010-10-21 13:06:00 +01:00
Eric Schulte 9587cdc0d0 ob-ref: now expanding variables when resolving references
* lisp/ob-ref.el (org-babel-ref-resolve-reference): now expanding
  variables when resolving references
2010-10-21 13:06:00 +01:00
Eric Schulte 1aed27c104 ob-merge-params: fixed order or precedence for variables
* lisp/ob.el (org-babel-merge-params): fixed order or precedence for
  variables
2010-10-21 13:06:00 +01:00
Eric Schulte 2ddcf9e255 removing obsoleted optional third argument from org-babel-expand-body:LANG
* lisp/ob-C.el (org-babel-expand-body:c++): removing obsoleted
  optional third argument
  (org-babel-expand-body:c++): removing obsoleted optional third
  argument
  (org-babel-C-expand): removing obsoleted optional third argument
* lisp/ob-R.el:
  (org-babel-expand-body:R): removing obsoleted optional third
  argument
  (org-babel-execute:R): removing obsoleted optional third argument
  (org-babel-R-variable-assignments): removing obsoleted optional
  third argument
* lisp/ob-asymptote.el:
  (org-babel-expand-body:asymptote): removing obsoleted optional third
  argument
  (org-babel-execute:asymptote): removing obsoleted optional third
  argument
* lisp/ob-clojure.el:
  (org-babel-expand-body:clojure): removing obsoleted optional third
  argument
  (org-babel-execute:clojure): removing obsoleted optional third
  argument
* lisp/ob-css.el:
  (org-babel-expand-body:css): removing obsoleted optional third
  argument
* lisp/ob-ditaa.el:
  (org-babel-expand-body:ditaa): removing obsoleted optional third
  argument
* lisp/ob-dot.el:
  (org-babel-expand-body:dot): removing obsoleted optional third
  argument
  (org-babel-execute:dot): removing obsoleted optional third argument
* lisp/ob-emacs-lisp.el:
  (org-babel-expand-body:emacs-lisp): removing obsoleted optional
  third argument
  (org-babel-execute:emacs-lisp): removing obsoleted optional third
  argument
* lisp/ob-gnuplot.el:
  (org-babel-expand-body:gnuplot): removing obsoleted optional third
  argument
* lisp/ob-haskell.el:
  (org-babel-expand-body:haskell): removing obsoleted optional third
  argument
  (org-babel-execute:haskell): removing obsoleted optional third
  argument
  (org-babel-load-session:haskell): removing obsoleted optional third
  (org-babel-prep-session:haskell): removing obsoleted optional third
* lisp/ob-js.el:
  (org-babel-expand-body:js): removing obsoleted optional third
  argument
  (org-babel-execute:js): removing obsoleted optional third argument
* lisp/ob-latex.el:
  (org-babel-expand-body:latex): removing obsoleted optional third
  argument
* lisp/ob-lisp.el:
  (org-babel-expand-body:lisp): removing obsoleted optional third
  argument
  (org-babel-execute:lisp): removing obsoleted optional third argument
* lisp/ob-mscgen.el:
  (org-babel-expand-body:mscgen): removing obsoleted optional third
  argument
* lisp/ob-ocaml.el:
  (org-babel-expand-body:ocaml): removing obsoleted optional third
  argument
  (org-babel-execute:ocaml): removing obsoleted optional third
  argument
* lisp/ob-octave.el:
  (org-babel-expand-body:matlab): removing obsoleted optional third
  argument
  (org-babel-expand-body:octave): removing obsoleted optional third
  argument
  (org-babel-execute:octave): removing obsoleted optional third
  argument
  (org-babel-octave-variable-assignments): removing obsoleted optional
  third
* lisp/ob-org.el:
  (org-babel-expand-body:org): removing obsoleted optional third
  argument
* lisp/ob-perl.el:
  (org-babel-expand-body:perl): removing obsoleted optional third
  argument
  (org-babel-execute:perl): removing obsoleted optional third argument
* lisp/ob-plantuml.el:
  (org-babel-expand-body:plantuml): removing obsoleted optional third
  argument
* lisp/ob-python.el:
  (org-babel-expand-body:python): removing obsoleted optional third
  argument
  (org-babel-execute:python): removing obsoleted optional third
  argument
  (org-babel-python-variable-assignments): removing obsoleted optional
  third
* lisp/ob-ruby.el:
  (org-babel-expand-body:ruby): removing obsoleted optional third
  argument
  (org-babel-execute:ruby): removing obsoleted optional third argument
* lisp/ob-sass.el:
  (org-babel-expand-body:sass): removing obsoleted optional third
  argument
* lisp/ob-scheme.el:
  (org-babel-expand-body:scheme): removing obsoleted optional third
  argument
  (org-babel-execute:scheme): removing obsoleted optional third
  argument
* lisp/ob-screen.el:
  (org-babel-expand-body:screen): removing obsoleted optional third
  argument
* lisp/ob-sh.el:
  (org-babel-expand-body:sh): removing obsoleted optional third
  argument
  (org-babel-execute:sh): removing obsoleted optional third argument
  (org-babel-sh-variable-assignments): removing obsoleted optional
  third
* lisp/ob-sql.el:
  (org-babel-expand-body:sql): removing obsoleted optional third
  argument
* lisp/ob-sqlite.el:
  (org-babel-expand-body:sqlite): removing obsoleted optional third
  argument
  (org-babel-execute:sqlite): removing obsoleted optional third
  argument
* lisp/ob.el:
  (org-babel-expand-body:generic): removing obsoleted optional third
  argument
2010-10-21 13:06:00 +01:00
Eric Schulte f16c46c856 babel: purging all calls to removed org-babel-ref-variables
* lisp/ob-clojure.el (org-babel-prep-session:clojure): purging all
  calls to removed org-babel-ref-variables

* lisp/ob-gnuplot.el (org-babel-gnuplot-process-vars): purging all
  calls to removed org-babel-ref-variables

* lisp/ob-ruby.el (org-babel-prep-session:ruby): purging all calls to
  removed org-babel-ref-variables

* lisp/ob-scheme.el (org-babel-prep-session:scheme): purging all calls
  to removed org-babel-ref-variables

* lisp/ob-sqlite.el (org-babel-expand-body:sqlite): purging all calls
  to removed org-babel-ref-variables

  (org-babel-execute:sqlite): purging all calls to removed
  org-babel-ref-variables
2010-10-21 13:06:00 +01:00
Eric Schulte 832dc71f31 ob-lob: now working with the new ob-get-src-block-info
ob-get-src-block-info wasn't correctly returning the name of the
  code block

* lisp/ob-lob.el (org-babel-lob-ingest): now returns the count of
  ingested code blocks

* lisp/ob.el (org-babel-get-src-block-info): walks up possible
  additional header arg lines before checking for the code block name

  (org-babel-merge-params): can now handle empty variables gracefully
2010-10-21 13:06:00 +01:00
Eric Schulte 3ab7f12792 org-test is now ready for the newyears 2010-10-21 13:06:00 +01:00
Eric Schulte 9931dae20a babel: exporting now working with the new ob-get-src-block-info schema
includes a simple export test

* lisp/ob-exp.el (org-babel-exp-in-export-file): wrapper for
  collecting information from within the original export file

  (org-babel-exp-src-blocks): simplified through use of the above
  macro

  (org-babel-exp-code): simplified through the use of new functions
  for parsing header arguments

  (org-babel-exp-results): simpler high-level organization, also this
  is now where the expansion of variable references takes place during
  export

* lisp/ob.el (org-babel-expand-variables): broke variable replacement
  in a parameter list into it's own function

  (org-babel-get-src-block-info): now using the above function
2010-10-21 13:05:59 +01:00
Eric Schulte 9ba9ef99a6 babel: now allows multi-line header arguments with #+headers: before code block
for example, from the test of this functionality
* multi-line header arguments
  :PROPERTIES:
  :ID:       b77c8857-6c76-4ea9-8a61-ddc2648d96c4
  :END:

  (map 'list #'list numbers letters)

| 1 | a |
| 2 | b |
| 3 | c |
| 4 | d |
| 5 | e |
| 6 | f |
| 7 | g |

* lisp/ob.el (org-babel-multi-line-header-regexp): new variable for
  matching header lines preceding code blocks

  (org-babel-src-name-w-name-regexp): now includes possible header
  lines between source name and code block

  (org-babel-get-src-block-info): now also collecting header arguments
  from preceding header lines

  (org-babel-src-block-names): updated match-string to reflect new
  value of org-babel-src-name-w-name-regexp

  (org-babel-merge-params): fixed error in variable string regexp
2010-10-21 13:05:59 +01:00
Eric Schulte 05054d5227 ensure ob-get-src-block-info returns nil if not matches
* lisp/ob.el (org-babel-get-src-block-info): small but crucial fix,
  this should return nil if not match found
2010-10-21 13:05:59 +01:00
Eric Schulte 3d2aec3588 adding simple test of variable resolution 2010-10-21 13:05:59 +01:00
Eric Schulte a9f3c9fe11 now using newer version of jump.el -- run $ git submodule update 2010-10-21 13:05:59 +01:00
Eric Schulte 529e7c98fd nominally working 2010-10-21 13:05:59 +01:00
Eric Schulte 9c0aae1814 more lightening -- resolving foreign functions between ob-ref and ob 2010-10-21 13:05:59 +01:00
Eric Schulte 539c804457 ob-emacs-lisp: whitespace cleanup <=80 columns
* lisp/ob-emacs-lisp.el (org-babel-expand-body:emacs-lisp): whitespace
  (org-babel-execute:emacs-lisp): whitespace
2010-10-21 13:05:58 +01:00
Eric Schulte c2dce939e8 more lightening 2010-10-21 13:05:58 +01:00
Dan Davison 07b45a64f2 Missing parenthesis 2010-10-21 13:05:58 +01:00
Dan Davison a06ea76c53 babel: Provide missing docstrings
* ob-sh.el (org-babel-sh-variable-assignments):
	Provide missing docstring
	* ob-python.el (org-babel-python-variable-assignments):
	Provide missing docstring
2010-10-21 13:05:58 +01:00