Commit Graph

26906 Commits

Author SHA1 Message Date
Ihor Radchenko 92b69d4331
* lisp/ob-java.el: Add support for :prologue/:epilogue parameters
(org-babel-expand-body:java):
2023-10-19 12:01:03 +03:00
Ihor Radchenko 67bd4b0a36
* lisp/ob-fortran.el: Add support for :prologue/:epilogue parameters
(org-babel-expand-body:fortran):
2023-10-19 12:01:00 +03:00
Ihor Radchenko 936290fe18
* lisp/ob-emacs-lisp.el: Add support for :prologue/:epilogue parameters
(org-babel-expand-body:emacs-lisp):
2023-10-19 12:00:55 +03:00
Ihor Radchenko 3bffa96448
* lisp/ob-dot.el: Add support for :prologue/:epilogue parameters
(org-babel-expand-body:dot):
2023-10-19 12:00:46 +03:00
Ihor Radchenko be59f11435
* lisp/ob-calc.el: Add support for :prologue/:epilogue parameters
(org-babel-expand-body:calc):
2023-10-19 12:00:37 +03:00
Ihor Radchenko 1f0eaefa52
* lisp/ob-awk.el: Add support for :prologue/:epilogue parameters
(org-babel-expand-body:awk):
2023-10-19 12:00:28 +03:00
Ihor Radchenko 312deaa13a
* lisp/ob-C.el: Add support for :prologue/:epilogue parameters
(org-babel-C-expand-C):
2023-10-19 12:00:18 +03:00
Ihor Radchenko b3c8a7c360
* lisp/org-element.el (org-element-entity-parser): Add comment 2023-10-19 11:17:58 +03:00
Ihor Radchenko e34d7781f0
org-element-entity-parser: Refactor entity regexp using `rx'
* lisp/org-element.el (org-element-entity-parser): Rewrite entity
regexp using more readable `rx' form.
* testing/lisp/test-org-element.el (test-org-element/entity-parser):
Add new test cases for whitespace entities.
2023-10-19 11:15:45 +03:00
Ihor Radchenko 627097c7d3
* lisp/ol.el (org-link-complete-file): Document the function argument 2023-10-18 13:47:49 +03:00
Ihor Radchenko 8320e4794e
org-entry-get-with-inheritance: Fix inherited explicit nil value
* lisp/org.el (org-entry-get-with-inheritance): Do not ignore when
property has explicit "nil" value.
* testing/lisp/test-org.el (test-org/entry-get): Add test.
2023-10-18 11:37:13 +03:00
Ihor Radchenko 4f8c9f5ac5
* lisp/ol-man.el (org-man-export): Document all the function arguments
Rename FORMAT to more accurate BACKEND.
2023-10-17 14:00:01 +03:00
Ihor Radchenko b223a3cc75
org-num: Allow property inheritance for UNNUMBERED property
* lisp/org-num.el (org-num--skip-value): Honour property inheritance.
* etc/ORG-NEWS (=UNNUMBERED= property inheritance is now honored by
~org-num-mode~): Document the change.

Link: https://orgmode.org/list/249cd3af-c173-5ff2-df27-c32af3886329@gmail.com
2023-10-17 13:01:25 +03:00
Ihor Radchenko 24a0e7f8df
* lisp/ob-python.el: Fix misspelled constant name
(org-babel-default-header-args:python):
(org-babel-header-args:python): Rename.
`org-babel-header-args:python' is the correct name for extra
language-specific allowed header arguments.
2023-10-17 11:13:59 +03:00
Ihor Radchenko 9bbc21df84
Merge branch 'bugfix' 2023-10-16 16:05:05 +03:00
hrdl f5e41b4724
org-babel-result-names: Do not alter window configuration
* lisp/ob-core.el (org-babel-result-names): Do not change
  visibility of windows when called.

TINYCHANGE
2023-10-16 16:04:27 +03:00
Ihor Radchenko 678af9d502
test-org/auto-repeat-maybe: Fix Emacs <28 compatibility
* testing/lisp/test-org.el (test-org/auto-repeat-maybe): Do not use
`string-search', which is not yet available in Emacs <28.
2023-10-16 13:24:24 +03:00
Ihor Radchenko 16548593eb
* lisp/org-clock.el (org-clock-clocked-in-display): Fix docstring format
Make sure that the docstring has a single sentence as its first line.
2023-10-16 12:18:43 +03:00
Valentin Herrmann 23f751910e
org.el: Respect org-extend-today-until in timestamps with ++
* org.el (org-auto-repeat-maybe): Changed org-auto-repeat-maybe, so that
switching a repeating todo with a timestamp of the form <… ++…> respects
`org-extend-today-until'.
* test-org.el (test-org/auto-repeat-maybe, org-test-with-time-locale):
Tests for interaction of `org-extend-today-until' and
`org-auto-repeat-maybe'. Added `org-test-with-time-locale' to make test
results independent of running machine. Explicitly avoid matching log
note with old timestamp in all the tests to avoid confusion.

Co-authored-by: Ihor Radchenko <yantar92@posteo.net>

TINYCHANGE
2023-10-16 11:35:36 +03:00
bzg 201625f7e2 lisp/org-agenda.el: Display commands in a more consistent order
* lisp/org-agenda.el (org-agenda-get-restriction-and-command):
Display commands in a more consistent order.
2023-10-16 10:30:03 +02:00
Ihor Radchenko 73485aa063
org-element-parse-secondary-string: Fix Emacs 27 compatibility
* lisp/org-compat.el (org-get-buffer-create): Add compatibility
function.
* lisp/org-element.el (org-element-parse-secondary-string):
* lisp/org-id.el (org-id-find-id-in-file): Use it.

Reported-by: Yasushi SHOJI <yasushi.shoji@gmail.com>
Link: https://orgmode.org/list/CAELBRWJUQ=kupUbYev_W9dqEmYKnN3400t+W4_Q69EHNp-KMgA@mail.gmail.com
2023-10-16 11:24:29 +03:00
Ihor Radchenko fa7542d74c
* lisp/org-agenda.el (org-agenda-get-progress): Fix clock log entries
Do not alter match data when calling `org-get-category'.  The
subsequent code assumes that match data is not altered.
2023-10-16 10:34:14 +03:00
bzg 0becd1d6f7 Merge branch 'bugfix' 2023-10-16 07:43:04 +02:00
bzg 1ee85e957e doc/org-manual.org: Fix outdated link
* doc/org-manual.org (Packages that Org cooperates with): Fix
outdated link.

Suggested-by: https://list.orgmode.org/orgmode/87y1hd86n0.fsf@localhost
2023-10-16 07:41:42 +02:00
Jack Kamm 1eb5987589 ob-python: Check for end of output in org-babel-python-send-string
This is an attempt to mitigate occasional leaky prompts in CI. My
current hypothesis is that this could happen if the comint-output ends
between `org-babel-python-eoe-indicator' and the new prompt. Then the
new prompt could be injected into the output of the next unit test. To
avoid this, check we are at an ending prompt before exiting
`org-babel-python-send-string'.

https://list.orgmode.org/873506j7ky.fsf@localhost/

* lisp/ob-python.el (org-babel-python-send-string): Add check for
`python-shell-comint-end-of-output-p' to stop while loop accepting
process output.
2023-10-15 16:25:14 -07:00
Ihor Radchenko 061988c024
* lisp/org-tempo.el: Fix checkdoc warnings
(org-tempo-add-block):
(org-tempo-add-keyword): Fix arglist format in the docstring.
2023-10-15 11:53:05 +03:00
Ihor Radchenko 1a1f45d236
Merge branch 'bugfix' 2023-10-15 11:32:55 +03:00
Elias Kueny c42cdcda47
lisp/ob-shell.el: Adapt the `:var' header parameter to fish
* ob-shell.el (org-babel-variable-assignments:shell): allow the `:var'
keyword on fish code blocks to work with fish variables.

The fish shell uses the syntax `set variable value' instead of
`value=value' to set a shell variable.  This caused org-babel to
return an syntax error when attempting to execute a fish code block
with a `:var' parameter.  This change adds a helper function to use
the correct format.

TINYCHANGE
2023-10-15 11:27:58 +03:00
Ihor Radchenko 7d90507420
Merge branch 'bugfix' 2023-10-15 11:12:34 +03:00
Ihor Radchenko 51937d4b13
* lisp/ox.el (org-export-to-file): Ensure final newline
The newline were added by default in the past, before d7a55bbd5.
Continue to add it to avoid changed behavior.

Reported-by: YE <yet@ego.team>
Link: https://orgmode.org/list/87wmvwklnq.fsf@localhost
2023-10-15 11:10:58 +03:00
Ihor Radchenko 9fcbd19b3b
* lisp/org-protocol.el (org--protocol-detect-protocol-server): Fix docstring 2023-10-14 12:09:34 +03:00
Ihor Radchenko ec23993301
lisp/ox.el: Ignore case when matching headings and targets
* lisp/ox.el (org-export-search-cells):
(org-export-string-to-search-cell): Ignore case in headline titles and
radio targets.
* testing/lisp/test-ox.el (test-org-export/fuzzy-link): Add new test.

ox.el implements an independent link resolution mechanism that is not
fully consistent with ol.el.  In particular, radio links, when
resolved via `org-export-resolve-link' (unlike
`org-export-resolve-radio-link'), were previously case-sensitive, in
contrast with ol.el, which is case-insensitive.  Similarly, headline
matching by fuzzy links had inconsistency between `org-link-search'
and what ox.el does.

Link: https://orgmode.org/list/m2cyxl3qd0.fsf@me.com
2023-10-14 11:45:57 +03:00
Ihor Radchenko ed42dc34a8
* lisp/ol.el (org-link-search): Ignore case when matching headings
As per the docstring.
2023-10-14 11:44:10 +03:00
Ihor Radchenko abf5156096
* lisp/org-attach.el (org-attach-attach): Do not end error message with period 2023-10-13 15:34:39 +03:00
Ihor Radchenko 0d214ef008
org-element--current-element: Fix edge case with affiliated keywords
* lisp/org-element.el (org-element--collect-affiliated-keywords): Fix
edge case when a keyword matching affiliated keyword is preceding an
element that is not allowed to have such.  We need to handle this case
specially here rather than in `org-element--current-element' to avoid
the default paragraph fallback.
(org-element--current-element): Add a comment describing the pitfall.
*
testing/lisp/test-org-element.el (test-org-element/affiliated-keywords-parser):
Add more tests.

Reported-by: Tom Alexander <tom@fizz.buzz>
Link: https://orgmode.org/list/e2be976d-1bcf-4136-9968-33212dcd1f83@app.fastmail.com
2023-10-13 15:14:57 +03:00
Ihor Radchenko f3de4c3e04
org-babel-tangle-collect-blocks: Ignore src blocks without language
* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): Skip src blocks
that do not specify lang rather than erring.

Reported-by: Andrea <andrea-dev@hotmail.com>
Link: https://orgmode.org/list/AS8P193MB241369D9F0701F57E293429288D3A@AS8P193MB2413.EURP193.PROD.OUTLOOK.COM
2023-10-12 17:34:54 +03:00
Ihor Radchenko a2dd30d3a1
* lisp/ol-doi.el (org-link-doi-open): Document all the function arguments 2023-10-12 14:44:02 +03:00
Ihor Radchenko 0e3d0e3d19
org-element--collect-affiliated-keywords: Fix keywords before comment
* lisp/org-element.el (org-element--collect-affiliated-keywords):
Disallow affiliated keywords before a comment.
*
testing/lisp/test-org-element.el (test-org-element/affiliated-keywords-parser):
Add new test.
*
testing/lisp/test-org-element.el (test-org-element/cache-affiliated):
Fix test.

Reported-by: Tom Alexander <tom@fizz.buzz>
Link: https://orgmode.org/list/87c20267-d12e-4641-a1eb-3a7ac8181069@app.fastmail.com
2023-10-12 14:24:35 +03:00
Ihor Radchenko 07ae6ba58d
* lisp/org-element.el (org-element--current-element): Add a comment 2023-10-12 14:24:24 +03:00
Ihor Radchenko 9ba1fc778a
* lisp/org-element.el (org-element--cache-sync): Do not reset cache warning
Do not reset `org-element--cache-change-warning' at the end of
synchronization.  It is an error to do so if synchronization is
called while submitting a new request.

Add the comment in the code.

The test logs used to narrow down the error are not public.

Reported-by: Paul Stansell <paulstansell@gmail.com>
Link: https://list.orgmode.org/orgmode/CAMJKaZz12j-qm5tzjZyg1sLfhN-Z1Cqzy65sbARxty_xHeMfmg@mail.gmail.com/
2023-10-12 14:01:52 +03:00
Ihor Radchenko fba3fd56c4
org-element-org-data-parser: Allow leading blank lines before property drawer
* lisp/org-element.el (org-element--get-global-node-properties):
(org-element-org-data-parser):
(org-element--current-element): Allow blank lines at the beginning of
Org document.  Blank lines where allowed in the past (:contents-begin
started after the blank lines), but it was previously not possible to
have top-level property drawer in an Org document starting from blank
lines.  Now, it is possible.

* testing/lisp/test-org-element.el (test-org-element/org-data-parser):
Add new tests.

Reported-by: Tom Alexander <tom@fizz.buzz>
Link: https://orgmode.org/list/0ec8c4ae-4f5b-4e37-8c5c-f92ef497a461@app.fastmail.com
2023-10-12 13:34:08 +03:00
Ihor Radchenko a52c74e962
org-element-org-data-parser: Fix deferred property parsing
* lisp/org-element.el (org-element--get-node-properties): Pass parent
element as a new optional argument to derive relative offset from.
Calculate deferred property values according to the :begin of the
parent element.
(org-element--headline-deferred):
(org-element--get-global-node-properties): Explicitly pass the parent
headline/org-data to calculate deferred offsets correctly.

Reported-by: Tom Alexander <tom@fizz.buzz>
Link: https://orgmode.org/list/0ec8c4ae-4f5b-4e37-8c5c-f92ef497a461@app.fastmail.com
2023-10-12 13:31:49 +03:00
Ihor Radchenko f660afc506
fixup! org-element-parse-secondary-string: Prevent altering current buffer cache
Get rid of `org-export..' function call.
2023-10-12 11:16:59 +03:00
Ihor Radchenko e1569918cc
org-agenda: Handle inactive ranges when displaying inactive timestamps
* lisp/org-agenda.el (org-agenda-get-timestamps): Skip inactive
ranges.  Previously, inactive ranges were treated as two individual
timestamps.
(org-agenda-get-blocks): Handle inactive ranges when
`org-agenda-include-inactive-timestamps' is non-nil.  Append
`org-agenda-inactive-leader' when formatting inactive ranges.

Reported-by: Cletip Cletip <clement020302@gmail.com>
Link: https://orgmode.org/list/87jzru8mjt.fsf@localhost
2023-10-11 12:02:18 +03:00
Ihor Radchenko f32f5982a7
* lisp/ol-info.el (org-info-map-html-url): Prioritize custom URLs
When deriving info page URL, prioritizeable
`org-info-other-documents'.
2023-10-10 19:27:09 +03:00
Ihor Radchenko 7e7ce81136
* lisp/ol-info.el (org-info-other-documents): Convert to `defcustom'
* etc/ORG-NEWS (~org-info-other-documents~ is now a custom option):
Announce the change.

Link: https://orgmode.org/list/871qe44cec.fsf@breatheoutbreathe.in
2023-10-10 19:23:37 +03:00
Ihor Radchenko ce47fdf382
Merge branch 'bugfix' 2023-10-10 19:09:00 +03:00
Ihor Radchenko 902975ca44
* lisp/ol-info.el (org-info-emacs-documents): Update the manual list
Update the manuals from
https://www.gnu.org/software/emacs/manual/html_mono/.

Reported-by: Joseph Turner <joseph@ushin.org>
Link: https://orgmode.org/list/871qe44cec.fsf@breatheoutbreathe.in
2023-10-10 19:07:48 +03:00
Ihor Radchenko ad7406fc14
Merge branch 'bugfix' 2023-10-10 18:45:33 +03:00
Ihor Radchenko 558db89e40
Backport 7cc208af9 fix from main 2023-10-10 18:42:11 +03:00