Commit 8223b1d2 authored by Bastien Guerry's avatar Bastien Guerry

Sync Org 7.9.2 from the commit tagged "release_7.9.2" in Org's Git repo.

parent 16322789
2012-09-30 Achim Gratz <Stromeko@Stromeko.DE>
* org.texi: Add description of ORG_ADD_CONTRIB to info
documentation. Add link to Worg for more details.
* org.texi: Clarify installation procedure. Provide link to the
build system description on Worg.
* org.texi: Remove reference to utils/, x11idle.c is now in
contrib/scripts.
* org.texi: Re-normalize to "Org mode" in manual.
* org.texi (Installation): Adapt documentation to new build
system. Mention GNU ELPA (since it needs to be handled like Emacs
built-in Org).
* org.texi: Include "org-version.inc" instead of
"git-describe.texi".
* org.texi: Remove @set for VERSION and DATE and do an @include
git-describe.texi instead.
2012-09-30 Adam Spiers <orgmode@adamspiers.org> (tiny change)
* org.texi: Fix typo in description of the 'Hooks' section.
* org.texi: Add ID to the list of special properties.
2012-09-30 Andrew Hyatt <ahyatt@gmail.com> (tiny change)
* org.texi (Moving subtrees): Document the ability to archive to a
datetree.
2012-09-30 Bastien Guerry <bzg@altern.org>
* org.texi (Installation, Feedback, Batch execution): Use
(add-to-list 'load-path ... t) for the contrib dir.
* org.texi (results): Update documentation for ":results drawer"
and ":results org".
* org.texi (Column width and alignment): Fix typo.
* org.texi (Activation): Point to the "Conflicts" section.
* org.texi (Conflicts): Mention filladapt.el in the list of
conflicting packages.
* org.texi (Activation): Adding org-mode to `auto-mode-alist' is
not needed for versions of Emacs > 22.1.
* org.texi (History and Acknowledgments): Fix typo.
* org.texi (History and Acknowledgments): Add my own
acknowledgments.
* org.texi (Agenda commands): Document the new command and the new
option.
* org.texi (Agenda commands): Delete `org-agenda-action' section.
(Agenda commands): Reorder. Document `*' to toggle persistent
marks.
* org.texi (Agenda dispatcher): Mention
`org-toggle-agenda-sticky'.
(Agenda commands, Exporting Agenda Views): Fix typo.
* org.texi (Templates in contexts, Setting Options): Update to
reflect changes in how contexts options are processed.
* org.texi (Templates in contexts): Document the new structure of
the variables `org-agenda-custom-commands-contexts' and
`org-capture-templates-contexts'.
* org.texi (Templates in contexts): Document the new option
`org-capture-templates-contexts'.
(Storing searches): Document the new option
`org-agenda-custom-commands-contexts'.
* org.texi (Formula syntax for Lisp): Reformat.
* org.texi (Special properties, Column attributes)
(Agenda column view): Document the new special property
CLOCKSUM_T.
* org.texi (Template expansion): Document the new %l template.
* org.texi (Fast access to TODO states): Fix documentation about
allowed characters for fast todo selection.
* org.texi (Weekly/daily agenda): Mention APPT_WARNTIME and its
use in `org-agenda-to-appt'.
* org.texi (Comment lines): Update wrt comments.
* org.texi (Resolving idle time): Document new keybinding.
* org.texi (Clocking commands): Document the use of S-M-<up/down>
on clock timestamps.
* org.texi (Fast access to TODO states): Explicitely says only
letters are supported as fast TODO selection keys.
* org.texi (Link abbreviations): Illustrate the use of the "%h"
specifier. Document the new "%(my-function)" specifier.
* org.texi (Clocking commands): New cindex.
(Clocking commands): Update documentation for `org-clock-in'.
Document `org-clock-in-last'. Mention `org-clock-out' and
`org-clock-in-last' as commands that can be globally bound.
(Resolving idle time): Document continuous clocking.
* org.texi (Top, Introduction): Fix formatting.
(Activation): Add index entries.
(Conventions): Update section.
(Embedded @LaTeX{}): Fix formatting.
* org.texi (Visibility cycling): Document `show-children'.
* org.texi (Using capture): Mention the `org-capture-last-stored'
bookmark as a way to jump to the last stored capture.
* org.texi (Uploading files): Fix typo.
* org.texi (Using capture): Document `C-0' as a prefix argument
for `org-capture'.
* org.texi (Agenda commands): Document persistent marks.
* org.texi (Template expansion): Update doc to reflect change.
* org.texi (Radio tables): Document the :no-escape parameter.
* org.texi (Repeated tasks): Document repeat cookies for years,
months, weeks, days and hours.
* org.texi (Export options): State that you can use the d: option
by specifying a list of drawers.
* org.texi (HTML preamble and postamble): Small doc improvement.
2012-09-30 Brian van den Broek <vanden@gmail.com> (tiny change)
* org.texi: The sections in the Exporting section of the manual
left out articles in the description of the org-export-as-*
commands, among other places. This patch adds them, adds a few
missing prepositions, and switches instances of "an HTML" to "a
html" for internal consistency.
* org.texi: Alter several examples of headings with timestamps in
them to include the timestamps in the body instead of the heading.
2012-09-30 Carsten Dominik <carsten.dominik@gmail.com>
* org.texi (Agenda dispatcher): Document sticky agenda views and
the new key for them.
2012-09-30 Charles <millarc@verizon.net> (tiny change)
* org.texi (Advanced features): Fix error in table.
2012-09-30 Feng Shu <tumashu@gmail.com>
* org.texi (@LaTeX{} fragments): Document imagemagick as an
alternative to dvipng.
2012-09-30 François Allisson <francois@allisson.co> (tiny change)
* org.texi: Remove extra curly bracket.
2012-09-30 Giovanni Ridolfi <giovanni.ridolfi@yahoo.it> (tiny change)
* org.texi (org-clock-in-last and org-clock-cancel): Update the
defkeys.
2012-09-30 Ippei FURUHASHI <top.tuna+orgmode@gmail.com> (tiny change)
* org.texi (Agenda commands): Fix two typos by giving
corresponding function names, according to
`org-agenda-view-mode-dispatch'.
2012-09-30 Jan Bäcker <jan.boecker@jboecker.de>
* org.texi (The spreadsheet): Fix typo.
2012-09-30 Memnon Anon <gegendosenfleisch@gmail.com> (tiny change)
* org.texi (Tracking your habits): Point to the "Tracking TODO
state changes" section.
2012-09-30 Nicolas Goaziou <n.goaziou@gmail.com>
* org.texi (Literal examples): Remove reference to unknown
`org-export-latex-minted' variable. Also simplify footnote since
`org-export-latex-listings' documentation is exhaustive already.
* org.texi (Plain lists): Remove reference to now hard-coded
`bullet' automatic rule.
2012-09-30 Toby S. Cubitt <tsc25@cantab.net>
* org.texi: Updated documentation accordingly.
2012-09-13 Paul Eggert <eggert@cs.ucla.edu> 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
* texinfo.tex: Merge from gnulib. * texinfo.tex: Merge from gnulib.
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
...@@ -256,6 +256,7 @@ ...@@ -256,6 +256,7 @@
<text:sequence-decl text:display-outline-level="0" text:name="Drawing"/> <text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
<text:sequence-decl text:display-outline-level="0" text:name="Equation"/> <text:sequence-decl text:display-outline-level="0" text:name="Equation"/>
<text:sequence-decl text:display-outline-level="0" text:name="Figure"/> <text:sequence-decl text:display-outline-level="0" text:name="Figure"/>
<text:sequence-decl text:display-outline-level="0" text:name="Listing"/>
</text:sequence-decls> </text:sequence-decls>
</office:text> </office:text>
</office:body> </office:body>
......
...@@ -319,6 +319,11 @@ ...@@ -319,6 +319,11 @@
<style:style style:name="Table" style:family="paragraph" style:parent-style-name="Caption" style:class="extra"> <style:style style:name="Table" style:family="paragraph" style:parent-style-name="Caption" style:class="extra">
<style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/> <style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/>
</style:style> </style:style>
<style:style style:name="Listing" style:family="paragraph" style:parent-style-name="Caption" style:class="extra">
<style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false" fo:keep-with-next="always">
<style:tab-stops/>
</style:paragraph-properties>
</style:style>
<style:style style:name="Horizontal_20_Line" style:display-name="Horizontal Line" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Text_20_body" style:class="html"> <style:style style:name="Horizontal_20_Line" style:display-name="Horizontal Line" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Text_20_body" style:class="html">
<style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0.499cm" style:border-line-width-bottom="0.002cm 0.035cm 0.002cm" fo:padding="0cm" fo:border-left="none" fo:border-right="none" fo:border-top="none" fo:border-bottom="0.039cm double #808080" text:number-lines="false" text:line-number="0" style:join-border="false"/> <style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0.499cm" style:border-line-width-bottom="0.002cm 0.035cm 0.002cm" fo:padding="0cm" fo:border-left="none" fo:border-right="none" fo:border-top="none" fo:border-bottom="0.039cm double #808080" text:number-lines="false" text:line-number="0" style:join-border="false"/>
<style:text-properties fo:font-size="6pt" style:font-size-asian="6pt" style:font-size-complex="6pt"/> <style:text-properties fo:font-size="6pt" style:font-size-asian="6pt" style:font-size-complex="6pt"/>
......
This diff was suppressed by a .gitattributes entry.
% Reference Card for Org Mode % Reference Card for Org Mode
\def\orgversionnumber{7.8.11} \def\orgversionnumber{7.9}
\def\versionyear{2012} % latest update \def\versionyear{2012} % latest update
\input emacsver.tex \input emacsver.tex
......
This diff is collapsed.
...@@ -61,7 +61,7 @@ is currently being evaluated.") ...@@ -61,7 +61,7 @@ is currently being evaluated.")
(org-babel-execute:C++ body params)) (org-babel-execute:C++ 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 'cpp)) (org-babel-C-execute body params))) (let ((org-babel-c-variant 'cpp)) (org-babel-C-execute body params)))
...@@ -88,9 +88,7 @@ or `org-babel-execute:C++'." ...@@ -88,9 +88,7 @@ or `org-babel-execute:C++'."
(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 (org-babel-temp-file (tmp-bin-file (org-babel-temp-file "C-bin-" org-babel-exeext))
"C-bin-"
(if (equal system-type 'windows-nt) ".exe" "")))
(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))
...@@ -118,8 +116,8 @@ or `org-babel-execute:C++'." ...@@ -118,8 +116,8 @@ or `org-babel-execute:C++'."
(org-babel-pick-name (org-babel-pick-name
(cdr (assoc :rowname-names 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) (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
...@@ -131,22 +129,22 @@ it's header arguments." ...@@ -131,22 +129,22 @@ it's header arguments."
(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))))))
(mapconcat 'identity (mapconcat 'identity
(list (list
;; includes ;; includes
(mapconcat (mapconcat
(lambda (inc) (format "#include %s" inc)) (lambda (inc) (format "#include %s" inc))
(if (listp includes) includes (list includes)) "\n") (if (listp includes) includes (list includes)) "\n")
;; defines ;; defines
(mapconcat (mapconcat
(lambda (inc) (format "#define %s" inc)) (lambda (inc) (format "#define %s" inc))
(if (listp defines) defines (list defines)) "\n") (if (listp defines) defines (list defines)) "\n")
;; variables ;; variables
(mapconcat 'org-babel-C-var-to-C vars "\n") (mapconcat 'org-babel-C-var-to-C vars "\n")
;; 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."
......
...@@ -39,24 +39,48 @@ ...@@ -39,24 +39,48 @@
(declare-function ess-make-buffer-current "ext:ess-inf" ()) (declare-function ess-make-buffer-current "ext:ess-inf" ())
(declare-function ess-eval-buffer "ext:ess-inf" (vis)) (declare-function ess-eval-buffer "ext:ess-inf" (vis))
(declare-function org-number-sequence "org-compat" (from &optional to inc)) (declare-function org-number-sequence "org-compat" (from &optional to inc))
(declare-function org-remove-if-not "org" (predicate seq))
(defconst org-babel-header-arg-names:R
'(width height bg units pointsize antialias quality compression (defconst org-babel-header-args:R
res type family title fonts version paper encoding '((width . :any)
pagecentre colormodel useDingbats horizontal) (height . :any)
(bg . :any)
(units . :any)
(pointsize . :any)
(antialias . :any)
(quality . :any)
(compression . :any)
(res . :any)
(type . :any)
(family . :any)
(title . :any)
(fonts . :any)
(version . :any)
(paper . :any)
(encoding . :any)
(pagecentre . :any)
(colormodel . :any)
(useDingbats . :any)
(horizontal . :any)
(results . ((file list vector table scalar verbatim)
(raw org html latex code pp wrap)
(replace silent append prepend)
(output value graphics))))
"R-specific header arguments.") "R-specific header arguments.")
(defvar org-babel-default-header-args:R '()) (defvar org-babel-default-header-args:R '())
(defvar org-babel-R-command "R --slave --no-save" (defcustom 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."
:group 'org-babel
:version "24.1"
:type 'string)
(defvar ess-local-process-name) (defvar ess-local-process-name) ; dynamically scoped
(defun org-babel-edit-prep:R (info) (defun org-babel-edit-prep:R (info)
(let ((session (cdr (assoc :session (nth 2 info))))) (let ((session (cdr (assoc :session (nth 2 info)))))
(when (and session (string-match "^\\*\\(.+?\\)\\*$" session)) (when (and session (string-match "^\\*\\(.+?\\)\\*$" session))
(save-match-data (org-babel-R-initiate-session session nil)) (save-match-data (org-babel-R-initiate-session session nil)))))
(setq ess-local-process-name (match-string 1 session)))))
(defun org-babel-expand-body:R (body params &optional graphics-file) (defun org-babel-expand-body:R (body params &optional graphics-file)
"Expand BODY according to PARAMS, return the expanded body." "Expand BODY according to PARAMS, return the expanded body."
...@@ -120,7 +144,7 @@ This function is called by `org-babel-execute-src-block'." ...@@ -120,7 +144,7 @@ This function is called by `org-babel-execute-src-block'."
;; helper functions ;; helper functions
(defun org-babel-variable-assignments:R (params) (defun org-babel-variable-assignments:R (params)
"Return list of R statements assigning the block's variables" "Return list of R statements assigning the block's variables."
(let ((vars (mapcar #'cdr (org-babel-get-header params :var)))) (let ((vars (mapcar #'cdr (org-babel-get-header params :var))))
(mapcar (mapcar
(lambda (pair) (lambda (pair)
...@@ -146,25 +170,45 @@ This function is called by `org-babel-execute-src-block'." ...@@ -146,25 +170,45 @@ 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 (org-babel-temp-file "R-import-"))) (let ((max (apply #'max (mapcar #'length (org-remove-if-not
#'sequencep value))))
(min (apply #'min (mapcar #'length (org-remove-if-not
#'sequencep value))))
(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 transition-file (with-temp-file transition-file
(insert (orgtbl-to-tsv value '(:fmt org-babel-R-quote-tsv-field))) (insert
(insert "\n")) (orgtbl-to-tsv value '(:fmt org-babel-R-quote-tsv-field))
(format "%s <- read.table(\"%s\", header=%s, row.names=%s, sep=\"\\t\", as.is=TRUE)" "\n"))
name (org-babel-process-file-name transition-file 'noquote) (let ((file (org-babel-process-file-name transition-file 'noquote))
(if (or (eq (nth 1 value) 'hline) colnames-p) "TRUE" "FALSE") (header (if (or (eq (nth 1 value) 'hline) colnames-p)
(if rownames-p "1" "NULL"))) "TRUE" "FALSE"))
(row-names (if rownames-p "1" "NULL")))
(if (= max min)
(format "%s <- read.table(\"%s\",
header=%s,
row.names=%s,
sep=\"\\t\",
as.is=TRUE)" name file header row-names)
(format "%s <- read.table(\"%s\",
header=%s,
row.names=%s,
sep=\"\\t\",
as.is=TRUE,
fill=TRUE,
col.names = paste(\"V\", seq_len(%d), sep =\"\"))"
name file header row-names max))))
(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) (defvar ess-ask-for-ess-directory) ; dynamically scoped
(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 (ess-ask-for-ess-directory
(and ess-ask-for-ess-directory (not (cdr (assoc :dir params)))))) (and (and (boundp 'ess-ask-for-ess-directory) 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
...@@ -177,7 +221,6 @@ This function is called by `org-babel-execute-src-block'." ...@@ -177,7 +221,6 @@ 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) (defun org-babel-R-associate-session (session)
"Associate R code buffer with an R session. "Associate R code buffer with an R session.
Make SESSION be the inferior ESS process associated with the Make SESSION be the inferior ESS process associated with the
...@@ -219,7 +262,7 @@ current code buffer." ...@@ -219,7 +262,7 @@ current code buffer."
(setq args (mapconcat (setq args (mapconcat
(lambda (pair) (lambda (pair)
(if (member (car pair) allowed-args) (if (member (car pair) allowed-args)
(format ",%s=%s" (format ",%s=%S"
(substring (symbol-name (car pair)) 1) (substring (symbol-name (car pair)) 1)
(cdr pair)) "")) (cdr pair)) ""))
params "")) params ""))
...@@ -245,7 +288,7 @@ current code buffer." ...@@ -245,7 +288,7 @@ current code buffer."
(body result-type result-params column-names-p row-names-p) (body result-type result-params column-names-p row-names-p)
"Evaluate BODY in external R process. "Evaluate BODY in external R process.
If RESULT-TYPE equals 'output then return standard output as a If RESULT-TYPE equals 'output then return standard output as a
string. If RESULT-TYPE equals 'value then return the value of the string. If RESULT-TYPE equals 'value then return the value of the
last statement in BODY, as elisp." last statement in BODY, as elisp."
(case result-type (case result-type
(value (value
...@@ -272,7 +315,7 @@ last statement in BODY, as elisp." ...@@ -272,7 +315,7 @@ last statement in BODY, as elisp."
(session body result-type result-params column-names-p row-names-p) (session body result-type result-params column-names-p row-names-p)
"Evaluate BODY in SESSION. "Evaluate BODY in SESSION.
If RESULT-TYPE equals 'output then return standard output as a If RESULT-TYPE equals 'output then return standard output as a
string. If RESULT-TYPE equals 'value then return the value of the string. If RESULT-TYPE equals 'value then return the value of the
last statement in BODY, as elisp." last statement in BODY, as elisp."
(case result-type (case result-type
(value (value
......
...@@ -88,7 +88,7 @@ Asymptote does not support sessions" ...@@ -88,7 +88,7 @@ Asymptote does not support sessions"
(error "Asymptote does not support sessions")) (error "Asymptote does not support sessions"))
(defun org-babel-variable-assignments:asymptote (params) (defun org-babel-variable-assignments:asymptote (params)
"Return list of asymptote statements assigning the block's variables" "Return list of asymptote statements assigning the block's variables."
(mapcar #'org-babel-asymptote-var-to-asymptote (mapcar #'org-babel-asymptote-var-to-asymptote
(mapcar #'cdr (org-babel-get-header params :var)))) (mapcar #'cdr (org-babel-get-header params :var))))
...@@ -128,7 +128,7 @@ a variable of the same value." ...@@ -128,7 +128,7 @@ a variable of the same value."
DATA is a list. Return type as a symbol. DATA is a list. Return type as a symbol.
The type is `string' if any element in DATA is The type is `string' if any element in DATA is
a string. Otherwise, it is either `real', if some elements are a string. Otherwise, it is either `real', if some elements are
floats, or `int'." floats, or `int'."
(let* ((type 'int) (let* ((type 'int)
find-type ; for byte-compiler find-type ; for byte-compiler
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
;;; Code: ;;; Code:
(require 'ob) (require 'ob)
(require 'ob-eval) (require 'ob-eval)
(require 'org-compat)
(eval-when-compile (require 'cl)) (eval-when-compile (require 'cl))
(declare-function org-babel-ref-resolve "ob-ref" (ref)) (declare-function org-babel-ref-resolve "ob-ref" (ref))
...@@ -96,13 +97,13 @@ called by `org-babel-execute-src-block'" ...@@ -96,13 +97,13 @@ called by `org-babel-execute-src-block'"
(defun org-babel-awk-var-to-awk (var &optional sep) (defun org-babel-awk-var-to-awk (var &optional sep)
"Return a printed value of VAR suitable for parsing with awk." "Return a printed value of VAR suitable for parsing with awk."
(flet ((echo-var (v) (if (stringp v) v (format "%S" v)))) (let ((echo-var (lambda (v) (if (stringp v) v (format "%S" v)))))
(cond (cond
((and (listp var) (listp (car var))) ((and (listp var) (listp (car var)))
(orgtbl-to-generic var (list :sep (or sep "\t") :fmt #'echo-var))) (orgtbl-to-generic var (list :sep (or sep "\t") :fmt echo-var)))
((listp var) ((listp var)
(mapconcat #'echo-var var "\n")) (mapconcat echo-var var "\n"))
(t (echo-var var))))) (t (funcall echo-var var)))))
(defun org-babel-awk-table-or-string (results) (defun org-babel-awk-table-or-string (results)
"If the results look like a table, then convert them into an "If the results look like a table, then convert them into an
......
...@@ -71,16 +71,16 @@ ...@@ -71,16 +71,16 @@
(cond (cond
((numberp res) res) ((numberp res) res)
((math-read-number res) (math-read-number res)) ((math-read-number res) (math-read-number res))