Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
afe98dfa
Commit
afe98dfa
authored
Nov 11, 2010
by
Carsten Dominik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Install org-mode version 7.3
parent
df26e1f5
Changes
100
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
75 changed files
with
8114 additions
and
2419 deletions
+8114
-2419
doc/misc/ChangeLog
doc/misc/ChangeLog
+141
-0
doc/misc/org.texi
doc/misc/org.texi
+599
-364
etc/ChangeLog
etc/ChangeLog
+5
-0
etc/refcards/orgcard.tex
etc/refcards/orgcard.tex
+6
-2
lisp/org/ChangeLog
lisp/org/ChangeLog
+3333
-0
lisp/org/ob-C.el
lisp/org/ob-C.el
+21
-25
lisp/org/ob-R.el
lisp/org/ob-R.el
+120
-98
lisp/org/ob-asymptote.el
lisp/org/ob-asymptote.el
+20
-17
lisp/org/ob-calc.el
lisp/org/ob-calc.el
+67
-0
lisp/org/ob-clojure.el
lisp/org/ob-clojure.el
+37
-35
lisp/org/ob-comint.el
lisp/org/ob-comint.el
+22
-2
lisp/org/ob-css.el
lisp/org/ob-css.el
+1
-4
lisp/org/ob-ditaa.el
lisp/org/ob-ditaa.el
+12
-10
lisp/org/ob-dot.el
lisp/org/ob-dot.el
+15
-12
lisp/org/ob-emacs-lisp.el
lisp/org/ob-emacs-lisp.el
+13
-13
lisp/org/ob-eval.el
lisp/org/ob-eval.el
+5
-6
lisp/org/ob-exp.el
lisp/org/ob-exp.el
+83
-68
lisp/org/ob-gnuplot.el
lisp/org/ob-gnuplot.el
+19
-13
lisp/org/ob-haskell.el
lisp/org/ob-haskell.el
+32
-36
lisp/org/ob-js.el
lisp/org/ob-js.el
+165
-0
lisp/org/ob-keys.el
lisp/org/ob-keys.el
+16
-7
lisp/org/ob-latex.el
lisp/org/ob-latex.el
+89
-67
lisp/org/ob-ledger.el
lisp/org/ob-ledger.el
+72
-0
lisp/org/ob-lisp.el
lisp/org/ob-lisp.el
+106
-0
lisp/org/ob-lob.el
lisp/org/ob-lob.el
+37
-33
lisp/org/ob-matlab.el
lisp/org/ob-matlab.el
+1
-1
lisp/org/ob-mscgen.el
lisp/org/ob-mscgen.el
+1
-4
lisp/org/ob-ocaml.el
lisp/org/ob-ocaml.el
+14
-15
lisp/org/ob-octave.el
lisp/org/ob-octave.el
+50
-52
lisp/org/ob-org.el
lisp/org/ob-org.el
+62
-0
lisp/org/ob-perl.el
lisp/org/ob-perl.el
+20
-23
lisp/org/ob-plantuml.el
lisp/org/ob-plantuml.el
+83
-0
lisp/org/ob-python.el
lisp/org/ob-python.el
+110
-98
lisp/org/ob-ref.el
lisp/org/ob-ref.el
+28
-38
lisp/org/ob-ruby.el
lisp/org/ob-ruby.el
+31
-37
lisp/org/ob-sass.el
lisp/org/ob-sass.el
+7
-8
lisp/org/ob-scheme.el
lisp/org/ob-scheme.el
+139
-0
lisp/org/ob-screen.el
lisp/org/ob-screen.el
+5
-12
lisp/org/ob-sh.el
lisp/org/ob-sh.el
+46
-51
lisp/org/ob-sql.el
lisp/org/ob-sql.el
+16
-12
lisp/org/ob-sqlite.el
lisp/org/ob-sqlite.el
+9
-9
lisp/org/ob-table.el
lisp/org/ob-table.el
+29
-13
lisp/org/ob-tangle.el
lisp/org/ob-tangle.el
+219
-66
lisp/org/ob.el
lisp/org/ob.el
+642
-349
lisp/org/org-agenda.el
lisp/org/org-agenda.el
+212
-78
lisp/org/org-archive.el
lisp/org/org-archive.el
+3
-3
lisp/org/org-ascii.el
lisp/org/org-ascii.el
+32
-23
lisp/org/org-attach.el
lisp/org/org-attach.el
+1
-1
lisp/org/org-bbdb.el
lisp/org/org-bbdb.el
+4
-5
lisp/org/org-beamer.el
lisp/org/org-beamer.el
+3
-3
lisp/org/org-bibtex.el
lisp/org/org-bibtex.el
+1
-1
lisp/org/org-capture.el
lisp/org/org-capture.el
+82
-40
lisp/org/org-clock.el
lisp/org/org-clock.el
+37
-14
lisp/org/org-colview.el
lisp/org/org-colview.el
+63
-20
lisp/org/org-compat.el
lisp/org/org-compat.el
+31
-2
lisp/org/org-crypt.el
lisp/org/org-crypt.el
+1
-1
lisp/org/org-ctags.el
lisp/org/org-ctags.el
+2
-2
lisp/org/org-datetree.el
lisp/org/org-datetree.el
+1
-1
lisp/org/org-docbook.el
lisp/org/org-docbook.el
+47
-81
lisp/org/org-docview.el
lisp/org/org-docview.el
+6
-3
lisp/org/org-entities.el
lisp/org/org-entities.el
+1
-1
lisp/org/org-exp-blocks.el
lisp/org/org-exp-blocks.el
+3
-2
lisp/org/org-exp.el
lisp/org/org-exp.el
+208
-72
lisp/org/org-faces.el
lisp/org/org-faces.el
+1
-1
lisp/org/org-feed.el
lisp/org/org-feed.el
+10
-19
lisp/org/org-footnote.el
lisp/org/org-footnote.el
+18
-12
lisp/org/org-freemind.el
lisp/org/org-freemind.el
+223
-100
lisp/org/org-gnus.el
lisp/org/org-gnus.el
+57
-4
lisp/org/org-habit.el
lisp/org/org-habit.el
+7
-5
lisp/org/org-html.el
lisp/org/org-html.el
+430
-300
lisp/org/org-icalendar.el
lisp/org/org-icalendar.el
+46
-10
lisp/org/org-id.el
lisp/org/org-id.el
+2
-1
lisp/org/org-indent.el
lisp/org/org-indent.el
+9
-7
lisp/org/org-info.el
lisp/org/org-info.el
+1
-1
lisp/org/org-inlinetask.el
lisp/org/org-inlinetask.el
+24
-6
No files found.
doc/misc/ChangeLog
View file @
afe98dfa
2010-11-11 Noorul Islam <noorul@noorul.com>
* org.texi: Fix typo
2010-11-11 Carsten Dominik <carsten.dominik@gmail.com>
* org.texi (Using capture): Explain that refiling is
sensitive to cursor position.
2010-11-11 Carsten Dominik <carsten.dominik@gmail.com>
* org.texi (Images and tables): Add cross reference to
link section.
2010-11-11 Carsten Dominik <carsten.dominik@gmail.com>
* org.texi: Document the <c> cookie.
2010-11-11 Eric Schulte <schulte.eric@gmail.com>
* multi-line header arguments :PROPERTIES: :ID:
b77c8857-6c76-4ea9-8a61-ddc2648d96c4 :END:
2010-11-11 Carsten Dominik <carsten.dominik@gmail.com>
* org.texi (CSS support): Document :HTML_CONTAINER_CLASS:
property
2010-11-11 Carsten Dominik <carsten.dominik@gmail.com>
* org.texi (Project alist): Mention that this is a
property list
2010-11-11 Carsten Dominik <carsten.dominik@gmail.com>
* org.texi (Setting up the staging area): Document that
file names remain visible when encrypting the MobileOrg files.
2010-11-11 Carsten Dominik <carsten.dominik@gmail.com>
* org.texi (Setting up the staging area): Document which
versions are needed for encryption.
2010-11-11 Eric Schulte <schulte.eric@gmail.com>
* org.texi (noweb): updating :noweb documentation to
reflect the new "tangle" argument
2010-11-11 Sebastian Rose, Hannover, Germany <sebastian_rose@gmx.de>
* org-test-which-func: New function. Find name of defun
around point.
2010-11-11 Eric Schulte <schulte.eric@gmail.com>
* org.texi (Batch execution): improved tangling script in
documentation
2010-11-11 Carsten Dominik <carsten.dominik@gmail.com>
* org.texi (Handling links):
(In-buffer settings): Document inlining images on startup.
2010-11-11 Carsten Dominik <carsten.dominik@gmail.com>
* org.texi (Setting up the staging area): Document use of
crypt password.
2010-11-11 David Maus <dmaus@ictsoc.de>
* org.texi (Template expansion): Add date related link
type escapes
2010-11-11 David Maus <dmaus@ictsoc.de>
* org.texi (Template expansion): Add mew in table for
link type escapes.
2010-11-11 David Maus <dmaus@ictsoc.de>
* org.texi (Template expansion): Fix typo in link type
escapes.
2010-11-11 Eric Schulte <schulte.eric@gmail.com>
* org.texi (Structure of code blocks): another
documentation tweak
2010-11-11 Eric Schulte <schulte.eric@gmail.com>
* org.texi (Structure of code blocks): documentation
tweak
2010-11-11 Eric Schulte <schulte.eric@gmail.com>
* org.texi (Structure of code blocks): updating
documentation to mention inline code block syntax
2010-11-11 Eric Schulte <schulte.eric@gmail.com>
* org.texi (comments): improved wording
2010-11-11 Eric Schulte <schulte.eric@gmail.com>
* org.texi (comments): documenting the new :comments
header arguments
2010-11-11 Carsten Dominik <carsten.dominik@gmail.com>
* org.texi (Installation): Remove the special
installation instructions for XEmacs.
2010-11-11 Jambunathan K <kjambunathan@gmail.com> (tiny change)
* org.texi (Easy Templates): New section. Documents quick
insertion of empty structural elements.
2010-11-11 Noorul Islam <noorul@noorul.com>
* org.texi: Fix doc
2010-11-11 Jambunathan K <kjambunathan@gmail.com> (tiny change)
* org.texi (The date/time prompt): Document specification
of time ranges.
2010-11-11 Carsten Dominik <carsten.dominik@gmail.com>
* org.texi (Internal links): Document the changes in
internal links.
2010-11-11 Carsten Dominik <carsten.dominik@gmail.com>
* org.texi (Agenda commands): Document the limitation for
the filter preset - it can only be used for an entire agenda
view, not in an individual block in a block agenda.
2010-11-11 Eric S Fraga <e.fraga@ucl.ac.uk>
* org.texi (iCalendar export): Document alarm creation.
2010-11-10 Michael Albinus <michael.albinus@gmx.de>
2010-11-10 Michael Albinus <michael.albinus@gmx.de>
* dbus.texi (Type Conversion): Introduce `:unix-fd' type mapping.
* dbus.texi (Type Conversion): Introduce `:unix-fd' type mapping.
...
...
doc/misc/org.texi
View file @
afe98dfa
This diff is collapsed.
Click to expand it.
etc/ChangeLog
View file @
afe98dfa
2010-11-11 Eric Schulte <schulte.eric@gmail.com>
* refcards/orgcard.tex: adding new Babel key sequences to the
org refcard
2010-10-26 Glenn Morris <rgm@gnu.org>
2010-10-26 Glenn Morris <rgm@gnu.org>
* images/README: Add (un)checked.xpm
* images/README: Add (un)checked.xpm
...
...
etc/refcards/orgcard.tex
View file @
afe98dfa
% Reference Card for Org Mode
% Reference Card for Org Mode
\def\orgversionnumber
{
7.
01
}
\def\orgversionnumber
{
7.
3
}
\def\versionyear
{
2010
}
% latest update
\def\versionyear
{
2010
}
% latest update
\def\year
{
2010
}
% latest copyright year
\def\year
{
2010
}
% latest copyright year
...
@@ -480,14 +480,18 @@ \section{Working with Code (Babel)}
...
@@ -480,14 +480,18 @@ \section{Working with Code (Babel)}
\key
{
view expanded body of code block at point
}{
C-c C-v v
}
\key
{
view expanded body of code block at point
}{
C-c C-v v
}
\key
{
go to named code block
}{
C-c C-v g
}
\key
{
go to named code block
}{
C-c C-v g
}
\key
{
go to named result
}{
C-c C-v r
}
\key
{
go to named result
}{
C-c C-v r
}
\key
{
go to the head of the current code block
}{
C-c C-v u
}
\key
{
go to the next code block
}{
C-c C-v n
}
\key
{
go to the next code block
}{
C-c C-v n
}
\key
{
go to the previous code block
}{
C-c C-v p
}
\key
{
go to the previous code block
}{
C-c C-v p
}
\key
{
demarcate a code block
}{
C-c C-v d
}
\key
{
execute the next key sequence in the code edit buffer
}{
C-c C-v x
}
\key
{
execute all code blocks in current buffer
}{
C-c C-v b
}
\key
{
execute all code blocks in current buffer
}{
C-c C-v b
}
\key
{
execute all code blocks in current subtree
}{
C-c C-v s
}
\key
{
execute all code blocks in current subtree
}{
C-c C-v s
}
\key
{
tangle code blocks in current file
}{
C-c C-v t
}
\key
{
tangle code blocks in current file
}{
C-c C-v t
}
\key
{
tangle code blocks in supplied file
}{
C-c C-v f
}
\key
{
tangle code blocks in supplied file
}{
C-c C-v f
}
\key
{
ingest all code blocks in supplied file into the Library of Babel
}{
C-c C-v
l
}
\key
{
ingest all code blocks in supplied file into the Library of Babel
}{
C-c C-v
i
}
\key
{
switch to the session of the current code block
}{
C-c C-v z
}
\key
{
switch to the session of the current code block
}{
C-c C-v z
}
\key
{
load expanded body of the current code block into a session
}{
C-c C-v l
}
\key
{
view sha1 hash of the current code block
}{
C-c C-v a
}
\key
{
view sha1 hash of the current code block
}{
C-c C-v a
}
% \section{Remember-mode Integration}
% \section{Remember-mode Integration}
...
...
lisp/org/ChangeLog
View file @
afe98dfa
This diff is collapsed.
Click to expand it.
lisp/org/ob-C.el
View file @
afe98dfa
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
;; Author: Eric Schulte
;; Author: Eric Schulte
;; Keywords: literate programming, reproducible research
;; Keywords: literate programming, reproducible research
;; Homepage: http://orgmode.org
;; Homepage: http://orgmode.org
;; Version: 7.
01
;; Version: 7.
3
;; This file is part of GNU Emacs.
;; This file is part of GNU Emacs.
...
@@ -33,7 +33,6 @@
...
@@ -33,7 +33,6 @@
;;; Code:
;;; Code:
(
require
'ob
)
(
require
'ob
)
(
require
'ob-eval
)
(
require
'ob-eval
)
(
require
'org
)
(
require
'cc-mode
)
(
require
'cc-mode
)
(
declare-function
org-entry-get
"org"
(
declare-function
org-entry-get
"org"
...
@@ -65,31 +64,30 @@ is currently being evaluated.")
...
@@ -65,31 +64,30 @@ is currently being evaluated.")
called by `org-babel-execute-src-block'."
called by `org-babel-execute-src-block'."
(
let
((
org-babel-c-variant
'cpp
))
(
org-babel-C-execute
body
params
)))
(
let
((
org-babel-c-variant
'cpp
))
(
org-babel-C-execute
body
params
)))
(
defun
org-babel-expand-body:c++
(
body
params
&optional
processed-params
)
(
defun
org-babel-expand-body:c++
(
body
params
)
"Expand a block of C++ code with org-babel according to it's
"Expand a block of C++ code with org-babel according to it's
header arguments (calls `org-babel-C-expand')."
header arguments (calls `org-babel-C-expand')."
(
let
((
org-babel-c-variant
'cpp
))
(
org-babel-C-expand
body
params
processed-params
)))
(
let
((
org-babel-c-variant
'cpp
))
(
org-babel-C-expand
body
params
)))
(
defun
org-babel-execute:C
(
body
params
)
(
defun
org-babel-execute:C
(
body
params
)
"Execute a block of C code with org-babel. This function is
"Execute a block of C code with org-babel. This function is
called by `org-babel-execute-src-block'."
called by `org-babel-execute-src-block'."
(
let
((
org-babel-c-variant
'c
))
(
org-babel-C-execute
body
params
)))
(
let
((
org-babel-c-variant
'c
))
(
org-babel-C-execute
body
params
)))
(
defun
org-babel-expand-body:c
(
body
params
&optional
processed-params
)
(
defun
org-babel-expand-body:c
(
body
params
)
"Expand a block of C code with org-babel according to it's
"Expand a block of C code with org-babel according to it's
header arguments (calls `org-babel-C-expand')."
header arguments (calls `org-babel-C-expand')."
(
let
((
org-babel-c-variant
'c
))
(
org-babel-C-expand
body
params
processed-params
)))
(
let
((
org-babel-c-variant
'c
))
(
org-babel-C-expand
body
params
)))
(
defun
org-babel-C-execute
(
body
params
)
(
defun
org-babel-C-execute
(
body
params
)
"This function should only be called by `org-babel-execute:C'
"This function should only be called by `org-babel-execute:C'
or `org-babel-execute:c++'."
or `org-babel-execute:c++'."
(
let*
((
processed-params
(
org-babel-process-params
params
))
(
let*
((
tmp-src-file
(
org-babel-temp-file
(
tmp-src-file
(
make-temp-file
"org-babel-C-src"
nil
"C-src-"
(
cond
(
cond
((
equal
org-babel-c-variant
'c
)
".c"
)
((
equal
org-babel-c-variant
'c
)
".c"
)
((
equal
org-babel-c-variant
'cpp
)
".cpp"
))))
((
equal
org-babel-c-variant
'cpp
)
".cpp"
))))
(
tmp-bin-file
(
make-temp-file
"org-babel-C-bin"
))
(
tmp-bin-file
(
org-babel-temp-file
"C-bin-"
))
(
tmp-out-file
(
make-temp-file
"org-babel-C-out"
))
(
cmdline
(
cdr
(
assoc
:cmdline
params
)))
(
cmdline
(
cdr
(
assoc
:cmdline
params
)))
(
flags
(
cdr
(
assoc
:flags
params
)))
(
flags
(
cdr
(
assoc
:flags
params
)))
(
full-body
(
org-babel-C-expand
body
params
))
(
full-body
(
org-babel-C-expand
body
params
))
...
@@ -101,37 +99,35 @@ or `org-babel-execute:c++'."
...
@@ -101,37 +99,35 @@ or `org-babel-execute:c++'."
(
cond
(
cond
((
equal
org-babel-c-variant
'c
)
org-babel-C-compiler
)
((
equal
org-babel-c-variant
'c
)
org-babel-C-compiler
)
((
equal
org-babel-c-variant
'cpp
)
org-babel-c++-compiler
))
((
equal
org-babel-c-variant
'cpp
)
org-babel-c++-compiler
))
tmp-bin-file
(
org-babel-process-file-name
tmp-bin-file
)
(
mapconcat
'identity
(
mapconcat
'identity
(
if
(
listp
flags
)
flags
(
list
flags
))
" "
)
(
if
(
listp
flags
)
flags
(
list
flags
))
" "
)
tmp-src-file
)
""
))))
(
org-babel-process-file-name
tmp-src-file
)
)
""
))))
((
lambda
(
results
)
((
lambda
(
results
)
(
org-babel-reassemble-table
(
org-babel-reassemble-table
(
if
(
member
"vector"
(
nth
2
processed-
params
))
(
if
(
member
"vector"
(
cdr
(
assoc
:result-params
params
))
)
(
let
((
tmp-file
(
make
-temp-file
"
ob-
c"
)))
(
let
((
tmp-file
(
org-babel
-temp-file
"c
-
"
)))
(
with-temp-file
tmp-file
(
insert
results
))
(
with-temp-file
tmp-file
(
insert
results
))
(
org-babel-import-elisp-from-file
tmp-file
))
(
org-babel-import-elisp-from-file
tmp-file
))
(
org-babel-read
results
))
(
org-babel-read
results
))
(
org-babel-pick-name
(
org-babel-pick-name
(
nth
4
processed-
params
)
(
cdr
(
assoc
:colnames
params
)))
(
cdr
(
assoc
:colname-names
params
)
)
(
cdr
(
assoc
:colnames
params
)))
(
org-babel-pick-name
(
org-babel-pick-name
(
nth
5
processed-
params
)
(
cdr
(
assoc
:rownames
params
)))))
(
cdr
(
assoc
:rowname-names
params
)
)
(
cdr
(
assoc
:rownames
params
)))))
(
org-babel-trim
(
org-babel-trim
(
org-babel-eval
(
org-babel-eval
(
concat
tmp-bin-file
(
if
cmdline
(
concat
" "
cmdline
)
""
))
""
)))))
(
concat
tmp-bin-file
(
if
cmdline
(
concat
" "
cmdline
)
""
))
""
)))))
(
defun
org-babel-C-expand
(
body
params
&optional
processed-params
)
(
defun
org-babel-C-expand
(
body
params
)
"Expand a block of C or C++ code with org-babel according to
"Expand a block of C or C++ code with org-babel according to
it's header arguments."
it's header arguments."
(
let
((
vars
(
nth
1
(
or
processed-params
(
let
((
vars
(
mapcar
#'
cdr
(
org-babel-get-header
params
:var
)))
(
org-babel-process-params
params
))))
(
main-p
(
not
(
string=
(
cdr
(
assoc
:main
params
))
"no"
)))
(
main-p
(
not
(
string=
(
cdr
(
assoc
:main
params
))
"no"
)))
(
includes
(
or
(
cdr
(
assoc
:includes
params
))
(
includes
(
or
(
cdr
(
assoc
:includes
params
))
(
org-babel-read
(
org-entry-get
nil
"includes"
t
))))
(
org-babel-read
(
org-entry-get
nil
"includes"
t
))))
(
defines
(
org-babel-read
(
defines
(
org-babel-read
(
or
(
cdr
(
assoc
:defines
params
))
(
or
(
cdr
(
assoc
:defines
params
))
(
org-babel-read
(
org-entry-get
nil
"defines"
t
))))))
(
org-babel-read
(
org-entry-get
nil
"defines"
t
))))))
(
org-babel-trim
(
mapconcat
'identity
(
mapconcat
'identity
(
list
(
list
;; includes
;; includes
...
@@ -147,11 +143,11 @@ it's header arguments."
...
@@ -147,11 +143,11 @@ it's header arguments."
;; body
;; body
(
if
main-p
(
if
main-p
(
org-babel-C-ensure-main-wrap
body
)
(
org-babel-C-ensure-main-wrap
body
)
body
)
"\n"
)
"\n"
)))
)
body
)
"\n"
)
"\n"
)))
(
defun
org-babel-C-ensure-main-wrap
(
body
)
(
defun
org-babel-C-ensure-main-wrap
(
body
)
"Wrap body in a \"main\" function call if none exists."
"Wrap body in a \"main\" function call if none exists."
(
if
(
string-match
"^[ \t]*[intvod]+[ \t]*main[ \t]*(.*)"
body
)
(
if
(
string-match
"^[ \t]*[intvod]+[ \t
\n\r
]*main[ \t]*(.*)"
body
)
body
body
(
format
"int main() {\n%s\n}\n"
body
)))
(
format
"int main() {\n%s\n}\n"
body
)))
...
...
lisp/org/ob-R.el
View file @
afe98dfa
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
;; Author: Eric Schulte, Dan Davison
;; Author: Eric Schulte, Dan Davison
;; Keywords: literate programming, reproducible research, R, statistics
;; Keywords: literate programming, reproducible research, R, statistics
;; Homepage: http://orgmode.org
;; Homepage: http://orgmode.org
;; Version: 7.
01
;; Version: 7.
3
;; This file is part of GNU Emacs.
;; This file is part of GNU Emacs.
...
@@ -36,6 +36,9 @@
...
@@ -36,6 +36,9 @@
(
declare-function
orgtbl-to-tsv
"org-table"
(
table
params
))
(
declare-function
orgtbl-to-tsv
"org-table"
(
table
params
))
(
declare-function
R
"ext:essd-r"
(
&optional
start-args
))
(
declare-function
R
"ext:essd-r"
(
&optional
start-args
))
(
declare-function
inferior-ess-send-input
"ext:ess-inf"
())
(
declare-function
inferior-ess-send-input
"ext:ess-inf"
())
(
declare-function
ess-make-buffer-current
"ext:ess-inf"
())
(
declare-function
ess-eval-buffer
"ext:ess-inf"
(
vis
))
(
declare-function
org-number-sequence
"org-compat"
(
from
&optional
to
inc
))
(
defconst
org-babel-header-arg-names:R
(
defconst
org-babel-header-arg-names:R
'
(
width
height
bg
units
pointsize
antialias
quality
compression
'
(
width
height
bg
units
pointsize
antialias
quality
compression
...
@@ -48,21 +51,11 @@
...
@@ -48,21 +51,11 @@
(
defvar
org-babel-R-command
"R --slave --no-save"
(
defvar
org-babel-R-command
"R --slave --no-save"
"Name of command to use for executing R code."
)
"Name of command to use for executing R code."
)
(
defun
org-babel-expand-body:R
(
body
params
&optional
processed-params
)
(
defun
org-babel-expand-body:R
(
body
params
)
"Expand BODY according to PARAMS, return the expanded body."
"Expand BODY according to PARAMS, return the expanded body."
(
let*
((
processed-params
(
or
processed-params
(
let
((
out-file
(
cdr
(
assoc
:file
params
))))
(
org-babel-process-params
params
)))
(
mapconcat
(
vars
(
mapcar
#'
identity
(
lambda
(
i
)
(
cons
(
car
(
nth
i
(
nth
1
processed-params
)))
(
org-babel-reassemble-table
(
cdr
(
nth
i
(
nth
1
processed-params
)))
(
cdr
(
nth
i
(
nth
4
processed-params
)))
(
cdr
(
nth
i
(
nth
5
processed-params
))))))
(
number-sequence
0
(
1-
(
length
(
nth
1
processed-params
))))))
(
out-file
(
cdr
(
assoc
:file
params
))))
(
mapconcat
;; define any variables
#'
org-babel-trim
((
lambda
(
inside
)
((
lambda
(
inside
)
(
if
out-file
(
if
out-file
(
append
(
append
...
@@ -70,49 +63,36 @@
...
@@ -70,49 +63,36 @@
inside
inside
(
list
"dev.off()"
))
(
list
"dev.off()"
))
inside
))
inside
))
(
append
(
append
(
org-babel-variable-assignments:R
params
)
(
mapcar
(
list
body
)))
"\n"
)))
(
lambda
(
pair
)
(
org-babel-R-assign-elisp
(
car
pair
)
(
cdr
pair
)
(
equal
"yes"
(
cdr
(
assoc
:colnames
params
)))
(
equal
"yes"
(
cdr
(
assoc
:rownames
params
)))))
vars
)
(
list
body
)))
"\n"
)))
(
defun
org-babel-execute:R
(
body
params
)
(
defun
org-babel-execute:R
(
body
params
)
"Execute a block of R code.
"Execute a block of R code.
This function is called by `org-babel-execute-src-block'."
This function is called by `org-babel-execute-src-block'."
(
save-excursion
(
save-excursion
(
let*
((
processed-params
(
org-babel-process-params
params
))
(
let*
((
result-type
(
cdr
(
assoc
:result-type
params
)))
(
result-type
(
nth
3
processed-params
))
(
session
(
org-babel-R-initiate-session
(
session
(
org-babel-R-initiate-session
(
first
processed-
params
)
params
))
(
cdr
(
assoc
:session
params
)
)
params
))
(
colnames-p
(
cdr
(
assoc
:colnames
params
)))
(
colnames-p
(
cdr
(
assoc
:colnames
params
)))
(
rownames-p
(
cdr
(
assoc
:rownames
params
)))
(
rownames-p
(
cdr
(
assoc
:rownames
params
)))
(
out-file
(
cdr
(
assoc
:file
params
)))
(
out-file
(
cdr
(
assoc
:file
params
)))
(
full-body
(
org-babel-expand-body:R
body
params
processed-params
))
(
full-body
(
org-babel-expand-body:R
body
params
))
(
result
(
result
(
org-babel-R-evaluate
(
org-babel-R-evaluate
session
full-body
result-type
session
full-body
result-type
(
or
(
equal
"yes"
colnames-p
)
(
or
(
equal
"yes"
colnames-p
)
(
org-babel-pick-name
(
nth
4
processed-params
)
colnames-p
))
(
org-babel-pick-name
(
cdr
(
assoc
:colname-names
params
))
colnames-p
))
(
or
(
equal
"yes"
rownames-p
)
(
or
(
equal
"yes"
rownames-p
)
(
org-babel-pick-name
(
nth
5
processed-params
)
rownames-p
)))))
(
org-babel-pick-name
(
cdr
(
assoc
:rowname-names
params
))
rownames-p
)))))
(
message
"result is %S"
result
)
(
message
"result is %S"
result
)
(
or
out-file
result
))))
(
or
out-file
result
))))
(
defun
org-babel-prep-session:R
(
session
params
)
(
defun
org-babel-prep-session:R
(
session
params
)
"Prepare SESSION according to the header arguments specified in PARAMS."
"Prepare SESSION according to the header arguments specified in PARAMS."
(
let*
((
session
(
org-babel-R-initiate-session
session
params
))
(
let*
((
session
(
org-babel-R-initiate-session
session
params
))
(
vars
(
org-babel-ref-variables
params
))
(
var-lines
(
org-babel-variable-assignments:R
params
)))
(
var-lines
(
mapcar
(
lambda
(
pair
)
(
org-babel-R-assign-elisp
(
car
pair
)
(
cdr
pair
)
(
equal
(
cdr
(
assoc
:colnames
params
))
"yes"
)
(
equal
(
cdr
(
assoc
:rownames
params
))
"yes"
)))
vars
)))
(
org-babel-comint-in-buffer
session
(
org-babel-comint-in-buffer
session
(
mapc
(
lambda
(
var
)
(
mapc
(
lambda
(
var
)
(
end-of-line
1
)
(
insert
var
)
(
comint-send-input
nil
t
)
(
end-of-line
1
)
(
insert
var
)
(
comint-send-input
nil
t
)
...
@@ -130,6 +110,24 @@ This function is called by `org-babel-execute-src-block'."
...
@@ -130,6 +110,24 @@ This function is called by `org-babel-execute-src-block'."
;; helper functions
;; helper functions
(
defun
org-babel-variable-assignments:R
(
params
)
"Return list of R statements assigning the block's variables"
(
let
((
vars
(
mapcar
#'
cdr
(
org-babel-get-header
params
:var
))))
(
mapcar
(
lambda
(
pair
)
(
org-babel-R-assign-elisp
(
car
pair
)
(
cdr
pair
)
(
equal
"yes"
(
cdr
(
assoc
:colnames
params
)))
(
equal
"yes"
(
cdr
(
assoc
:rownames
params
)))))
(
mapcar
(
lambda
(
i
)
(
cons
(
car
(
nth
i
vars
))
(
org-babel-reassemble-table
(
cdr
(
nth
i
vars
))
(
cdr
(
nth
i
(
cdr
(
assoc
:colname-names
params
))))
(
cdr
(
nth
i
(
cdr
(
assoc
:rowname-names
params
)))))))
(
org-number-sequence
0
(
1-
(
length
vars
)))))))
(
defun
org-babel-R-quote-tsv-field
(
s
)
(
defun
org-babel-R-quote-tsv-field
(
s
)
"Quote field S for export to R."
"Quote field S for export to R."
(
if
(
stringp
s
)
(
if
(
stringp
s
)
...
@@ -139,23 +137,25 @@ This function is called by `org-babel-execute-src-block'."
...
@@ -139,23 +137,25 @@ This function is called by `org-babel-execute-src-block'."
(
defun
org-babel-R-assign-elisp
(
name
value
colnames-p
rownames-p
)
(
defun
org-babel-R-assign-elisp
(
name
value
colnames-p
rownames-p
)
"Construct R code assigning the elisp VALUE to a variable named NAME."
"Construct R code assigning the elisp VALUE to a variable named NAME."
(
if
(
listp
value
)
(
if
(
listp
value
)
(
let
((
transition-file
(
make
-temp-file
"
org-babel-
R-import"
)))
(
let
((
transition-file
(
org-babel
-temp-file
"R-import
-
"
)))
;; ensure VALUE has an orgtbl structure (depth of at least 2)
;; ensure VALUE has an orgtbl structure (depth of at least 2)
(
unless
(
listp
(
car
value
))
(
setq
value
(
list
value
)))
(
unless
(
listp
(
car
value
))
(
setq
value
(
list
value
)))
(
with-temp-file
(
org-babel-maybe-remote-file
transition-file
)
(
with-temp-file
transition-file
(
insert
(
orgtbl-to-tsv
value
'
(
:fmt
org-babel-R-quote-tsv-field
)))
(
insert
(
orgtbl-to-tsv
value
'
(
:fmt
org-babel-R-quote-tsv-field
)))
(
insert
"\n"
))
(
insert
"\n"
))
(
format
"%s <- read.table(\"%s\", header=%s, row.names=%s, sep=\"\\t\", as.is=TRUE)"
(
format
"%s <- read.table(\"%s\", header=%s, row.names=%s, sep=\"\\t\", as.is=TRUE)"
name
transition-file
name
(
org-babel-process-file-name
transition-file
'noquote
)
(
if
(
or
(
eq
(
nth
1
value
)
'hline
)
colnames-p
)
"TRUE"
"FALSE"
)
(
if
(
or
(
eq
(
nth
1
value
)
'hline
)
colnames-p
)
"TRUE"
"FALSE"
)
(
if
rownames-p
"1"
"NULL"
)))
(
if
rownames-p
"1"
"NULL"
)))
(
format
"%s <- %s"
name
(
org-babel-R-quote-tsv-field
value
))))
(
format
"%s <- %s"
name
(
org-babel-R-quote-tsv-field
value
))))
(
defvar
ess-ask-for-ess-directory
nil
)
(
defun
org-babel-R-initiate-session
(
session
params
)
(
defun
org-babel-R-initiate-session
(
session
params
)
"If there is not a current R process then create one."
"If there is not a current R process then create one."
(
unless
(
string=
session
"none"
)
(
unless
(
string=
session
"none"
)
(
let
((
session
(
or
session
"*R*"
))
(
let
((
session
(
or
session
"*R*"
))
(
ess-ask-for-ess-directory
(
not
(
cdr
(
assoc
:dir
params
)))))
(
ess-ask-for-ess-directory
(
and
ess-ask-for-ess-directory
(
not
(
cdr
(
assoc
:dir
params
))))))
(
if
(
org-babel-comint-buffer-livep
session
)
(
if
(
org-babel-comint-buffer-livep
session
)
session
session
(
save-window-excursion
(
save-window-excursion
...
@@ -168,6 +168,15 @@ This function is called by `org-babel-execute-src-block'."
...
@@ -168,6 +168,15 @@ This function is called by `org-babel-execute-src-block'."
(
buffer-name
))))
(
buffer-name
))))
(
current-buffer
))))))
(
current-buffer
))))))
(
defvar
ess-local-process-name
nil
)
(
defun
org-babel-R-associate-session
(
session
)
"Associate R code buffer with an R session.
Make SESSION be the inferior ESS process associated with the
current code buffer."
(
setq
ess-local-process-name
(
process-name
(
get-buffer-process
session
)))
(
ess-make-buffer-current
))
(
defun
org-babel-R-construct-graphics-device-call
(
out-file
params
)
(
defun
org-babel-R-construct-graphics-device-call
(
out-file
params
)
"Construct the call to the graphics device."
"Construct the call to the graphics device."
(
let