Protect apostrophes not covered by the last backport. Convert
expressions like '(...) to \\='(...) and symbols written as 'name to
`name'. (In addition to ensuring the correct display, the latter also
improves consistency with many Org docstrings.)
If these aren't protected, Emacs 25 may display them as curved quotes in
the help buffer, depending on the value of text-quoting-style.
These changes are the combination of the commits below (in order
applied). Unlike other backports, these are applied in one commit
because they are closely related and because some of the later commits
reverse changes in earlier commits. Changes to message and help quote
display for Emacs 25 seem to be here to stay. The quote protections are
required to ensure grave accents and apostrophes are displayed as
intended in Emacs 25, and they should not affect earlier versions.
Quoting fixes in lisp/org
6cd2629bd1b3ce77d29ac28e29237c94a4197116
Paul Eggert
Mon Aug 31 00:29:40 2015 -0700
More-conservative ‘format’ quote restyling
fbb5531fa11d13854b274d28ccd329c9b6652cfc
Paul Eggert
Sun Aug 23 22:39:06 2015 -0700
Prefer directed to neutral quotes
875a5d0ead827d3da32ecbd30e739a29f07bbc87
Paul Eggert
Mon Aug 24 23:57:25 2015 -0700
Escape ` and ' in doc
19532d147b431a4fe34f088d6de07891c48e2c5c
Paul Eggert
Tue Sep 1 18:23:21 2015 -0700
Fix some more docstring etc. quoting problems
26bd978d87dfbf9baa115cd961a67d42b416c4bf
Paul Eggert
Thu Sep 3 15:32:54 2015 -0700
Go back to grave quoting in source-code docstrings etc.
6afef3f6ca2f3009c722b84e249903b7f807b044
Paul Eggert
Mon Sep 7 16:09:27 2015 -0700
* lisp/ob-core.el (org-babel-parse-src-block-match): Compute indentation
taking into consideration tab width.
(org-babel-where-is-src-block-result): Do not assume indentation
consists of white space characters only.
* testing/lisp/test-ob.el (test-ob/preserve-results-indentation): Add
test.
Reported-by: Jarmo Hurri <jarmo.hurri@iki.fi>
<http://permalink.gmane.org/gmane.emacs.orgmode/100403>
* 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)