Commit Graph

2244 Commits

Author SHA1 Message Date
Ihor Radchenko 89af7b11a4
org-sbe: Fix when the macro is expanded outside Org file
* lisp/ob-table.el (org-sbe): Do not try to execute code block during
macro expansion.
* testing/lisp/test-ob-table.el (test-ob-table/sbe): Uncomment the
test.  Update the expected return value.
2022-11-23 17:26:55 +08:00
Ihor Radchenko bd384d3267
test-org-export/activate-smart-quotes: Uncomment working test
* testing/lisp/test-ox.el (test-org-export/activate-smart-quotes):
Uncomment a test that was claimed broken.  It is not anymore.
2022-11-23 11:32:04 +08:00
Rudolf Adamkovič 62e1513b5a
ox-html: Update from MathJax 2 to MathJax 3+
* lisp/ox-html.el (
org-html-mathjax-options,
org-html-mathjax-template,
org-html--build-mathjax-config
): Update from MathJax 2 to 3 while maintaining compatibility.  All
legacy options should continue to work, except for the 'path' option
which must now point to MathJax 3 or later.
* testing/lisp/test-ox-html.el (
ox-html/mathjax-path-none,
ox-html/mathjax-path-default,
ox-html/mathjax-path-custom,
ox-html/mathjax-path-in-buffer,
ox-html/mathjax-options-default,
ox-html/mathjax-options-custom,
ox-html/mathjax-options-in-buffer,
ox-html/mathjax-legacy-scale-default,
ox-html/mathjax-legacy-scale-custom,
ox-html/mathjax-legacy-scale-in-buffer,
ox-html/mathjax-legacy-scale-message,
ox-html/mathjax-legacy-scale-message-in-buffer,
ox-html/mathjax-legacy-scale-ignore,
ox-html/mathjax-legacy-autonumber-ams,
ox-html/mathjax-legacy-autonumber-ams-in-buffer,
ox-html/mathjax-legacy-autonumber-none,
ox-html/mathjax-legacy-autonumber-none-in-buffer,
ox-html/mathjax-legacy-autonumber-all,
ox-html/mathjax-legacy-autonumber-all-in-buffer,
ox-html/mathjax-legacy-autonumber-message,
ox-html/mathjax-legacy-autonumber-message-in-buffer,
ox-html/mathjax-legacy-font-tex,
ox-html/mathjax-legacy-font-tex-in-buffer,
ox-html/mathjax-legacy-font-stix-web,
ox-html/mathjax-legacy-font-stix-web-in-buffer,
ox-html/mathjax-legacy-font-asana-math,
ox-html/mathjax-legacy-font-asana-math-in-buffer,
ox-html/mathjax-legacy-font-neo-euler,
ox-html/mathjax-legacy-font-neo-euler-in-buffer,
ox-html/mathjax-legacy-font-gyre-pagella,
ox-html/mathjax-legacy-font-gyre-pagella-in-buffer,
ox-html/mathjax-legacy-font-gyre-termes,
ox-html/mathjax-legacy-font-gyre-termes-in-buffer,
ox-html/mathjax-legacy-font-latin-modern,
ox-html/mathjax-legacy-font-latin-modern-in-buffer,
ox-html/mathjax-legacy-line-breaks-true,
ox-html/mathjax-legacy-line-breaks-true-in-buffer,
ox-html/mathjax-legacy-line-breaks-false,
ox-html/mathjax-legacy-line-breaks-false-in-buffer,
ox-html/mathjax-legacy-line-breaks-message,
ox-html/mathjax-legacy-line-breaks-message-in-buffer): Test MathJax in
general and also the conversion of legacy options from MathJax 2 to 3.
* testing/org-test.el (org-test-capture-messages): Add a new macro
useful for testing the messages put in the echo area.
* etc/ORG-NEWS: Document MathJax 2 to 3 upgrade, highlighting the
benefits of the new version but also mentioning the fact that the user
may need to update the `path' option in `org-html-mathjax-options'.
* doc/org-manual.org (Math formatting in HTML export): Update the link
to the MathJax CDN and the example of how to use `+HTML_MATHJAX' with
MathJax 3.  Also, remove the note on MathJax extensions, as they did
not work (and do not work) as documented.

Link: https://list.orgmode.org/orgmode/m2a667n4ax.fsf@me.com/
2022-11-21 10:44:56 +08:00
Ihor Radchenko 4c40fc3d4d
org: Allow spaces in #+LINK abbreviation definitions
* lisp/org.el (org-set-regexps-and-options): Allow spaces when
defining link abbreviations via #+LINK keyword.
* testing/lisp/test-org-element.el (test-org-element/link-parser): Add
a new test.
* doc/org-manual.org (Link Abbreviations): Add example demonstrating
link abbreviation with spaces.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://orgmode.org/list/87zgf7zujc.fsf@localhost
2022-11-20 13:15:02 +08:00
Ihor Radchenko ad62379984
org-export: Allow "string with spaces" as #+OPTIONS: values
* lisp/ox.el (org-export--parse-option-keyword): Allow `read'ing the
option value as far as needed.  Do not restrict the value to the first
whitespace only.  This way, one can use Elisp strings with all the
escaping options as values.
* testing/lisp/test-ox.el (test-org-export/parse-option-keyword): Add
test for option value with a space inside.

Reported-by: Pierre Balayé <pierrebalaye@gmail.com>
Link: https://list.orgmode.org/orgmode/CANpQAF-n+4xhNvL8aaP8j2gJ70vbu80wmh9a4Oj0BxNHA5-yDA@mail.gmail.com/
2022-11-17 12:49:29 +08:00
Ihor Radchenko fe67cebb3a
fixup! test-ob-python: Disable test failing on CI when using older Emacs 2022-11-16 17:42:17 +08:00
Ihor Radchenko dc63cdd220
org-test-load: Make tests with missing dependencies more prominent
* testing/org-test.el (org-test-load): Skip test files that throw
'missing-test-dependency.  Skipped tests are explicitly listed in test
summary and thus more visible.  This also distinguishes such tests
from known bugs.
2022-11-16 16:44:49 +08:00
Ihor Radchenko a831c18baf
fixup! test-ob-python: Disable test failing on CI when using older Emacs 2022-11-16 16:31:40 +08:00
Ihor Radchenko d45a896289
test-ob-python: Disable test failing on CI when using older Emacs
* testing/lisp/test-ob-python.el (test-ob-python/assign-underscore):
Skip the test when running Emacs <28.  On older Emacs, python.el may
fail to load on slow machines, like during CI testing.

Link: https://lists.sr.ht/~bzg/org-build-failures/%3CCOCRNW71TUAP.L29E2AW6TQZ2%40cirno2%3E
2022-11-16 10:29:40 +08:00
Ihor Radchenko 3ef0e3c338
test-ob-python: Refactor test failing on CI to provide better backtrace
* testing/lisp/test-ob-python.el (test-ob-python/assign-underscore):
Do not wrap code into `should' form as much as possible to avoid
truncated backtrace.
2022-11-15 15:04:08 +08:00
Ihor Radchenko f83e45526b
org-toggle-item: Move footnote-definitions out of the lists
* lisp/org-list.el (org-toggle-item): When headings contain
footnote-definitions, move them out of the list.  Footnote-definitions
must not be indented and hence cannot belong to the list.  Ensure that
definitions do not slurp the following element after the list.
Consider when the list created by `org-toggle-item' is continued by an
existing list.
* testing/lisp/test-org-list.el (test-org-list/toggle-item): Add
tests.

Reported-by: Ypo <ypuntot@gmail.com>
Link: https://orgmode.org/list/877d3k70lu.fsf@localhost
2022-11-11 13:19:01 +08:00
Ihor Radchenko c41a2198f2
testing: Provide more debug info for diary sexps
* testing/org-test.el (org-test-run-batch-tests):
(org-test-run-all-tests): Bind `calendar-debug-sexp' to non-nil when
running tests.

See https://orgmode.org/list/t2hpe9$119m$1@ciao.gmane.io
2022-11-11 11:34:14 +08:00
Ihor Radchenko d620c30e6f
fixup! testing/lisp/test-ob-java.el: Skip when ob-java is not loaded 2022-11-10 16:58:07 +08:00
Ihor Radchenko f85865e59f
testing/lisp/test-ob-java.el: Skip when ob-java is not loaded
* testing/lisp/test-ob-java.el (featurep): Skip tests when ob-java is
not loaded.
2022-11-10 16:54:35 +08:00
Ihor Radchenko 5a6d00a3a3
test-org-num.el: Do not rely on fixed overlay order in `overlays-in'
* testing/lisp/test-org-num.el (test-org-num/max-level):
(test-org-num/skip-numbering):
(test-org-num/update):
* testing/lisp/test-org-table.el (test-org-table/toggle-column-width):
Do not expect specific overlay order in the return value of
`overlays-in'.  The order is not guaranteed by the docstring and has
been changed in Emacs 29.

Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59067
2022-11-09 10:12:44 +08:00
Ihor Radchenko e3a7c01874
Refactor `org-time-stamp-custom-formats' and `org-time-stamp-formats'
* lisp/org.el (org-time-stamp-formats):
* lisp/org.el (org-time-stamp-custom-formats): Change the default
values stripping leading "<" and trailing ">".  Update the docstring
explaining the format and that leading and trailing brackets are now
ignored.  Update the :type specification to more precise.
(org-time-stamp-format): Update the argument list and docstring
allowing to use the function more flexibly to find the time stamp
format for both `org-time-stamp-formats' and
`org-time-stamp-custom-formats'.  Rename `long' argument to more
accurate `with-time'.  Ignore brackets in the `org-time-stamp-formats'
and `org-time-stamp-custom-formats'.  Allow `inactive' argument to be
`no-brackets'
(org-format-timestamp):
(org-read-date-display):
(org-insert-time-stamp):
(org-display-custom-time):
(org-timestamp-translate):
* lisp/org-compat.el (org-timestamp-format): Rename
`org-timestamp-format' to `org-format-timestamp'.  The old variant is
too similar with other `org-time-stamp-format' function.  Also, use
`org-time-stamp-format' to determine the timestamp format instead of
using `org-time-stamp-formats' directly.
* lisp/ol.el (org-store-link):
* lisp/org-agenda.el (org-agenda-get-timestamps):
(org-agenda-get-progress):
* lisp/org-archive.el (org-archive-subtree):
(org-archive-to-archive-sibling):
* lisp/org-clock.el (org-clock-special-range):
* lisp/org-colview.el (org-colview-construct-allowed-dates):
* lisp/org-element.el (org-element-timestamp-interpreter):
* lisp/org-macro.el (org-macro--find-date):
* lisp/org-pcomplete.el (pcomplete/org-mode/file-option/date):
* lisp/ox-odt.el (org-odt--format-timestamp):
(org-odt-template):
* lisp/ox.el (org-export-get-date):
* testing/lisp/test-org.el (test-org/timestamp-format): Use
`org-time-stamp-format' instead of directly examining
`org-time-stamp-custom-formats' and `org-time-stamp-formats'.  Use the
new function name `org-format-timestamp'.
* etc/ORG-NEWS (Default values and interpretations of ~org-time-stamp-formats~ and ~org-time-stamp-custom-formats~ are changed):
(~org-timestamp-format~ is renamed to ~org-format-timestamp~):
(Updated argument list in ~org-time-stamp-format~): Document the
user-facing changes.

This commit documents and unifies previously undocumented assumptions
about the values of `org-time-stamp-formats' and
`org-time-stamp-custom-formats'.  Instead of fiddling with
leading/trailing brackets in the values, expedite the time format
calculation to `org-time-stamp-format'.  The undocumented assumption
about brackets in user option `org-time-stamp-custom-formats' is not
relaxed making the docstring correct.

Reported-by: Uwe Brauer <oub@mat.ucm.es>
Link: https://orgmode.org/list/87k04ppp1t.fsf@localhost
2022-11-07 15:05:37 +08:00
Daniel Ziltener 5e0c5c186d
org-babel: Add new "strip-tangle" :noweb argument value
* lisp/ob-tangle.el (org-babel-tangle-single-block): Strip noweb tags
from block if :noweb has been set to "strip-tangle".
* lisp/ob-core.el (org-babel-common-header-args-w-values): Add
"strip-tangle" as new allowed value.
* lisp/ob-core.el (org-babel-noweb-p): Add "strip-tangle" at the
appropriate positions.
* testing/lisp/test-ob-tangle.el (ob-tangle/strip-tangle): Add new test
case for "strip-tangle".
* doc/org-manual.org (Noweb Reference Syntax): Adjust documentation for
the noweb header argument.
* etc/ORG-NEWS: Add entry for new header argument value.

This patch adds the "strip-tangle" option for the :noweb header
argument.  This strips the noweb tags before tangling the block.  This can
be useful for e.g. testing purposes where one wants to use a block as
test case that can be both run inline as well as tangled into a file for
automated testing.

TINYCHANGE
2022-11-07 10:54:13 +08:00
Rudolf Adamkovič eefb14f9fa
test-org-clock: Test DWIM update of days
* testing/listp/test-org-clock (test-org-clock/clock-drawer-dwim): Add
new test for DWIM updates of days for clocks in logbook drawers.

Reported-by: Bruce E. Robertson <brucer42@gmail.com>
Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=53393
2022-11-06 11:27:35 +08:00
Rudolf Adamkovič f7b16402e6
org-babel: Never throw away standard error
* lisp/ob-eval.el (org-babel-eval-error-notify): Do not insert
superfluous whitespace.
* lisp/ob-eval.el (org-babel-eval): Show standard error even if the
command exits with a zero code.
* testing/lisp/test-ob-shell.el(
ob-shell/standard-output-after-success,
ob-shell/standard-output-after-failure,
ob-shell/error-output-after-success,
ob-shell/error-output-after-failure,
ob-shell/error-output-after-failure-multiple,
ob-shell/exit-code,
ob-shell/exit-code-multiple
): Add tests to avoid regressions.
2022-11-04 10:48:38 +08:00
Ihor Radchenko b93a61af9c
org-latex-line-break-safe: Use safer value of "\\[0pt]"
* lisp/ox-latex.el (org-latex-line-break-safe):
(org-latex-table-row):
Change \empty ending to explicit optional argument.  \empty still has
undesired side effects in some cases.

* testing/lisp/test-org-table.el (test-org-table/to-latex):
* testing/lisp/test-ox-latex.el (test-ox-latex/verse): Update tests.

Reported-by: Juan Manuel Macías <maciaschain@posteo.net>
Link: https://orgmode.org/list/87o7u9rz1a.fsf@posteo.net
2022-10-29 10:34:05 +08:00
Ihor Radchenko 6bbd08f5aa
org-datetree-insert-line: Fix blank line insertion
* lisp/org-datetree.el (org-datetree-insert-line): Use
`org--blank-before-heading-p' check.

* testing/lisp/test-org-datetree.el (test-org-datetree/find-date-create):
(test-org-datetree/find-month-create):
(test-org-datetree/find-iso-week-create): Explicitly set
`org-blank-before-new-entry' assumed throughout the tests.

Note that the `auto' behavior in `org-blank-before-new-entry' is
somewhat arbitrary.  It currently prefers no blank lines by
default (when no other headings are present in the buffer).  I went
with fixing the tests rather than changing
`org--blank-before-heading-p' to prefer inserting blank lines.  This
should make lesser impact on the end users.

Reported-by: Richard Walker <walkerrichardj@gmail.com>
Link: https://list.orgmode.org/orgmode/CAFyNgSE4mAt+b0Ks8L9bg2LbHcXnayOh+bYyONTQ4jN+zx3C1w@mail.gmail.com/
2022-10-26 15:25:24 +08:00
stardiviner 87e50f467a
test-org-fold.el: Add test for inline image displaying when cycling
* testing/lisp/test-org-fold.el (test-org-fold/org-fold-display-inline-images):
Add unit test for inline image displaying when cycling.
2022-10-26 12:43:08 +08:00
Mikhail Skorzhinskii c3aa6a6d43
org-refile.el: Show refile targets with a title
* lisp/org-refile.el (org-refile-get-targets): Use a document
title (#+TITLE) instead of file or buffer name in outline path, if a
corresponding customisation option is set to 'title.  Fallback to a
filename if there is no title in the document.

* lisp/org-refile.el (org-refile-use-outline-path): Add a new option
'title, see above.
2022-10-25 14:53:14 +08:00
Ihor Radchenko 9a3dd429bb
org-babel-import-elisp-from-file: Fix when \"s are not around
* lisp/ob-core.el (org-babel-string-read): Only considered \" at the
string boundaries, not inside.
* testing/lisp/test-ob-shell.el (ob-shell/results-table): Add a test.
2022-10-23 14:30:57 +08:00
Rudolf Adamkovič 524e0e0b7b
test-ob: Test indentation of multiline text in list output
* testing/lisp/test-ob.el (test-ob/org-babel-results-indented-list):
Add a regression test for the recent change to ob-core list formatting
in e700578799.
2022-10-22 12:30:21 +08:00
Ihor Radchenko a83edd624b
fixup! ob-shell: Fix multi-line scripts in sessions 2022-10-22 12:28:31 +08:00
Ihor Radchenko 801c93638a
ob-shell: Fix multi-line scripts in sessions
* lisp/ob-comint.el (org-babel-comint-with-output): Clean up empty
output.  Such output is emitted unnecessarily for multi-line scripts.
* lisp/ob-shell.el (org-babel-shell-set-prompt-commands): Disable
PS2 and equivalent prompts.  Make sure that PROMPT_COMMAND does not
interfere with PS1 setting in POSIX shells.
(org-babel-sh-evaluate): Do not send input line-by-line.  Instead, let
`org-babel-coming-with-output' handle waiting for the output as well
as recording it.  Update to the new `org-babel-coming-with-output'
behavior of cleaning empty outputs.
* testing/lisp/test-ob-shell.el (test-ob-shell/session): Add a test.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://list.orgmode.org/orgmode/m2r0zboix1.fsf@me.com/
2022-10-22 12:15:51 +08:00
Rudolf Adamkovič bed47b437d
test-ob-java: Test Java source block header arguments at all levels
* testing/lisp/test-ob-java.el (ob-java/lint-header-arguments):
Rename to ob-java/lint-header-args-block.

* testing/lisp/test-ob-java.el (ob-java/lint-header-args-heading):
Test source block header arguments at the heading level.

* testing/lisp/test-ob-java.el (ob-java/lint-header-args-buffer):
Test source block header arguments at the buffer level.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://orgmode.org/list/m2y1ta9rqe.fsf@me.com
2022-10-21 21:30:53 +08:00
Rudolf Adamkovič ee3dbb0fdb
ob-java: Define the list of all supported header arguments
* lisp/ob-java.el (org-babel-header-args:java): Complete the list of
header arguments supported for Java source blocks.
* testing/lisp/test-ob-java.el (ob-java/lint-header-arguments): Test
that the linter approves of all the supported arguments.
2022-10-21 11:43:19 +08:00
Bruno BARBIER 98cae03b7d
lisp/org-element: Add a parameters-line property to special blocks
Add a property `:parameters' to special blocks, to store the
PARAMETERS as a string.

* lisp/org-element.el (org-element-special-block-parser): Parse
PARAMETERS and set the property `:parameters'.

(org-element-special-block-interpreter): Interpret the property
`:parameters'.

*
testing/lisp/test-org-element.el (test-org-element/special-block-parser):
Add a new test for PARAMETERS.

(test-org-element/special-block-interpreter): Add new tests for PARAMETERS.
2022-10-20 17:39:55 +08:00
Bruno BARBIER 7d1e3dc38e
org-element-special-block-interpreter: Fix when no content
* lisp/org-element.el (org-element-special-block-interpreter): Use
empty string when content is nil.

*
testing/lisp/test-org-element.el (test-org-element/special-block-interpreter):
Test the case with no content.
2022-10-20 17:39:54 +08:00
Ihor Radchenko 4b9aef20d8
org-fold-hide-entry: Fix on empty heading with a child.
* lisp/org-fold.el (org-fold-hide-entry): Consider case when a child
heading is right at the next line below empty heading.
* testing/lisp/test-org-fold.el (test-org-fold/org-fold-hide-entry):
Add tests.

Reported-by: k_foreign@outlook.com
Link: https://orgmode.org/list/BY5PR10MB4289036F2436A909412E9D5096299@BY5PR10MB4289.namprd10.prod.outlook.com
2022-10-17 21:04:31 +08:00
Ihor Radchenko 5fa66c7ffc
org-latex-verse-block: Fix regression from 3f60acff7
* lisp/ox-latex.el (org-latex-verse-block): Fix logic replacing sole
paragraph breaks according to the new template.
* testing/lisp/test-ox-latex.el: New test file.
(org-test-with-exported-text): New macro for testing export.
(test-ox-latex/verse): New test.
* mk/default.mk (BTEST_RE): Select the new test by default.

Reported-by: Juan Manuel Macías <maciaschain@posteo.net>
Link: https://orgmode.org/list/875ygk6a8z.fsf@posteo.net
2022-10-16 11:17:03 +08:00
Max Nikulin 892df429f4
ox-latex: Use \empty instead of \relax after \\
* lisp/ox-latex.el (org-latex-line-break-safe, org-latex-table-row):
* testing/lisp/test-org-table.el (test-org-table/to-latex): Use \empty
instead of \relax to prevent interpreting following "*" and "[" as
optional parts of \\*[LENGTH] command.

Fix regression introduced by 3f60acff77. \\\relax\hline caused
misaligned \noalign error. Org markup:

    | a |
    |---|

\hline is allowed only immediately after \cr while \relax has some side
effects. Hope, \empty just expands to nothing.

Those who used \\ optional argument to adjust amount of space between
lines may add the following tricks:

    First,\\
    @@latex:{\vskip1em}@@second.

    | First                               |
    | @@latex:\noalign{\vskip1em}@@second |

Reported in
gerard.vermeulen, Wed, 12 Oct 2022 03:15:49 +0000.
https://list.orgmode.org/784cf8be450b7d676ddd60214cc847db@posteo.net
2022-10-14 10:27:14 +08:00
Ihor Radchenko 3e86487755
testing/lisp: Add missing `provide'
* testing/lisp/test-ob-sql.el (test-ob-sql):
* testing/lisp/test-ob-sqlite.el (test-ob-sqlite): Add missing provide
and use the correct file name in the comments.
2022-10-13 18:30:44 +08:00
Ihor Radchenko 08a1a91623
testing/lisp: Add missing `featurep' checks for required packages
* testing/lisp/test-ob-julia.el (featurep):
* testing/lisp/test-ob-ruby.el (featurep):
* testing/lisp/test-ob-scheme.el (featurep): Check for the required
external packages.
2022-10-13 18:30:07 +08:00
Ihor Radchenko 97672efdb0
testing/lisp/test-ob-eshell.el: Fix tests
* testing/lisp/test-ob-eshell.el (ob-eshell/execute):
(ob-eshell/variables-assignment): Do not expect
`org-babel-execute-src-block' to return the actual inserted src block
string.
2022-10-13 18:28:56 +08:00
Ihor Radchenko 4c0641837c
org-babel-script-escape: Turn empty lists into nil
* lisp/ob-core.el: Translate (), {}, and [] to nil.
* testing/lisp/test-ob.el (test-ob/script-escape): Add tests.

Reported-by: Jonas Bernoulli <jonas@bernoul.li>
Link: https://list.orgmode.org/87v8opfhk1.fsf@bernoul.li/T/#u
2022-10-12 19:46:14 +08:00
Liu Hui c57b030323
org-agenda: Make sure file restriction can be removed
* lisp/org-agenda.el: (org-agenda-restrict):
(org-agenda-restrict-begin):
(org-agenda-restrict-end):
(org-agenda-overriding-restriction): add docstrings.
(org-agenda):
(org-agenda-set-restriction-lock): Set `org-agenda-restrict' non-nil
during both temporary and extended file restriction.
(org-agenda-remove-restriction-lock): Revert commit df0e96ba4.
* testing/lisp/test-org-agenda.el (test-org-agenda/file-restriction):
Add a test.
2022-10-12 15:35:12 +08:00
Ihor Radchenko eb15341b3c
org-cycle-set-visibility-according-to-property: Do not change ancestor visibility
* lisp/org-cycle.el (org-cycle-set-visibility-according-to-property):
Do not unconditionally run `org-fold-reveal' for headlines with
"VISIBILITY" property.  `org-fold-reveal' can break the global
visibility and ancestor headline visibility settings.
*
testing/lisp/test-org-fold.el (test-org-fold/set-visibility-according-to-property):
Add test.

Reported-by: Eduardo Suarez <esuarez@itccanarias.org>
Link: https://orgmode.org/list/20220409202736.GA28127@itccanarias.org
2022-10-12 13:47:41 +08:00
Ihor Radchenko 3f60acff77
ox-latex: Protect [...] after \\ to be interpreted as LaTeX argument
* lisp/ox-latex.el (org-latex-linebreak-safe): New constant holding
safe version of LaTeX line break.
(org-latex-table-matrix-macros):
(org-latex-clock):
(org-latex-line-break):
(org-latex-plain-text):
(org-latex-planning):
(org-latex--org-table):
(org-latex--math-table):
(org-latex-table-row):
(org-latex-verse-block): Use the new constant.

* testing/lisp/test-org-table.el (test-org-table/to-latex): Update
tests.

Reported-by: Stewart Thomas <sjt015@bucknell.edu>
Link: https://orgmode.org/list/ce760fc3-5aae-144d-2d02-7dea215f73fc@gmail.com
2022-10-11 11:32:52 +08:00
Ihor Radchenko 8901fd2261
Add a regression test for `org-export-with-buffer-copy'
* testing/lisp/test-ox.el (test-org-export/org-export-copy-buffer):
Make sure that `org-export-with-buffer-copy' does not show up when
Emacs is searching for buffers associated with file.
2022-10-10 17:36:11 +08:00
Ihor Radchenko 31de027c12
test-ob-java: Use `temporary-file-directory'
* testing/lisp/test-ob-java.el (ob-java/simple-dir):
(ob-java/simple-dir-with-package): Prefer `temporary-file-directory'
over `org-babel-temporary-directory'.  The latter is nil in
noninteractive Emacs during tests.

Reported-by: Christian Köstlin <christian.koestlin@gmail.com>
2022-10-09 12:30:00 +08:00
Ihor Radchenko ba8fbd0cda
testing/lisp/test-ob-java.el: Add missing `provide' 2022-10-09 12:13:30 +08:00
Ihor Radchenko 3de74bbeff
fixup! org-export-copy-buffer: Prevent saving to disk
* lisp/ox.el (org-export--generate-copy-script): Set
`write-contents-functions' after running `major-mode'.
* testing/lisp/test-ox.el (test-org-export/org-export-copy-buffer):
Add test.
2022-10-07 17:46:15 +08:00
Nicholas Vollmer 7f3a6cf6e7
org-capture: Add template hook properties
* lisp/org-capture.el (org-capture-templates): Document template hook properties.
(org-capture-finalize): Execute :prepare/:before/:after-finalize functions.
(org-capture-place-template): Execute :hook functions.

* doc/org-manual.org: Document template hook properties.

* etc/ORG-NEWS: Add news entry for template hook properties.

* testing/lisp/test-org-capture.el: Add tests for template hook properties.
2022-10-07 13:38:52 +08:00
Rudolf Adamkovič 48ac65bea0
ob-sed-test: Make the tests pass on BSD systems, such as macOS
* testing/examples/ob-sed-test.org: Fix BSD sed incompatibility
2022-10-07 12:10:20 +08:00
Jonas Bernoulli 9b690462a3
Allow returning empty list from post-processing block
* lisp/ob-ref.el (org-babel-ref-resolve): When the result an empty
list, then treat it as a list, not as the symbol nil.
* testing/lisp/test-ob.el (test-ob/post-header-arguments): Add new
test.
* etc/ORG-NEWS (Post-processing code blocks can return an empty list):
Document change in behavior.
2022-10-07 12:06:30 +08:00
Liu Hui edf5afc1d8
Fix filter preset problem for sticky agenda
* lisp/org-agenda.el (org-agenda-local-vars):
(org-agenda-filters-preset): Add a new variable
`org-agenda-filters-preset' for storing per-buffer filter presets.
(org-agenda):
(org-agenda-filter-any):
(org-agenda-prepare):
(org-agenda-finalize):
(org-agenda-redo):
(org-agenda-filter-by-tag):
(org-agenda-filter-make-matcher):
(org-agenda-set-mode-name):
(org-agenda-reapply-filters): Use `org-agenda-filters-preset' for
getting and setting per-buffer filter presets, rather than modifying
the global symbol property.  Change `org-lprops' from symbol property
to per-buffer text property.  Delete unused `last-args' symbol
property.
* testing/lisp/test-org-agenda.el (test-org-agenda/sticky-agenda-filter-preset):
(test-org-agenda/redo-setting): Add tests.
2022-10-07 11:43:32 +08:00
Ihor Radchenko 506d5b12dd
org-comment-line-break-function: Avoid built-in Emacs comment machinery
* lisp/org.el (org-comment-line-break-function): Rely on Org
parser (`org-adaptive-fill-function') to determine comment filling.
Handle nil values of `fill-prefix' correctly.

* testing/lisp/test-org.el (test-org/default-indent-new-line): New
test.  Written by Kaushal Modi <kaushal.modi@gmail.com>
https://list.orgmode.org/CAFyQvY36DkBSNy2mPxDNZWeoTjUK8mAqgJM-zHxNamfReqGkuQ@mail.gmail.com/

Reported-by: Richard Lawrence <richard.lawrence@uni-tuebingen.de>
Link: https://list.orgmode.org/87lf18fue9.fsf@aquinas.i-did-not-set--mail-host-address--so-tickle-me/
2022-10-04 19:47:11 +08:00