Commit afe98dfa authored by Carsten Dominik's avatar Carsten Dominik

Install org-mode version 7.3

parent df26e1f5
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.
......
This diff is collapsed.
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
......
% 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}
......
This diff is collapsed.
...@@ -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)))
......
...@@ -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