* testing/lisp/test-org-agenda.el (test-org-agenda/property-timestamp):
Fix test that failed because of different behavior of agenda view
depending whether the view is called today (according to system date)
or not. Today's agenda (even called with custom date argument)
display the past scheduled items, while it is not the case for
non-today agendas.
* testing/lisp/test-org-agenda.el (test-org-agenda/one-line):
(test-org-agenda/scheduled-non-todo):
(test-org-agenda/non-scheduled-re-matces):
(test-org-agenda/property-timestamp):
(test-org-agenda/diary-inclusion):
(test-org-agenda/set-priority):
Add a note to warn future test developers about potential surprising
agenda behaviour.
* lisp/org-agenda.el (org-agenda-get-timestamps): Use
`org-at-timestamp-p' instead of org-element to check if at valid
timestamp. Agenda should consider timestamps inside node properties
even though they are not parsed by org-element.
* testing/lisp/test-org-agenda.el (test-org-agenda/property-timestamp):
Add new test checking active timestamp inside property drawer.
* testing/examples/agenda-file.org (test timestamp inside properties):
Add heading for `test-org-agenda/property-timestamp'.
Reported in https://list.orgmode.org/06d301d83d9e$f8b44340$ea1cc9c0$@tomdavey.com
* lisp/org.el (org-copy-visible): Decide whether text is invisible by
calling invisible-p rather than checking whether the invisible
property at point is non-nil.
Text may have a non-nil invisible property but _not_ be hidden from
the user (and thus should be copied by org-copy-visible). For
example, the link itself is shown when org-link-descriptive is nil,
but it still has an invisible property of `org-link'.
* lisp/org.el (org-copy-visible): Don't copy invisible text that
follows invisible text with a different property value.
If org-copy-visible sees that the left bound position has a non-nil
invisible property, it uses next-single-char-property-change to find
the new bound. However, next-single-char-property-change may just
find a bound that still has a _different_ non-nil invisible property.
Reported-by: "Максим Бабушкин" <maxbabushkin@gmail.com>
Link: https://debbugs.gnu.org/49967
* testing/lisp/test-org.el (test-org/copy-visible): Switch defun to
ert-deftest so that the test is actually executed, and resolve
failures in test.
Make two adjustments so that the now executed test passes:
- Correct the end value of the hidden part of the string for one
test case.
- Disable org-unfontify-region so that the invisible properties show
up in the temporary buffer.
I think org-unfontify-region should probably be changed to _not_
remove the invisible property, but it's a longstanding behavior.
Changing it would need more thought and isn't something that
should be done on the bugfix branch.
* lisp/org-list.el (org-list-send-item): Check if dest is a string
before matching it, to allow dest to be a buffer position.
* testing/lisp/test-org-list.el (test-org-list/send-item): Add tests.
* testing/examples/agenda-file.org: Add test headings where SCHEDULED
line is not planning.
*
testing/lisp/test-org-agenda.el (test-org-agenda/non-scheduled-re-matces):
Make sure that SCHEDULED lines that do no belong to planning do not
trigger agenda matches.
See https://list.orgmode.org/20220101200103.GB29829@itccanarias.org/T/#t
* testing/lisp/test-org-attach-git.el: Provide feature.
As of 9044b300e (org-test: Fix ERC errors using latest Emacs master,
2021-11-24), tests must provide a feature.
* testing/lisp/test-ob-C.el:
* testing/lisp/test-ob-awk.el:
* testing/lisp/test-ob-sed.el: Add missing provide.
* testing/lisp/test-property-inheritance.el: Fix incorrect feature
name.
* testing/org-test.el (org-test-load): Use `require' instead of
`load-file' to load tests. `load-file' can lead to duplicate test
definitions that now trigger ERC errors.
See https://lists.gnu.org/archive/html/bug-gnu-emacs/2021-11/msg01968.html
* lisp/oc.el (org-cite-main-affixes): New function.
* lisp/oc-natbib.el (org-cite-natbib--build-optional-arguments): Use
new function.
* testing/lisp/test-oc.el (test-org-cite/main-affixes): New test.
* lisp/org-macro.el (org-macro--collect-macros): Multiple lines are
allowed for AUTHOR keyword (per `org-export-options-alist') so make
sure we collect all of them.
* testing/lisp/test-org-macro.el (test-org-macro/author): Add test.
Reported-by: Vinicius Vinicius <vinicius.vin@yandex.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-10/msg00727.html>
* lisp/oc.el (org-cite-process-citations): Add a space before citation
only if it is preceded by a quotation mark.
* testing/lisp/test-oc.el (test-org-cite/export-capability): Add
tests.
Reported-by: Denis Maier <denismaier@mailbox.org>
<http://lists.gnu.org/r/emacs-orgmode/2021-09/msg00085.html>
* lisp/org-macs.el (org-plist-delete-all): New function.
* lisp/ox-publish.el (org-publish-file): Add
`org-html-publish-to-html' as the default publishing function.
* testing/lisp/test-ox-publish.el (org-test-publish): Use
`org-plist-delete-all' to remove properties from the plist.
Reported-by: Christopher W. Ryan
See <https://list.orgmode.org/CAELBRWLgV-s6SGX=cevtN7iW8htwiLezR469T-cGMWE_6iX1+A@mail.gmail.com>
* lisp/ob-R.el (ob-session-async-R-indicator): Add constant
representing a prefix R to identity session.
(ob-session-async-org-babel-R-evaluate-session): New function to
evaluate R src block asynchrously.
(ob-session-async-R-value-callback): New function that calls back
the result of the asynchronous evaluation.
(org-babel-R-evaluate): Add `async' parameter and call
`ob-session-async-org-babel-R-evaluate-session' if `async'
parameter is present.
(org-babel-execute:R): Call `org-babel-comint-use-async' to check
if async is among `params' and add async parameter to
`org-babel-R-evaluate'.
* testing/lisp/test-ob-R.el: Add 7 more tests for async
evaluations, also taken from the `ob-session-async' package.
This is almost a carbon copy of Jack Kamm's `ob-session-async'.
The original source code can be found
https://github.com/jackkamm/ob-session-async.
Please refer to the following thread to trace back the discussion
on async evaluation in R:
https://list.orgmode.org/87eed9g9p6.fsf@gmail.com/
testing/lisp/test-org-protocol.el
(test-org-protocol/org-protocol-store-link)
(test-org-protocol/org-protocol-capture): Cases to check that "+" is
decoded to space in query parameters (new style of URIs) but preserved
in path components (old style of org-protocol links).
* lisp/ob-core.el (org-babel-disassemble-tables,
org-babel-gnuplot-process-vars): Use `proper-list-p' check instead of
`listp'.
(org-babel-disassemble-tables): Check list length before trying to
remove hline from a table assignment.
* testing/lisp/test-ob.el (test-ob/cons-cell-as-variable): Add the
test.
* lisp/ox-latex.el (org-latex-src-block): Prevent leak of percent sign
from caption to `format' first argument causing export failure due to
insufficient argument number. The fix covers only the case of verbatim
environment.
* testing/lisp/test-ox.el
(test-org-export/latex-src-block-verbatim-caption): New test for src
block LaTeX export with cases of various formatting of caption and
verbatim environment. Check that percent signs in caption and source
block body do not lead to errors.
Reported-by: Charest, Luc <charest.luc@hydroquebec.com>
<https://lists.gnu.org/archive/html/emacs-orgmode/2021-08/msg00017.html>
* lisp/org.el (org-add-log-setup): Always run `org-add-log-note' via
`post-command-hook'. Otherwise, there is no way to know if a note was
requested for `this-command'. Running `org-add-log-note' directly
would, for example, break `org-auto-repeat-maybe' as reported in [1].
* lisp/org-agenda.el (org-agenda-todo): Avoid reintroducing the bug
fixed in c670379adf.
* testing/lisp/test-org.el: Add test checking the reported bug.
[1] https://orgmode.org/list/CAOn=hbcaW1R6vtun-E2r4LS=j3dp=VjqmjGtzy8UC1SyPArKbA@mail.gmail.com
* lisp/org.el (org-insert-heading): Fix insertion of headings when
point is before any heading in the case of "respect content" insertion.
Kudos to Victor Stoichita. https://orgmode.org/list/87lf4594t3.fsf@svictor.net/
* lisp/org-footnote.el (org-footnote--allow-reference-p): Allow
inserting footnotes at the end of table cells.
* testing/lisp/test-org-footnote.el (test-org-footnote/new): Add test.
* lisp/oc.el (org-cite--allowed-p): Allow inserting a citation after
two or more spaces at the end of a table cell.
* testing/lisp/test-oc.el (test-org-cite/insert-capability): Add
tests.
* lisp/ox.el (org-export-raw-string): New function
(org-export-data):
(org-export-with-backend): React to raw objects.
* testing/lisp/test-ox.el (test-org-export/raw-string): New test.
A raw object is a pseudo-object (i.e., special object type that exists
only during export) with the property of being exported as-is, with no
processing from an export back-end.
It is particularly useful to add contents to, or pre-process objects
from, a parse tree.
* lisp/org-element.el (org-element-citation-key-re):
(org-element-citation-prefix-re): New variables.
(org-element--set-regexps): Set `org-element--object-regexp' so it
finds citations.
(org-element-all-objects): Add citation and citation-reference
objects.
(org-element-recursive-objects): Add citation object.
(org-element-object-restrictions): Add citation and citation-reference
to restrictions.
(org-element-secondary-value-alist): citation and citation references
can hold secondary strings.
(org-element-citation-parser):
(org-element-citation-interpreter):
(org-element-citation-reference-parser):
(org-element-citation-reference-interpreter): New functions.
(org-element--object-lex): Parse citations and citations references.
* testing/lisp/test-org-element.el (test-org-element/citation-parser):
(test-org-element/citation-reference-parser):
(test-org-element/citation-interpreter): New tests.
This patch adds support for [cite:@key], [cite:pre @key post]
[cite:global prefix; pre @key1 post; pre @key2 post; global suffix]
objects along with their [cite/style: ...] counterparts.
* lisp/org-capture.el (org-capture-fill-template): Changed to use
completing-read-multiple.
* lisp/org.el (org-set-tags-command): Changed to use
completing-read-multiple.
(org-change-tag-in-region): Changed to use a simple completion table.
* testing/lisp/test-org.el (test-org/set-tags-command): Fixed tests.
Change various places which use `completing-read' to read tags using a
custom completion function to instead use `completing-read-multiple'
with a completion table instead.
This makes tab completion play better with alternative completion
frameworks such as vertico, selectrum, etc.
`org-change-tag-in-region' only reads a single tag, so it is changed
to use a completion table with `completing-read'. This also makes it
play better with alternative completion frameworks.
Note that there is still one use for `org-tags-completion-function',
which is for completing tag matches. Completing tag matches is
different from completing lists of tags since the separators (+, -,
etc) have semantic meaning. This commit does not address that use
case.
Adds functionality to ob-comint.el to implement async session eval on
a per-language basis. Adds a reference implementation for ob-python.
* lisp/ob-comint.el (org-babel-comint-with-output): Remove comment.
(org-babel-comint-async-indicator, org-babel-comint-async-buffers,
org-babel-comint-async-file-callback,
org-babel-comint-async-chunk-callback,
org-babel-comint-async-dangling): Add buffer-local variables used for
async comint evaluation.
(org-babel-comint-use-async): Add function to determine whether block
should be evaluated asynchronously.
(org-babel-comint-async-filter): Add filter function to attach to
comint-output-filter-functions for babel async eval.
(org-babel-comint-async-register): Add function to setup buffer
variables and hooks for session eval.
(org-babel-comint-async-delete-dangling-and-eval): Add helper function
for async session eval.
* lisp/ob-python.el (org-babel-execute:python): Check for async header
argument.
(org-babel-python-evaluate): Check whether to use async evaluation.
(org-babel-python-async-indicator): Add constant for indicating the
start/end of async evaluations.
(org-babel-python-async-evaluate-session): Add function for Python
async eval.
*
testing/lisp/test-ob-python.el (test-ob-python/async-simple-session-output):
Unit test for Python async session eval.
(test-ob-python/async-named-output): Unit test that Python async eval
can replace named output.
(test-ob-python/async-output-drawer): Unit test that Python async eval
works with drawer results.
* lisp/org-element.el (org-element-drawer-parser): A single ":END:"
line should not be recognized as a drawer.
* testing/lisp/test-org-element.el (test-org-element/drawer-parser):
Add test.
Reported-by: Ihor Radchenko <yantar92@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2021-05/msg00819.html>
* testing/lisp/test-org.el (test-org/with-electric-indent)
(test-org/without-electric-indent): Make sure
`org-adapt-indentation' is consistent with expected results.
* testing/lisp/test-org-element.el (test-org-element/cache-bugs): A
new test documenting a known bug:
1. Create initial file like:
P0
P1
| a | b |
<point>| c | d |
Note that second line of the table is not indented. Now,
org-element-at-point returns table-row.
2. Modify the file to test org-element-cache
P0
- item
P1
| a | b |
<point>| c | d |
Now, the first (indented) row of the table belongs to item. The
second row should be an individual table and org-element-at-point
returns table.