Thanks to Thorsten Jolitz for contributing support for this new
language.
* Makefile (LISPF): Add ob-picolisp to the Makefile.
* contrib/babel/langs/ob-picolisp.el: Remove from contrib.
* lisp/ob-picolisp.el: Add to core lisp directory.
* lisp/org.el (org-babel-load-languages): Add Pico Lisp to the list of
supported code block languages.
Nick Dokos <nicholas.dokos@hp.com> writes:
> Eric Schulte <schulte.eric@gmail.com> wrote:
>
>> The attached updated patch fixes a bug in the original.
>>
>
> Minor problem in applying:
>
> ,----
> | $ git apply ~/Mail/inbox/724
> | /home/nick/Mail/inbox/724:671: trailing whitespace.
> | #+name:
> | /home/nick/Mail/inbox/724:599: new blank line at EOF.
> | +
> | warning: 2 lines add whitespace errors.
> `----
The attached version fixes these issues, Thanks -- Eric
>From 0e43d59ee8d46a63f86780a502de726271bc39de Mon Sep 17 00:00:00 2001
From: Eric Schulte <schulte.eric@gmail.com>
Date: Fri, 28 Oct 2011 10:44:21 -0600
Subject: [PATCH] removing code block, results and call-line synonyms -- BREAKING CHANGE
Following a round of on-list discussion many code block synonyms have
been removed, moving forward the following syntax is valid.
- call lines are specified with #+call:
- code blocks are named with #+name:
- results are named with #+name:, however results generated by a code
block may still be labeled with #+results:, and tables named with
#+tblname: will be considered to be named results
The following function may be used to update an existing Org-mode
buffer to the new syntax.
(defun update-org-buffer ()
"Update an Org-mode buffer to the new data, code block and call line syntax."
(interactive)
(save-excursion
(flet ((to-re (lst) (concat "^[ \t]*#\\+" (regexp-opt lst t)
"\\(\\[\\([[:alnum:]]+\\)\\]\\)?\\:[ \t]*"))
(update (re new)
(goto-char (point-min))
(while (re-search-forward re nil t)
(replace-match new nil nil nil 1))))
(let ((old-re (to-re '("RESULTS" "DATA" "SRCNAME" "SOURCE")))
(lob-re (to-re '("LOB")))
(case-fold-search t))
(update old-re "name")
(update lob-re "call")))))
Note: If an old version of Org-mode (e.g., the one shipped with Emacs)
is installed on your system many of the important variables will
be pre-defined with a defvar and *will not* have their values
automatically updated, these include the following.
- org-babel-data-names
- org-babel-result-regexp
- org-babel-src-block-regexp
- org-babel-src-name-regexp
- org-babel-src-name-w-name-regexp
It may be necessary to either remove the source code of older
versions of Org-mode, or to explicitly evaluate the ob.el file.
* lisp/ob-exp.el (org-exp-res/src-name-cleanup): Updated
Documentation.
* lisp/ob-lob.el (org-babel-block-lob-one-liner-regexp): Updated
regular expression.
(org-babel-inline-lob-one-liner-regexp): Updated regular expression.
* lisp/ob-ref.el (org-babel-ref-resolve): Notice when something that
looks like a data results may actually be a code block.
* lisp/ob-table.el: Updated documentation.
* lisp/ob.el (org-babel-src-name-regexp): Simplified regexp.
(org-babel-get-src-block-info): Updated match strings.
(org-babel-data-names): Simplified acceptable names.
(org-babel-find-named-block): Indentation.
(org-babel-find-named-result): Updated to not return a code block as
a result.
* lisp/org.el (org-fontify-meta-lines-and-blocks-1): Removing
references to old syntactic elements.
(org-additional-option-like-keywords): Removing references to old
syntactic elements.
* contrib/babel/library-of-babel.org: Updated to make use of the new
syntax.
* testing/examples/babel-dangerous.org: Updated to make use of the new
syntax.
* testing/examples/babel.org: Updated to make use of the new syntax.
* testing/examples/ob-awk-test.org: Updated to make use of the new
syntax.
* testing/examples/ob-fortran-test.org: Updated to make use of the new
syntax.
* testing/lisp/test-ob.el: Removed two bad tests which tested the
literal values of old regular expressions rather than their
behavior.
Thanks to Sergey Litvinov for contributing this language support!
* lisp/ob-fortran.el: Adding support for Fortran code blocks.
* Makefile (LISPF): Compile Fortran support.
* lisp/org.el (org-babel-load-languages): Adding fortran to this list.
* contrib/babel/langs/ob-fortran.el (org-babel-fortran-var-to-fortran):
Replacing usage of characterp with integerp (which should work w/Emacs22).
* lisp/ob-C.el (org-babel-C-var-to-C): Replacing usage of characterp
with integerp (which should work w/Emacs22).
* lisp/org.el (org-promote):
(org-demote): Turn off after-change-functions to speed up the
reindentation of text.
This is mainly toob-oz: brought up to date with the rest of Babel
#+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
* 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
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
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
* 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
* 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
* 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
* 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.
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
* 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
* 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