* lisp/org-macs.el (org-compile-file, org-compile-file-commands):
Pull out the logic transforming process descriptions to commands to be
executed into a new function, `org-compile-file-commands'.
`org-compile-file' is now solely concerned with running the commands and
reporting the result.
* lisp/org-persist.el (org-persist--write-elisp-file,
org-persist--read-elisp-file): Instead of letting `find-auto-coding' be
invoked to determine the coding for org-persist cache files (which can
be surprisingly expensive), we simply set utf-8 coding when
reading/writing.
* lisp/org-persist.el (org-persist--write-elisp-file): For the reasons
mentioned in the large code comment, it simply does not make much sense
to use fsync when writing cache files.
The value of fsync in general on modern hardware seems questionable,
particularly with CoW filesystems which take care of the problem better
than it seems fsync ever could.
* doc/org-manual.org (Include Files): Mention that block names starting
with ":" will need to be quoted, and reformat the paragraph for clarity
while editing the mention of block name.
* lisp/ox.el (org-export-parse-include-value): Adjust the block matches
not to match keywords (i.e. ":\S-+"), and both block and env to consume
their matches in value. Now value only contains the unmatched content,
which is given in as the results plist as :unmatched.
* lisp/ox.el (org-export-expand-include-keyword): Split the parsing and
inclusion logic of the ~150 line `org-export-expand-include-keyword'
into two new functions: `org-export-parse-include-value' and
`org-export--blindly-expand-include'.
* doc/org-manual.org (Bibliography options in the "biblatex" and "csl"
export processors): In some example Org content, the "+" in the keyword
prefix "#+" was missing.
* lisp/org-element.el (org-element--cache-sync): Add new optional
argument FORCE to force cache synchronization even when
`org-element--cache-active-p' returns non-nil. Update commentary
explaining why `org-element--cache-active-p' needs to be checked.
(org-element--cache-submit-request): Force cache synchronization. We
are safe to force it as all the callers of
`org-element--cache-submit-request' do check that cache is active.
This fixes an edge case when Org buffer has transient indirect buffers
with `after-change-functions' not being setup. If a change happens in
the main Org buffer, `org-element--cache-after-change' gets called and
cache request is processed even though (org-element--cache-active-p),
but not (org-element--cache-active-p t), returns nil (due to the
indirect buffer).
Before this commit, `org-element--cache-submit-request' called by
`org-element--cache-after-change' missed cache synchronization, as
`org-element--cache-sync' did nothing. As a result, if the indirect
buffer would get deleted, we would end up with incorrect cache state.
Reported-by: Gregor Zattler <telegraph@gmx.net>
* lisp/org-capture.el (org-capture-finalize): Do not save the newly
created file buffer when the capture is aborted and org-capture is not
asked to save upon capture.
* testing/lisp/test-org-capture.el (test-org-capture/abort): Add test.
* org-datetree.el (org-datetree--find-create): Add optional argument
MATCH-TITLE that controls whether to match REGEX-TEMPLATE against
heading title inside complex heading or to match REGEX-TEMPLATE
against the whole heading line.
* org-datetree.el (org-datetree--find-create-group,
org-datetree-find-iso-week-create): Allow finding a datetree with TODO
state, priority, tags, statistics cookies, or COMMENT keyword.
* testing/lisp/test-org-datetree.el
(test-org-datetree/find-date-create,
test-org-datetree/find-iso-week-create): Add tests for a datetree with
tags, TODO or priority keywords.
* etc/ORG-NEWS (Datetree structure headlines can now be complex):
Document the change.
* doc/org-manual.org: Update datetree definition.
* etc/ORG-NEWS: Announce the introduction of the new face
`org-agenda-calendar-daterange'.
* lisp/org-faces.el: Define the face `org-agenda-calendar-daterange'.
* lisp/org-agenda.el (org-agenda-get-blocks): Apply the face
`org-agenda-calendar-daterange' to entries with a date range.
* lisp/org.el (org-notes-order-reversed-p): Return value is
org-reverse-note-order if it is neither nil or a list.
E.g. before nil has been returned when org-reverse-note-order was a
symbol. And this did not meet the documentation of
org-reverse-note-order.
* lisp/org.el (org-paste-subtree): Remove the whole line when level
indicator is provided. Improve check for level indicator.
* testing/lisp/test-org.el (test-org/paste-subtree): Add test.
Reported-by: Philipp Kiefer <phil.kiefer@gmail.com>
Link: https://orgmode.org/list/a2cc49d3-7f65-5f6a-8f05-21e5056335b3@gmail.com
* lisp/org-table.el (org-table-blank-field):
(org-table-clean-line): Avoid `org-string-width' modifying match data.
As long as `org-string-width' creates a new window buffer, third-party
modes and Emacs distributions might modify the match data in buffer
hooks. Hence, we cannot assume that match data is not modified even
though `org-string-width' code itself does not alter the match data.
Note: Adding `save-match-data' around function calls is generally a
good practice when the surrounding code relies on the match data being
intact. Elisp conventions don't prohibit functions to modify match
data without notice in their docstring.
Reported-by: Thomas Schneider <qsx@chaotikum.eu>
Link: https://orgmode.org/list/wwufsc7edzu.fsf@chaotikum.eu
* lisp/ob-core.el (org-babel-temporary-stable-directory): Use
`temporary-file-directory' variable instead of function. The function
returns value depending on the `default-directory' at Org startup time
thus creating unpredictable temporary babel locations that may
sometimes litter current directory.
Reported-by: bhrgunatha <bhrgunatha@gmail.com>
Link: https://orgmode.org/list/93b040e1-6dc6-487f-de89-a4cea9a560ff@gmail.com
Load org-element for agenda instead of relying on org-element being
loaded when agenda is ran.
Reported-by: zimoun <zimon.toutoune@gmail.com>
Link: https://orgmode.org/list/86r0vszn3w.fsf@gmail.com
* lisp/ox.el (org-export-expand-include-keyword): Add new optional
argument INCLUDER-FILE to explicitly pass the includer file path when
expanding inside a temporary buffer. Pass the INCLUDER-FILE later
during recursive expansion.
Reported-by: Gabriel Petrini da Silveira <gpetrinidasilveira@gmail.com>
Link: https://orgmode.org/list/CAHCA-UvaqnegPYfpPcJCqiY8+dDoj0pfX0vDckUui-MCj3wq5A@mail.gmail.com
* doc/org-manual.org (Weekly/daily agenda):
* lisp/org-agenda.el (org-agenda-start-on-weekday):
(org-agenda-start-day): Document that `org-agenda-start-on-weekday'
takes precedence over `org-agenda-start-day' when agenda span is 7 or
14 days.
Reported-by: Eppo Math <eppolito.math@gmail.com>
Link: https://orgmode.org/list/878ri67plt.fsf@localhost
* lisp/org-fold-core.el (org-fold-core--isearch-show): Make sure that
the actual isearch match is revealed. This relies on undocumented
behavior of isearch that point is at the match when
'isearch-open-invisible is called.
(org-fold-core-region): Disable 'isearch-open-invisible-temporary
features when `org-fold-core-style' is 'overlays. This is to work
around the undocumented requirement of isearch to _not_ delete the
overlay passed to 'isearch-open-invisible-temporary function. Since
`org-fold-show-set-visibility' may destroy overlays arbitrarily, we
cannot currently support isearch `org-fold-show-context-detail' in
full.
Reported-by: Matt Lundin <mdl@imapmail.org>
Link: https://orgmode.org/list/87zgb6tk6h.fsf@localhost
* lisp/org.el (org-timestamp-change): Add FIXME comment to
re-implement the logic in future to avoid `save-excursion' markers
being moved to the end of timestamp.
* lisp/ob-shell.el (org-babel-shell-initialize): Refactor avoiding
`eval' runtime calls and assigning 'definition-name function symbol
property to assist Emacs help system with finding the definition.
Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60568#71
> One of the discussed features was displaying function source code right
> in *Help* buffers. This feature usefulness have been objected at that
> time, on the grounds that showing function code may be too long and
> cause large *Help* buffers.
FWIW, I find myself regularly jumping to `M-x ielm` to look at the
`symbol-function`, so I would actually appreciate a button in the *Help*
buffer to display the actual value in the `symbol-function` slot.
This would also bring `describe-function` a bit closer to
`describe-variable`, which I think is good.
> 1. emacs -Q
> 2. M-: (require 'ob-shell)
> 3. <F1> f org-babel-execute:sh <RET>
> 4. Click on the source code link in *Help* buffer
> 5. Observe point jumping to (point-min) with no obvious way to find the
> function definition.
We have `definition-name` for that.
I.e. `org-babel-shell-initialize` should arguably do
(put 'org-babel-execute:sh 'definition-name 'org-babel-shell-initialize)
so that step 4 above jumps to `org-babel-shell-initialize`.
The patch below does that, along with saving some kittens.
Stefan
* lisp/org-refile.el (org-refile): Use dedicated marker (move after
insertion) to store position of the heading being refiled. Otherwise,
if refiled heading is inserted at the same point, `save-excursion'
would restore point before the inserted heading instead of keeping it
at the original heading.
* testing/lisp/test-org.el (test-org/refile): At test.
Reported-by: /u/madclassix
* lisp/org-element.el (org-element-fixed-width-interpreter): Interpret
fixed-width element with :value "" as ":\n", not as empty string.
* testing/lisp/test-org-element.el (test-org-element/fixed-width-interpreter):
Fixed the test.
The previous test, albeit intentionally asserting "" result, breaks
reversibility of parse-interpret sequence.
* testing/lisp/test-ob-shell.el:
- Give instructions on how to run tests
- Require `org-test' explicitly
- Group tests into sections
- Insert `page-delimiter's between sections
* testing/examples/ob-shell-test.org: Delete file
File was used by test-ob-shell.el to test ob-shell.el. Tests have
been updated to use temporary buffers, rendering ob-shell-test.org
unnecessary.
* testing/lisp/test-ob-shell.el:
(ob-shell/generic-uses-no-arrays): Rename test from
`ob-shell/generic-uses-no-arrays' to
`test-ob-shell/generic-uses-no-arrays'.
(ob-shell/generic-uses-no-arrays): Move comments from
testing/examples/ob-shell-test.org to docstring.
(ob-shell/generic-uses-no-arrays): Remove dependency on
testing/examples/ob-shell-test.org.
(ob-shell/bash-uses-arrays): Rename `ob-shell/bash-uses-arrays' to
`test-ob-shell/bash-uses-arrays'.
(ob-shell/bash-uses-arrays): Move comments from
testing/examples/ob-shell-test.org to docstring.
(ob-shell/bash-uses-arrays): Remove dependency on
testing/examples/ob-shell-test.org.
(ob-shell/simple-list): Change test name from `ob-shell/simple-list'
to `test-ob-shell/simple-list'.
(ob-shell/remote-with-stdin-or-cmdline): Change test name from
`ob-shell/remote-with-stdin-or-cmdline' to
`test-ob-shell/remote-with-stdin-or-cmdline'.
(ob-shell/remote-with-stdin-or-cmdline): On pass, kill buffer created
by test.
(ob-shell/results-table): Rename `ob-shell/results-table' to
`test-ob-shell/results-table'.
(ob-shell/results-list): Rename `ob-shell/results-list' to
`test-ob-shell/results-list'.
(ob-shell/standard-output-after-success): Rename
`ob-shell/standard-output-after-success' to
`test-ob-shell/standard-output-after-success'.
(ob-shell/standard-output-after-failure): Rename
`ob-shell/standard-output-after-failure' to
`test-ob-shell/standard-output-after-failure'.
(ob-shell/standard-output-after-failure): On pass, kill buffer created
during test.
(ob-shell/error-output-after-success): Rename
`ob-shell/error-output-after-success' to
`test-ob-shell/error-output-after-success'.
(ob-shell/error-output-after-success): On pass, kill buffer created by
test.
(ob-shell/error-output-after-failure): Rename
`ob-shell/error-output-after-failure' to
`test-ob-shell/error-output-after-failure'.
(ob-shell/error-output-after-failure): On pass, kill buffer created by
test.
(ob-shell/error-output-after-failure-multiple): Rename
`ob-shell/error-output-after-failure-multiple' to
`test-ob-shell/error-output-after-failure-multiple'.
(ob-shell/error-output-after-failure-multiple): On pass, kill buffer
created by test.
(ob-shell/exit-code): Rename `ob-shell/exit-code' to
`test-ob-shell/exit-code'.
(ob-shell/exit-code): On pass, kill buffer created by test.
(ob-shell/exit-code-multiple): Rename `ob-shell/exit-code-multiple' to
`test-ob-shell/exit-code-multiple'.
(ob-shell/exit-code-multiple): On pass, kill buffer created by test.
* testing/lisp/test-ob-shell.el (ob-shell/bash-uses-assoc-arrays):
Split test cases into separate tests,
`test-ob-shell/bash-uses-assoc-arrays' and
`test-ob-shell/bash-uses-assoc-arrays-with-lists'. Rename prefix from
"ob-shell" to "test-ob-shell".
(ob-shell/bash-uses-assoc-arrays): Move comments from
testing/examples/ob-shell-test.org to docstrings.
(ob-shell/bash-uses-assoc-arrays): Remove dependency on
testing/examples/ob-shell-test.org.