* 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.
* ob-exp.el (org-babel-exp-do-export): `clean' lambda form removes inline
results wrapped in `results{{{(' and `)}}}' by calling
`org-babel-remove-inline-result'.
* lisp/ox-org.el (org-org-link): New function.
This patch allows to handle `org' export format in EXPORT argument
from `org-add-link-type'.
Suggested-by: John Kitchin <johnrkitchin@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/94439>
* lisp/org-element.el (org-element-headline-parser): Remove :alt-title.
* lisp/ox.el (org-export-get-alt-title): Check regular :ALT_TITLE
property instead of :alt-title.
`:alt-title' is an export-specific property. As a consequence, it's
value doesn't need to be parsed at "org-element.el"'s level. There, it
is treated as a regular property : `ALT_TITLE'.
This also removes the last call to
`org-element-parse-secondary-string' from "org-element.el".
* lisp/ox-ascii.el (org-ascii--current-text-width): Compute contents'
text width according to exported tag instead of original one.
Reported-by: Rasmus <rasmus@gmx.us>
<http://permalink.gmane.org/gmane.emacs.orgmode/94416>
* lisp/org-element.el (org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element--collect-affiliated-keywords): Use
`org-element--parse-objects' instead of
`org-element-parse-secondary-string' when parsing live objects in
secondary strings.
`org-element-parse-secondary-string' parses a given string in
a temporary buffer, rendering buffer position related
properties (e.g., :begin) invalid.
Reported-by: John Kitchin <johnrkitchin@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/94397>
* lisp/org-element.el (org-element-headline-interpreter,
org-element-inlinetask-interpreter): Use format control string
instead of calling `char-to-string'.
* lisp/org-element.el (org-element--parsed-properties-alist): New
variable.
(org-element-map): Remove unnecessary funcalls. Externalize some
computations in the variable above.
* testing/lisp/test-ob-lob.el (test-ob-lob/call-with-header-arguments):
Replace `cl-letf' with `letf' for compatibility with older Emacsen.
* testing/lisp/test-org-timer.el (test-org-timer/other-timer-error):
Also check for 'error since 'user-error is not used by older Emacsen.
* lisp/ox.el (org-export-collect-tree-properties): Do not
set :ignore-list.
(org-export--populate-ignore-list): Remove function.
(org-export--selected-trees): Small refactoring.
(org-export-prune-tree): New function.
(org-export-remove-uninterpreted-data): Fix docstring.
(org-export-as): Prune tree before calling tree filter.
* testing/lisp/test-ox.el (org-test-with-parsed-data): Fix macro.
This patch introduces two changes in the export process:
1. Non-exported elements are removed from the tree instead of being
moved into an ignore list (with the exceptions of tables rows
and cells)
2. Parse tree filter is called on the tree being exported, not the
original one.
Reported-by: Eric S Fraga <e.fraga@ucl.ac.uk>
<http://permalink.gmane.org/gmane.emacs.orgmode/94162>
* lisp/ob-R.el (org-babel-R-eoe-indicator):
(org-babel-R-eoe-output): Convert from defvar to defconst.
(org-babel-R-write-object-command): Convert from defvar to defconst.
Add line breaks and indentation.
* 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.
* testing/examples/babel.org: Change spaces to dashes in #+name
lines.
* testing/lisp/test-ob-exp.el (org-test-with-expanded-babel-code):
(ob-exp/evaluate-all-executables-in-order):
(ob-exp/exports-inline-code):
(ob-exp/exports-inline):
(ob-exp/exports-inline-code-double-eval):
(ob-exp/exports-inline-code-eval-code-once):
(ob-exp/exports-inline-code-double-eval-exports-both):
(ob-exp/use-case-of-reading-entry-properties):
(ob-exp/export-from-a-temp-buffer):
(ob-export/export-with-results-before-block):
(ob-export/export-under-commented-headline):
* testing/lisp/test-ob-lob.el (test-ob-lob/export-lob-lines):
* testing/lisp/test-ob.el (test-org-babel/inline-src_blk-default-results-replace-line-1):
(test-org-babel/inline-src_blk-default-results-replace-line-2):
(test-org-babel/inline-src_blk-manual-results-replace):
(test-org-babel/inline-src_blk-results-scalar):
(test-org-babel/inline-src_blk-results-verbatim):
(test-org-babel/inline-src_blk-preceded-punct-preceded-by-point):
* testing/lisp/test-ox.el (test-org-export/export-scope):
Bind ‘org-babel-inline-result-wrap’ and/or ‘org-export-babel-evaluate’
so tests work when users have customized these variables.
* testing/lisp/test-ob-exp.el (ob-export/export-with-results-before-block):
Add ‘org-trim’ where an extra newline was creeping in.
* testing/lisp/test-ob-lob.el (test-ob-lob/call-with-header-arguments):
Neutralize org-babel-insert-result, which was stomping on the buffer
contents and disrupting the test
* testing/lisp/test-org-element.el (test-org-element/block-switches):
Replace (should (and ...)) with multiple (should ...). This gives
more precise indications of what is wrong when a test fails.
(test-org-element/link-parser): Require org-docview.
* testing/lisp/test-org-timer.el (test-org-timer/other-timer-error):
Add the error type for ‘should-error’.
* testing/lisp/test-ox.el (test-org-export/set-title):
(test-org-export/handle-options):
(test-org-export/with-timestamps):
(test-org-export/comment-tree):
(test-org-export/handle-inlinetasks): Let
‘org-export-filter-body-functions’ and
‘org-export-filter-final-output-functions’ to nil where an empty
string is the expected result. ‘org-export-filter-apply-functions’
treats an empty string as special, and changes it to nil. This
creates test failures when the user has customized these variables.
* testing/org-test.el (org-test-with-temp-text): Let ‘org-mode-hook’
to nil.
(org-test-table-target-expect): Require ert since this function calls
some of its should* functions.
* 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/ox.el (org-export-ignore-element): Remove function.
(org-export-collect-tree-properties): Do not assume users can
modify :ignore-list export property.
* testing/lisp/test-ox.el (test-org-export/user-ignore-list): Remove
test.
:ignore-property is an implementation detail, which should not be
exposed to users. Also, it is easier to simply remove the element to
ignore from the parse tree with `org-element-extract-element'.
* doc/org.texi (Export settings): Add UNNUMBERED property to concept
index. Fix number of spaces at the end of a sentence. Use @code
instead of @samp for reserved properties.
* lisp/org-macro.el (org-macro-escape-arguments,
org-macro-extract-arguments): New functions.
* lisp/org-element.el (org-element-macro-parser): Use new function.
* testing/lisp/test-org-macro.el (test-org-macro/escape-arguments,
test-org-macro/extract-arguments): New tests.
* lisp/org.el (org--get-display-dpi): New function.
(org-create-formula-image-with-dvipng):
(org-create-formula-image-with-imagemagick): Use it.
The previous method tried to calculate the display dpi from the font
height, but this is wonky and not necessary, since it can be
calculated directly.
* lisp/org.el (org-toggle-inline-images): Only message if
called-interactively-p.
The old code made a halfhearted attempt to do this; this patch
provides the other half of the heart.
* lisp/org-compat.el (org-activate-mark): Make obsolete.
The activate-mark function was introduced in Emacs 23 and
org-activate-mark wasn’t called anywhere in the code base.