* lisp/ob-core.el (org-babel-check-evaluate)
(org-babel-confirm-evaluate):
* lisp/ob-fortran.el (org-babel-fortran-var-to-fortran):
* lisp/ox-latex.el (org-latex-compile):
* lisp/ox-man.el (org-man-compile):
* lisp/ox-odt.el (org-odt-template):
* lisp/ox-texinfo.el (org-texinfo-compile):
Change (message (format ...)) to (message ...), and likewise
for ‘error’. This lessens the probability of confusion when the
output of ‘format’ contains ‘%’.
Fix some confusion with ‘format’
0c856a2c459016f1f9cce173f5b2b49be36e3452
Paul Eggert
Wed Aug 5 19:07:28 2015 -0700
* ob-core (org-babel-result-cond): Add "file" as a param that returns
a scalar result.
When writing the result to file we do not need to first convert the
data to a table since it is just converted back when
org-babel-execute-src-block serializes the result to file.
Fix a problem where a source block would return nil oif the result was
cached and it was indented.
* lisp/ob-core.el (org-babel-execute-src-block): Move point to the the
first character of the result instead of the beginning of the line.
* testing/lisp/test-ob.el
(test-org-babel/indented-cached-org-bracket-link): Added test to
to see if the indented cached result returns what it should return.
* lisp/ob-core.el (org-babel-insert-result): Improper lists are
removeable.
When a list cannot be turned into a table, return it in a fixed-width
area so that it can be removed.
Suggested-by: Charles C. Berry <ccberry@ucsd.edu>
<http://permalink.gmane.org/gmane.emacs.orgmode/95430>
* lisp/ob-core.el (org-babel-insert-result): Fix output when result is
an improper list, which cannot be turned into a table.
* testing/lisp/test-ob.el (test-ob/org-babel-insert-result--improper-lists):
New test.
Reported-by: Daniele Pizzolli <dan@toel.it>
<http://permalink.gmane.org/gmane.emacs.orgmode/95348>
* lisp/ob-core.el (org-babel-view-src-block-info): when a property
value was numeric, an error was raised. Fixed by converting property
value to string before evauation.
* lisp/ob-core.el (org-babel-view-src-block-info): Add property string
"header args" to output of org-babel-view-src-block-info to make
debugging of header-args setting problems easier.
* lisp/ob-core.el (org-babel-view-src-block-info): Add property string
for language specific "header args:LANG" to output of org-babel-view-src-block-info to make
debugging of header-args setting problems easier.
* ob.core.el (org-babel-remove-inline-result): Removing an inline src
block result removes all whitespace preceding it. The function is
now `interactive'.
* ob-core.el (org-babel-insert-result): The call to
`org-babel-remove-inline-result' preceeds insertion of whitespace
and setting location of local variable `inlinep'.
Daniele Pizzolli reported that cleaning a buffer by evaluating
`org-babel-remove-inline-result' can leave unwanted whitespace. That
bug is fixed, and the function is made `interactive'.
* lisp/ob-core.el (org-babel-remove-inline-result): Delete results of
current inline src block or inline babel call if it is wrapped in a
"{{{results(.*)}}}" macro call.
* lisp/ob-core.el (org-babel-get-lob-one-liner-matches): Ensure that
the point ends up on the same line as, and just before, `call_'
before setting match-data.
* ob-core.el (org-babel-get-inline-src-block-matches): Use
`org-element-context' and friends to find inline-src-block. When
point is in an inline-src-block (including white space determined by
:post-blank) set match-data and return `t'.
* lisp/ob-core.el (org-babel-insert-result): Delete any `results'
macro following current inline src block or babel call; insert
current value in 'results' macro possibly wrapping RESULT in an
export snippet or inline source block first. Use of `:results list'
or `:results table', or use of a multiline RESULT (after stripping a
trailing newline) or a list RESULT from an inline src block or babel
call throws an error.
* lisp/ob-core.el (org-babel--script-escape-inner): New function.
(org-babel-script-escape): Use it.
* testing/lisp/test-ob.el (test-org-babel/script-escape): New test.
* lisp/ob-core.el (org-babel-get-inline-src-block-matches): Use
`org-looking-at-p' instead of `thing-at-point'.
The latter could give odd results depending on the syntax table. In
particular, for me (thing-at-point 'word) was returning src_foo in
this context.
* lisp/ob-core.el (org-babel-where-is-src-block-head): Refactor. In
particular, do not return a marker, ever. Also update docstring.
* testing/lisp/test-ob.el (test-ob/org-babel-remove-result--results-org):
Fix tests containing invalid Org syntax.
* lisp/ob-core.el (org-babel-map-src-blocks,
org-babel-map-inline-src-blocks): Make sure to ignore case when
looking for source blocks.
Reported-by: Christopher Genovese <genovese@cmu.edu>
<http://permalink.gmane.org/gmane.emacs.orgmode/93454>
* lisp/ob-exp.el (org-babel-exp-inline-code-template): New
customizable variable to export inline source code (similar to
`org-babel-exp-code-template').
(org-babel-exp-code): New `type' argument to differentiate between
inline and standard code blocks.
* lisp/ob-core.el (org-babel-inline-src-block-regexp): Allow empty set
of switches and header arguments as in "src_sh[]{echo foo;}". Also
permit spaces before them.
* testint/lisp/test-org-element.el
(test-org-element/inline-src-block-parser): Test extended syntax for
inline source code.
* testing/lisp/test-ob-exp.el (ob-exp/exports-inline-code): New
function for testing inline source code handling. Also add three new
failing tests exhibiting unexpected results with ":results code"
switches.
* testing/lisp/test-ob.el
(test-org-babel/org-babel-get-inline-src-block-matches): Test for
inline source blocks with empty header arguments.
* testing/examples/babel.org: New sections for testing (i) exported
inline source code (used by `ob-exp/exports-inline-code'); (ii)
parsing inline source blocks with empty header arguments (used by
`test-org-babel/org-babel-get-inline-src-block-matches').
Until now pieces of inline source code were handled as standard code
blocks during export. These changes enable them to be exported.
* lisp/ob-core.el (org-babel-common-header-args-w-values): Add
:output-dir'.
Otherwise tthis property is not inherited correctly from
subtree-/file-level properties.
* lisp/ob-core.el (org-babel-noweb-error-all-langs): Raise noweb
errors regardless of language.
(org-babel-expand-noweb-references): Make use of the new
`org-babel-noweb-error-all-langs' variable.
* lisp/ob-core.el: Add comment to forward declaration of
'org-src-preserve-indentations'.
* lisp/ob-exp.el: Require org-src to import
'org-src-preserve-indentations'.
* lisp/ob-haskell.el, lisp/ob-python.el: Remove superfluous forward
declaration of 'org-src-preserve-indentations', since it gets
imported by other requires.
* ob-core.el (org-babel-insert-result): Test all list elements against
listp and (eq element 'hline) instead of checking just the first.
org-babel table output uses different formatting for a list of lists,
but detects it incorrectly causing an error. An example of a block
causing an error is an emacs lisp source block containing just 1 line:
'((1) 2)
* ob-core.el (org-babel-demarcate-block): Upcase or downcase
the inserted #+begin_src and #+end_src depending on the
current case of #+begin_src and #+end_src.
Thanks to Alexander Baier for reporting this.
* lisp/ob-core.el (org-babel-generate-file-param): New function.
(org-babel-get-src-block-info): Use it.
(org-babel-merge-params): Handle :file-ext.
(org-babel-graphical-output-file): error if no :file or :file-ext.
* testing/lisp/test-ob.el (test-org-babel/file-ext-and-output-dir):
New test.
* doc/org.texi (Specific header arguments): Add doc for :file-ext and
:output-dir header args.
* lisp/ob-R.el (org-babel-expand-body:R): Don’t calculate
graphics-file.
(org-babel-execute:R): Only look for a graphics-file if needed.
* lisp/ob-core.el (org-babel-graphical-output-file): New generic function.
* lisp/ob-R.el (org-babel-R-graphical-output-file): Delete specific version.
(org-babel-expand-body:R): Use generic version.
* lisp/ob-maxima.el (org-babel-maxima-graphical-output-file): Delete
specific version.
(org-babel-maxima-expand): Use generic version.
* lisp/ob-octave.el (org-babel-octave-graphical-output-file): Delete
specific version
(org-babel-execute:octave): Use generic version.