* lisp/ox-texinfo.el (org-texinfo--match-definition): Consider :tag
being an anonymous node with multiple markup nodes. Convert it to
plain Texinfo beforehand, so that it is available as a plain text.
Add new optional argument INFO to be able to run Org AST for :tag ->
Texinfo text conversion.
(org-texinfo--separate-definitions): Pass INFO to
`org-texinfo--match-definition'.
* testing/lisp/test-ox-texinfo.el (test-ox-texinfo/definition): New
test case.
Reported-by: 8dcc <8dcc.git@gmail.com>
Link: https://orgmode.org/list/87wmi09tdx.fsf@gmail.com
* lisp/ox-texinfo.el (org-texinfo--sanitize-content): Sanitize commas
everywhere to make sure that we do not end up with text commas being
interpreted as argument separator in @command{arg1, arg2, ...}. This
approach will produce @comma{} even when it is not necessary, but it
is the safest approach.
(org-texinfo-plain-text): Update the comment.
* testing/lisp/test-ox-texinfo.el (test-ox-texinfo/escape-special-characters):
New test.
Reported-by: 8dcc <8dcc.git@gmail.com>
Link: https://orgmode.org/list/87set58skp.fsf@gmail.com
* lisp/ox-texinfo.el (org-texinfo--split-definition): Do not store
definition options as :attr_texinfo read by
`org-export-read-attribute'. `org-export-read-attribute' is incapable
of reading literal nil. Instead, store the options literally, as is,
in a special non-standard syntax node property.
(org-texinfo-special-block): Make use of syntax node property used by
`org-texinfo--split-definition', when present.
* testing/lisp/test-ox-texinfo.el (test-ox-texinfo/definition): New
test.
Reported-by: 8dcc <8dcc.git@gmail.com>
Link: https://orgmode.org/list/87plo98a8g.fsf@gmail.com
* lisp/org-footnote.el (org-footnote--allow-reference-p): New optional
argument indicating that the footnote reference is going to be
anonymous/inline. It is then allowed to be at bol.
(org-footnote-new): Check whether a footnote reference can be inserted
in place taking into account the footnote type.
* testing/lisp/test-org-footnote.el (test-org-footnote/new): New test
cases.
Reported-by: Suhail Singh <suhailsingh247@gmail.com>
Link: https://orgmode.org/list/877carzufa.fsf@gmail.com
* lisp/ox-icalendar.el (org-icalendar-entry): Include timestamps of
type diary when `:with-timestamps' is `active'.
* lisp/ox.el (org-export--skip-p): Include timestamps of type diary
when `:with-timestamps' is `active'.
*
testing/lisp/test-ox-icalendar.el (test-ox-icalendar/diary-timestamp):
Unit test for exporting timestamps of type diary.
* testing/lisp/test-ox-publish.el (org-test-publish): Add optional
arguments `timestamp-flag' and `pubdir' for control over existing
local variables, add optional argument `keep-pubdir-p' for conditional
deletion of publication directory.
(org-test-publish-touch): New function to change modification time of
file.
(test-org-publish/publish-cache): New function with tests.
* testing/examples/pub-cache/source.org:
* testing/examples/pub-cache/config.org: New example files.
* etc/ORG-NEWS (Texinfo exporter now supports links in headings):
Announce the new feature.
* lisp/ox-texinfo.el: (org-texinfo--format-entries,
org-texinfo--get-node, org-texinfo--sanitize-title-reference,
org-texinfo--sanitize-title): A 2-step change: (1) Rename
`--sanitize-title' to `--sanitize-title-reference' and (2) create a
new `--sanitize-title' sanitation function. The new function is less
strict in that does not remove links, which should be allowed in
sectioning commands, such as `@unnumbered'. The old function remains
more strict, which is useful for generating `@node' names, for
example.
* testing/lisp/test-ox-texinfo.el:
(test-ox-texinfo/headings-with-links): Test the new functionality to
avoid regressions in the future.
* lisp/ox-texinfo.el (org-texinfo--@ref): Fix an incorrect assumption
that Texinfo uses node names for automatic link text. It does not.
Instead, it uses the corresponding section title. For example, if a
node is named `a' its section is named `A', the Org link to the node
`a' written as `[[...][xxx]]' ends up being rendered as "A", which
means the link description the Org user provided is ignored.
* lisp/org-colview.el (org-columns-compile-format): Refactor
string-based regexp to `rx' form. Fix regexp: When an empty
parentheses () is in the column format string then the regexp
can't capture the operator which is in curly brackets {}.
(org-columns-new): prevent adding empty parantheses '()' to 'column
format string' when 'column title' is empty.
* testing/lisp.test-org-colview.el (test-org-colview/compile-format):
New test case: check if operator will be captured when there is
empty parantheses '()' in 'column format string'.
Reported-by: Sławomir Grochowski <slawomir.grochowski@gmail.com>
Link: https://list.orgmode.org/orgmode/877ccczt83.fsf@gmail.com/
* lisp/ob-core.el (org-babel-demarcate-block): Keep case in
#+BEGIN_SRC and #+END_SRC keywords splitting src block.
* testing/lisp/test-ob.el (test-ob/keep-case): New test.
Reported-by: Rudolf Adamkovič <rudolf@adamkovic.org>
Link: https://orgmode.org/list/m2y152f8s3.fsf@adamkovic.org
* lisp/org-table.el (orgtbl--skip):
(orgtbl--skipcols): New helper functions.
(orgtbl-to-generic): Use `org-export-as' machinery to setup table
export instead of duplicating ox.el internals. Retain special rows in
tables when exporting to Org. Org export is used by ob-core to format
the code block output and will thus retain special rows.
* testing/lisp/test-org-table.el (test-org-table/to-generic): Adjust
test to expect special rows to be exported.
* etc/ORG-NEWS (~orgtbl-to-generic~ retains special rows when
exporting to Org): Announce the breaking change.
Reported-by: Rudolf Adamkovič <rudolf@adamkovic.org>
Link: https://orgmode.org/list/87r0ch6q9h.fsf@localhost
* lisp/org-list.el (org-list-struct-apply-struct): Make sure that we
never shift item contents to or before the item indentation.
* testing/lisp/test-org-list.el (test-org-list/cycle-bullet): Add new
test.
Reported-by: vitalij@gmx.com
Link: https://orgmode.org/list/871q42qbn7.fsf@gmx.com
* lisp/ox-html.el (org-html-head):
(org-html-head-extra): Allow value to be a function.
(org-html-normalize-string-or-function): New helper function.
(org-html--build-head): Use the new helper to handle the function
value of :html-head and :html-head-extra export options.
* etc/ORG-NEWS:
(~org-html-head~ and ~org-html-head-extra~ can now be specified as
functions): Document the new feature.
* testing/lisp/test-ox-html.el (ox-html/test-normalize-string-or-function):
New test.
TINYCHANGE
* lisp/ob-shell.el (org-babel-sh-evaluate): When running src block as
script file, make sure that shebang is always added on top. This is
to prevent <shell> <script> command in shells like dash form using
/bin/sh to evaluate scripts without shebang. (In contrast with bash
that uses itself). Add comment highlighting that
`with-connetion-local-variables' sets `shell-file-name' and
`shell-command-switch' as necessary.
*
testing/lisp/test-ob-shell.el (test-ob-shell/remote-with-stdin-or-cmdline):
Add new test.
Reported-by: Max Nikulin <manikulin@gmail.com>
Link: https://list.orgmode.org/orgmode/v0an63$3n2$1@ciao.gmane.io/
* lisp/ob-shell.el (org-babel-sh-evaluate): When invoking script file
generated from the code block, consistently use
<shell-name> -c <script-file> <cmdline-args> command line, even when
:shebang is header argument is provided. The previous approach with
<script-file> <cmdline-args> call caused differences in how shell
parsed the provided command line arguments.
* testing/lisp/test-ob-shell.el (test-ob-shell/cmdline): New test.
Reported-by: Max Nikulin <manikulin@gmail.com>
Link: https://orgmode.org/list/18f01342a2f.124ad27612732529.8693431365849276517@excalamus.com
* doc/org-manual.org: Add target spec format for function and symbol
for headline and olp.
* etc/ORG-NEWS: Announce the updated options for
`org-capture-templates'.
* lisp/org-capture.el (org-capture-templates): Update customization
type for `file+headline', `file+olp', and `file+olp+datetree' targets,
and update docstring.
(org-capture-expand-headline): Define a new function that computes
headline string from target spec.
(org-capture-expand-olp): Define a new function that computes olp list
from target spec.
(org-capture-set-target-location): Use `org-capture-expand-headline'
to expand headline, and use `org-capture-expand-olp' to expand outline
path.
* testing/lisp/test-org-capture.el (test-org-capture/entry): Add tests
for at most three different kinds of target for `file+headline',
`file+olp', and `file+olp+datetree'.
(test-org-capture/org-capture-expand-olp): Add tests for
`org-capture-expand-olp'.
(featurep 'org) is always non-nil here since we have a (require 'org)
further up. I suspect other `require's nearby could be removed or
moved to toplevel.
* lisp/ob-lua.el (org-babel-execute:lua):
(org-babel-prep-session:lua):
(org-babel-load-session:lua):
(org-babel-lua-session-buffer):
(org-babel-lua-with-earmuffs):
(org-babel-session-buffer:lua):
(org-babel-lua-without-earmuffs):
(lua-default-interpreter):
(lua-which-bufname):
(lua-shell-buffer-name):
(org-babel-lua-initiate-session-by-key):
(org-babel-lua-initiate-session):
(org-babel-lua-evaluate):
(org-babel-lua-evaluate-external-process):
(org-babel-lua-evaluate-session):
(org-babel-lua-read-string): Remove all unfinished Lua and Emacs Lisp
code related to sessions and emit a user error when a Lua session is
requested.
* testing/lisp/test-ob-lua.el (test-ob-lua/no-sessions): Test the user
error emitted when requesting a Lua session.
Link: https://list.orgmode.org/87y192etb4.fsf@localhost/
* lisp/ob-lua.el (org-babel-lua-wrapper-method): Escape all double
quote characters in Lua before giving them to Org Babel.
* testing/lisp/test-ob-lua.el (test-ob-lua/escaping-quotes): Test
automatic escaping of double quote characters.
Reported-by: Max Nikulin <manikulin@gmail.com>
Link: https://list.orgmode.org/216278dc-075c-47d1-94dc-f5bde8346b3c@gmail.com/
* lisp/ox.el (org-export--set-variables): Assume that variables are
listed as (var value) - as a list. Only use the second element of the
list as the value, following example in `org-export-get-environment'.
(org-export-get-environment): Use `org-export--set-variables'.
* testing/lisp/test-ox.el (test-org-export/bind-keyword): Add new
test.
Reported-by: Suhail Singh <suhailsingh247@gmail.com>
Link: https://orgmode.org/list/87cyonhuq3.fsf@gmail.com
* lisp/org-agenda.el (org-agenda-get-blocks): Force
`org-agenda-default-appointment-duration' to be nil for time blocks -
they already have begin/end time, even if during different days.
* testing/examples/agenda-file2.org (five):
* testing/lisp/test-org-agenda.el (test-org-agenda/time-grid): New
test.
Reported-by: hrdl <git@hrdl.eu>
Link: https://orgmode.org/list/ZldNYYtvvQp0dILB@t490.localdomain
* lisp/ob-exp.el (org-babel-exp-code): Do not use resolved argument
values when formatting the code block. Resolved argument values may
contain awkward data like full (long) table contents, various Elisp
data (including non-printable), etc. Simply using verbatim src block
parameters as they appear in the original buffer is more reliable.
(org-babel-exp-inline-code-template):
(org-babel-exp-code-template): Update docstrings, drop %flags
placeholder, which is no longer supported using the current src block
syntax.
* etc/ORG-NEWS (=ox-org= preserves header arguments in src blocks):
Drop "non-default" when explaining how header arguments are formatted.
We cannot know which values are default and which not without
resolving the values - something we cannot do as it turned out.
* testing/lisp/test-ob-exp.el (ob-exp/exports-inline-code):
(ob-export/export-src-block-with-flags):
(ob-export/body-with-coderef): Update the tests.
* lisp/org-capture.el (org-capture-place-table-line): Prepend
table-line begin ('|') if the template does not start with it.
* testing/lisp/test-org-capture.el (test-org-capture/table-line):
Verify that a template gets prepended with a '|' if it does not start
with it.
* lisp/org-capture.el (org-capture-place-entry): Prepend heading to
template if the template does not yet start with a heading.
* testing/lisp/test-org-capture.el (test-org-capture/entry): Add two
tests: no error is raised when org-capture is called with a template
that does not start with a heading; and org-capture should error with
a template with a lower heading after a higher heading.
Link: https://list.orgmode.org/877chnc0lr.fsf@localhost/
* testing/org-test.el (org-test-day-of-weeks-seconds): Specify seconds
for formatting with UTC as time zone.
(org-test-day-of-weeks-abbrev):
(org-test-day-of-weeks-full): Use UTC as time zone when formatting
input.
Avoid calling format-time-string with the local time zone because that
gives the wrong result in some cases. For example, 2222222 is
supposed to produce the locale's name for "Tuesday" but, when the
local time zone is +0000, (format-time-string "%A" 2222222) returns
the locale's name for "Monday".
* testing/lisp/test-org.el (test-org/thing-at-point/url): Disable test
in old Emacs that do not yet support custom
`thing-at-point-provider-alist'.
* etc/ORG-NEWS (Org links now support ~thing-at-point~): Clarify Emacs
versions where the new feature is supported.
* lisp/org.el (thingatpt): Require.
(org--link-at-point, org--bounds-of-link-at-point): New functions...
(org-mode): ... add to 'thing-at-point-provider-alist' and friends.
* testing/lisp/test-org.el (test-org/thing-at-point/url): New test.
* etc/ORG-NEWS: Announce this change.
* lisp/org-table.el (org-table-eval-formula): Use more strict regexp
to detect mode string in formulas.
* testing/lisp/test-org-table.el (test-org-table/eval-formula): Add
test.
Reported-by: Nick Dokos <ndokos@gmail.com>
Link: https://orgmode.org/list/87ply5v1gj.fsf@localhost
* lisp/ox.el (org-export--keep-spaces): New helper function containing
logic about keeping spaces in place of removed object from
`org-export--prune-tree'. The logic is modified to keep spaces in the
case when previous plain-string object ends with a whitespace, but not
" " or "\t". This can happen, for example, when there is a trailing
zero-width space. We do want to keep spaces in such scenario.
(org-export-data): When transcoder returns nil, handle
trailing spaces after an object the same way `org-export--prune-tree'
does. Remove special handling of export snippets that unconditionally
keep their trailing spaces.
(org-export--prune-tree): Use the helper function.
* testing/lisp/test-ox.el (test-org-export/export-snippet): Adjust test.
Link: https://orgmode.org/list/87h6fwmgkm.fsf@localhost
* lisp/org-table.el (org-table-make-reference): Drop branch of `if'
unused during runtime. This preserves _interactive_ behavior.
* testing/lisp/test-org-table.el (test-org-table/org-table-make-reference/mode-string-none):
(test-org-table/org-table-make-reference/mode-string-N): Fix tests to
check for the existing _interactive_ behavior. When running make
test (eq "" "") happens to return t and tests were passing previously
by accident despite actual behavior during user session being
different. Fix the tests to avoid breaking changes in the user
experience.
Link: https://list.orgmode.org/orgmode/20230827214320.46754-1-salutis@me.com/
* testing/lisp/test-org-macro.el (test-org-macro/initialize-templates):
A new test that no code is evaluated when an Org file is opened
(CVE-2024-30202).
Ihor Radchenko [ANN] Emergency bugfix release: Org mode 9.6.23.
Sun, 24 Mar 2024 17:16:50 +0000.
<https://list.orgmode.org/871q7zbldp.fsf@localhost>
* lisp/ox-md.el (org-md-item): Always put at least one space after
item number.
* testing/lisp/test-ox-md.el (ox-md/item): New test.
Reported-by: Bastien <bzg@gnu.org>
Link: https://orgmode.org/list/87wmo8qll7.fsf@gnu.org