* lisp/org-element.el (org-element--parse-elements,
org-element-at-point): Fix parsing of a list in a block in a list.
* testing/lisp/test-org-element.el: Add test.
* org-test.el (org-test-with-temp-text-in-file): Wrap ,@body
into (progn ...) so that tests don't have to wrap it themselves.
Fix the testing suite to use this.
Also fix formatting and trailing whitespaces.
Fix test-org-src/blank-line-block so that it
checks editing of a code block with a whitespace
with point on the #+begin_src line.
Thanks to Michael Brand for spotting the (progn ...) problem.
* lisp/test-org-src.el (test-org-src/blank-line-block): Use
`org-test-with-temp-text-in-file' because `org-in-src-block-p'
checks against an Org mode text property. Don't check for the
word at point.
Thanks to Nick Dokos for reporting this failed test.
* org-test.el (org-test-with-temp-text): No need to kill a
temporary buffer. Don't use (prog1 ,@body ...), only expand
,@body.
Thanks to Nick Dokos for pointing this.
* contrib/lisp/org-export.el (org-export-get-previous-element,
org-export-get-next-element): Allow to retrieve all previous/next
exportable objects by specifying a non-nil, non positive integer
argument.
* testing/lisp/test-org-export.el: Add tests.
* testing/lisp/test-org-clock.el (test-org-clock/clocktable): The last test
for clocktables introduced in commit 6642177 did not work if the test was
run before 15:00 due to the end time being specified as "<now>" (which
includes the current time of day and not just the date). The obvious
"<today>" does also not work since it means 0:00 of the current day. The
correct specification to use is "<tomorrow>", which is 0:00 the following
day or equivalently the end of today, 24:00.
* lisp/org.el (org-all-targets): Fix radio targets detection when
object is directly followed by a non-whitespace character.
* testing/lisp/test-org.el: Add test.
* lisp/org-element.el (org-element-timestamp-interpreter): Fix
timestamp interpreter when raw value isn't available.
* testing/lisp/test-org-element.el: Update test.
* lisp/org-element.el (org-element-context): When point is between two
objects, be sure to return the second one.
* testing/lisp/test-org-element.el: Add test.
* lisp/org-element.el (org-element-timestamp-parser): Timestamp with
time range has active/inactive-range type.
* testing/lisp/test-org-element.el: Add test.
In order to know if starting date/time is really the same as ending
date/time, this patch permits to use the following:
(memq (org-element-property :type timestamp) '(active inactive))
* contrib/lisp/org-export.el (org-export--get-subtree-options): Store
value of options with `split' behaviour as a list of strings, not
simply as a string. Small refactoring.
* testing/lisp/test-org-export.el: Add tests.
* contrib/lisp/org-export.el (org-export-define-derived-backend): Add
`:parent' property to derived backend.
(org-export-derived-backend-p): New function.
* testing/lisp/test-org-export.el: Add tests.
This function can be useful in filters implemation. I.e.
(defun my-filter (contents backend info)
(when (memq backend '(e-latex e-beamer some-derived-backend-from-latex))
...))
can be replaced with:
(defun my filter (contents backend info)
(when (org-export-derived-backend-p backend 'e-latex)
...))
* contrib/lisp/org-export.el (org-export-registered-backends): New
variable.
(org-export-define-backend, org-export-define-derived-backend): Use
new variable. Also redefine how sub-menus are defined.
(org-export-backend-filters, org-export-backend-menu,
org-export-backend-options, org-export-backend-translate-table): New
functions.
(org-export-get-environment, org-export--parse-option-keyword,
org-export--get-subtree-options, org-export--get-inbuffer-options,
org-export--get-global-options, org-export-install-filters,
org-export-with-backend): Access to data stored in new variable.
(org-export-dispatch-ui): Display sub-menus according to new
definition.
(org-export-dispatch-menu-entries): Removed variable.
* contrib/lisp/org-e-beamer.el: Use new sub-menu definition.
(org-e-beamer--format-section, org-e-beamer-item,
org-e-beamer-keyword): Use `org-export-with-backend' instead of
relying on removed variables.
* testing/lisp/test-org-export.el: Update tests.
This patch gets rid of "invisible" variables, that is variables
defvar'ed within a macro.
* lisp/org-list.el (org-list-separating-blank-lines-number): When
computing number of blank lines separating items, also count those
in unparsed blocks, like example blocks.
* testing/lisp/test-org-list.el: Add tests.
In the following situation, with `org-blank-before-new-entry' set to
`auto' for `plain-list-item, a blank line should be inserted when
inserting the following item:
- item1
#+BEGIN_EXAMPLE
contents
#+END_EXAMPLE
* lisp/org.el (org-beginning-of-line): check `visual-line-mode'
instead of `line-visual-mode' to determine whether to move by visual
lines.
* lisp/org.el (org-kill-line): use of org-bound-and-true-p macro.
* testing/lisp/test-org.el: Add test
* lisp/org.el (org-end-of-line): On a hidden block make sure to
delegate motion to `end-of-line' instead of `move-end-of-line' in
order to stay on the current line.
* testing/lisp/test-org.el: Update test.
* contrib/lisp/org-export.el (org-export-before-processing-hook): New
variable.
(org-export-as): Run a hook just before expanding include keywords and
macros, and evaluating Babel blocks.
* testing/lisp/test-org-export.el: Add test.
* contrib/lisp/org-export.el (org-export-get-previous-element,
org-export-get-next-element): Correctly retrieve previous and next
object, if any, in secondary strings.
* testing/lisp/test-org-export.el: Add tests.
* lisp/org.el (org-macro-replace-all): Signal an error when a circular
macro expansion happens.
(org-macro-initialize-templates): Fix docstring.
* testing/lisp/test-org.el: Add test.
* contrib/lisp/org-export.el (org-export-as): Expand correctly
{{{title}}} and such when they already contain a regular macro.
This is done by expanding macros in two steps: at first regular
macros, then document specific macros.
(org-export-expand-macro): Remove function.
* testing/lisp/test-org-export.el: Add test.
* lisp/org-element.el (org-element--collect-affiliated-keywords):
Allow duals keywords with only secondary value.
* testing/lisp/test-org-element.el: Add test.
This patch allows to parse correctly the following:
#+CAPTION[short caption]:
#+CAPTION: Very long caption
Some paragraph.
* lisp/org-element.el (org-element-timestamp-parser): Modify timestamp
objects properties.
(org-element-headline-parser, org-element-inlinetask-parser): Remove
`:timestamp' and `:clock' property. Add `:clockedp' property. Also,
set `:closed', `:deadline' and `:scheduled' values to timestamp
objects, not strings. Small refactoring.
(org-element-clock-parser): Rename `:time' property into `:duration'.
Also, set `:value' value as a timestamp object, not a string.
(org-element-planning-parser): Set `:closed', `:deadline' and
`:scheduled' values to timestamp objects, not strings.
(org-element-clock-interpreter, org-element-planning-interpreter)
(org-element-timestamp-interpreter): Update interpreters.
(org-element--current-element): Tiny refactoring.
* testing/lisp/test-org-element.el: Add tests.
* lisp/ob.el (org-babel-where-is-src-block-result): Insert new results
keyword in current narrowed part of buffer, if necessary. Small
refactoring.
(org-babel-insert-result): Do not widen buffer when new results have
to be inserted. Therefore, results inserted after the last block of
a narrowed buffer still belong to the narrowed part of the buffer.
* testing/lisp/test-ob.el: Add tests.
* testing/lisp/test-ob-exp.el: Move test to test-ob.el