Commit graph

19313 commits

Author SHA1 Message Date
Bastien Guerry 0ab6ab00c1 Revert "lisp/org-table.el: fix warning about `eq' usage"
This reverts commit ee0961ba31.
2023-11-01 10:14:30 +01:00
Karl Fogel ee0961ba31 lisp/org-table.el: fix warning about `eq' usage
* lisp/org-table.el (org-table-make-reference): Use `equal' instead of
`eq' to compare strings.

This change makes the following warning go away:

  Warning (comp): org-table.el:2867:23: \
  Warning: `eq' called with literal string that may never match (arg 2)

This change does not affect the behavior of `org-table-make-reference'
because `eq' treats all instances of the empty string as the same
object anyway, e.g., `(eq (string-trim "aaabbb" "a+" "b+") "")' ==> t.
The only effect of this change is to eliminate the warning.
2023-10-31 21:38:23 +01:00
Ihor Radchenko cdd73bc955
Update version number for the 9.6.11 release 2023-10-30 12:07:11 +02:00
Ihor Radchenko d68d0f5f49
* lisp/org-pcomplete.el: Add commentary section 2023-10-30 12:05:09 +02:00
Ihor Radchenko ffcdaa1e22
* lisp/org-mouse.el (org-mouse-re-search-line): Document function argument 2023-10-28 13:53:22 +03:00
Ihor Radchenko 9183e3c723
* lisp/org-crypt.el: Fix checkdoc warnings
(org-crypt-disable-auto-save):
(org-crypt-check-auto-save): Add missing quoting in the docstrings.
2023-10-27 12:19:44 +03:00
Ihor Radchenko 41ff569f2d
* lisp/org-ctags.el: Fix sentence spacing in the top comment 2023-10-26 12:48:21 +03:00
Ihor Radchenko 55db64e9d0
org-element--properties-mapc: Fix typo
* lisp/org-element-ast.el (org-element--properties-mapc): Fix missing
parenthesis.

Reported-by: Max Nikulin <manikulin@gmail.com>
Link: https://orgmode.org/list/uhb60m$10d5$1@ciao.gmane.io
2023-10-25 16:47:53 +03:00
Ihor Radchenko 2b15e789ae
org-clock-out-removed-last-clock: New variable to be used by `org-clock-hook'
* lisp/org-clock.el (org-clock-out-removed-last-clock): Add new global
variable.
(org-clock-out): Set the variable to non-nil when the CLOCK line has
been removed before running `org-clock-out-hook'.
(org-clock-out-hook): Add reference to the new variable.
* etc/ORG-NEWS (New variable ~org-clock-out-removed-last-clock~):
Announce the change.
2023-10-25 16:14:23 +03:00
Ihor Radchenko 9512bf250a
org-clock-out-hook: Clarify point location when hook is executed
* lisp/org-clock.el (org-clock-out-hook): Clarify that the point is at
the clock line when the hook is executed.
2023-10-25 14:52:22 +03:00
Ihor Radchenko b06995e998
* lisp/ol-man.el: Add file commentary and Code: header 2023-10-25 13:46:00 +03:00
PolishEmacsUser 0b0bf03e4b
org-clock-clocktable-language-setup: Reformat and add Polish translation
* lisp/org-clock.el (org-clock-clocktable-language-setup): Add Polish.
Reorder the translation aplhabetically with English on top.  Unify
spaces in lists.

TINYCHANGE
2023-10-25 13:35:43 +03:00
Max Nikulin 9cbaf8e49c
ox-ascii.el: Consistently add brackets around links
* lisp/ox-ascii.el (org-ascii-link): Add square brackets around
description of fuzzy links when they are exported inline.
* lisp/ol-docview.el (org-docview-export):
* lisp/ox-ascii.el (org-ascii-link): Export links with square brackets
around description and angle brackets around path.

This make export of links inline (when `org-ascii-links-to-notes' is
nil) consistent with "http:" links: "[DESC] (<URI>)".

I would drop brackets for "http:" and similar links instead
("DESC (<URI>)" or even "DESC <URI>"), but any case I prefer
consistency.

Ihor Radchenko to emacs-orgmode. Re: [RFC][PATCH] Allow to export to
ascii custom link types as notes. Tue, 24 Oct 2023 10:40:41 +0000.
<https://list.orgmode.org/87edhk717a.fsf@localhost>
2023-10-25 13:30:40 +03:00
Ihor Radchenko 9c255cacfe
org-element-ignored-local-variables: Add missing variables
This fixes ox-hugo bug when Org buffer copy cache is corrupted.

* lisp/org-element.el (org-element--cache-variables): Add
more state variables.  Move above
`org-element-ignored-local-variables' definition.
(org-element-ignored-local-variables): Make use of the value of
`org-element--cache-variables'.
*
testing/lisp/test-org-element.el (test-org-element/cache-ignored-locals):
Add guard against adding new cache state variables that are not listed
in `org-element--cache-variables'.

Reported-by: George Kettleborough <kettleg@gmail.com>
Link: https://orgmode.org/list/41acf96e-8f62-4ed5-9853-b4ff4e0e2fa9@gmail.com
2023-10-25 11:00:51 +03:00
Ihor Radchenko a9e2a97ee3
org-export-ignored-local-variables: Add missing variables
This fixes ox-hugo bug when Org buffer copy cache is corrupted.

Reported-by: George Kettleborough <kettleg@gmail.com>
Link: https://orgmode.org/list/41acf96e-8f62-4ed5-9853-b4ff4e0e2fa9@gmail.com
2023-10-25 10:58:02 +03:00
Ihor Radchenko c7db1c0981
* lisp/org-clock.el (org-clock-menu): Add docstring 2023-10-24 13:44:28 +03:00
Ihor Radchenko e03402b931
Merge branch 'bugfix' 2023-10-24 12:28:20 +03:00
Ihor Radchenko 84fa57ad1f
org-babel-insert-result: Do not modify RESULT for side effects
* lisp/ob-core.el (org-babel-insert-result): In some scenarios, result
of evaluation is a mutable Elisp string.  Avoid modifying it for side
effects as it may affect side effects of Elisp code blocks.

Reported-by: Jeff Trull <edaskel@att.net>
Link: https://orgmode.org/list/CAF_DUeEYVMytS=V2_aGjLyhddVZaPd7FWG_5Sbys6qcB0zGnyw@mail.gmail.com
2023-10-24 12:25:12 +03:00
Ihor Radchenko 098f081591
org-open-at-point: Preserve point unless opening link moves the point
* lisp/org.el (org-open-at-point): Preserve point when opening links.
When a link opened moves point in current buffer, do move the point
as needed by the link.  When multiple links that are opened move point
in current buffer, move point to the last such link.  Fix searching
for the links when opening _multiple_ the links is requested.

Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
Link: https://orgmode.org/list/87r0mp2srd.fsf@localhost
2023-10-23 14:28:04 +03:00
Ihor Radchenko 20ab29117c
* lisp/ol.el (org-link-open-as-file): Document function arguments 2023-10-23 12:33:29 +03:00
Ihor Radchenko 154ef34107
* lisp/ol-eww.el (org-eww-extend-eww-keymap): Add docstring 2023-10-22 12:18:53 +03:00
Ihor Radchenko 693a3c558f
org-icalendar-entry: Fix when the value is a list of keywords
* lisp/ox-icalendar.el (org-icalendar-entry): Add condition when the
value of :icalendar-include-todo is a list of keywords.
(org-icalendar-include-todo): Document that the value can be a list of
keywords, as per :type spec.

Reported-by: Björn Bidar <bjorn.bidar@thaodan.de>
Link: https://list.orgmode.org/orgmode/87ttqjirrv.fsf@/
2023-10-22 11:45:34 +03:00
Gerard Vermeulen 1494445116
Fix obsolete `sleep-for' usage
* lisp/ob-lua.el (org-babel-lua-evaluate-session):
* lisp/ob-python.el (org-babel-python-initiate-session-by-key):
(org-babel-python-evaluate-session):
* testing/lisp/test-ob-R.el (ob-session-async-R-simple-session-async-value):
(ob-session-async-R-simple-session-async-output):
(ob-session-async-R-named-output):
(ob-session-async-R-named-value):
(ob-session-async-R-output-drawer):
(ob-session-async-R-value-drawer):
(ob-session-R-result-output):
* testing/lisp/test-ob-julia.el (test-ob-julia/async-simple-session-output):
(test-ob-julia/async-named-output):
(test-ob-julia/async-output-drawer):
* testing/lisp/test-ob-python.el (test-ob-python/async-simple-session-output):
(test-ob-python/async-named-output):
(test-ob-python/async-output-drawer): Replace deprecated two integer
argument `sleep-for' calls with one float `sleep-for' calls.
2023-10-21 16:08:25 +03:00
Ihor Radchenko edff094b5f
* lisp/ol-eshell.el: Fix docstrings
(org-eshell-open): Document the function argument.
(org-eshell-store-link): Make the first docstring line into a single
sentence.
2023-10-21 14:49:52 +03:00
Nan JunJie 7ceefaf2d5
* lisp/ob-plantuml.el: Support tikz output
(org-babel-execute:plantuml): Generate tikz code without preamble when
requested :file has .tikz extension.
* etc/ORG-NEWS (=ob-plantuml.el=: Support tikz file format output):
Document the change.

TINYCHANGE
2023-10-20 14:52:25 +03:00
Ihor Radchenko 595a32d532
* lisp/ol.el: Document some of the function arguments
(org-link-store-props):
(org-link-add-props):
(org-link-open-from-string):
2023-10-20 13:29:03 +03:00
Ihor Radchenko 0e9485c90b
* lisp/ol.el (org-link--set-link-display): Fix compiler warning 2023-10-20 13:28:42 +03:00
Ihor Radchenko aef5cf5e0b
* lisp/ol.el (org-link-descriptive): Provide :set function
(org-link--set-link-display): New internal function used to apply
`org-link-descriptive' value across open Org buffers.
2023-10-20 12:38:18 +03:00
Ihor Radchenko 46a52a5708
* lisp/ob-sqlite.el: Document all the function arguments
(org-babel-execute:sqlite):
(org-babel-sqlite-offset-colnames):
2023-10-19 12:58:21 +03:00
Ihor Radchenko 13353f1fa3
org-fold-hide-drawer-all: Make interactive
* lisp/org-fold.el (org-fold-hide-drawer-all): Convert into
interactive command.  Accept two optional arguments - region
boundaries.
* etc/ORG-NEWS (~org-fold-hide-drawer-all~ is now interactive):
Document the change.

Link: https://orgmode.org/list/CAFmwT7WEMvGVyQhP8NcZY5vZMzz4NcvBjchd4jBqgHCPwjOgFA@mail.gmail.com
2023-10-19 12:32:49 +03:00
Ihor Radchenko 733cb9614c
* lisp/ob-sqlite.el: Add support for :prologue/:epilogue parameters
(org-babel-expand-body:sqlite):
2023-10-19 12:01:10 +03:00
Ihor Radchenko ab4ec726e5
* lisp/ob-org.el: Add support for :prologue/:epilogue parameters
(org-babel-expand-body:org):
2023-10-19 12:01:09 +03:00
Ihor Radchenko 320b0e5b1f
* lisp/ob-lisp.el: Add support for :prologue/:epilogue parameters
(org-babel-expand-body:lisp):
2023-10-19 12:01:09 +03:00
Ihor Radchenko 6887851401
* lisp/ob-lilypond.el: Add support for :prologue/:epilogue parameters
(org-babel-expand-body:lilypond):
2023-10-19 12:01:08 +03:00
Ihor Radchenko f0a2531bb4
* lisp/ob-latex.el: Add support for :prologue/:epilogue parameters
(org-babel-expand-body:latex):
2023-10-19 12:01:06 +03:00
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 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
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 558db89e40
Backport 7cc208af9 fix from main 2023-10-10 18:42:11 +03:00
Ihor Radchenko c952ff10fb
* lisp/ob-ruby.el: Document all the function arguments
(org-babel-execute:ruby):
(org-babel-variable-assignments:ruby):
(org-babel-ruby-initiate-session):
2023-10-10 15:30:35 +03:00
Ihor Radchenko fe23bec607
* lisp/org-element.el (org-element-subscript-parser): Fix edge case
Fix when both subscript and underline object match in
`org-element--object-lex'.
*
testing/lisp/test-org-element.el (test-org-element/underline-parser):
Add new test.

Reported-by: Tom Alexander <tom@fizz.buzz>
Link: https://orgmode.org/list/dad964f5-c764-4dd5-9829-ca38e3fbeb0d@app.fastmail.com
2023-10-10 15:05:38 +03:00
Ihor Radchenko ad07b2982f
fixup! org-element-parse-secondary-string: Prevent altering current buffer cache 2023-10-10 15:05:25 +03:00
Ihor Radchenko 37d6bde27f
org-element-parse-secondary-string: Prevent altering current buffer cache
* lisp/org-element.el (org-element-ignored-local-variables):
* lisp/ox.el (org-export-ignored-local-variables):
* lisp/org-compat.el (org-export-ignored-local-variables): Rename and
move to org-element.el.  Declare the old name obsolete.
* lisp/org-element.el (org-element--generate-copy-script):
* lisp/ox.el (org-export--generate-copy-script): Rename and move to
org-element.el.
* lisp/org-element.el (org-element-copy-buffer):
(org-element-with-buffer-copy): New function and macro like
`org-export-copy-buffer' and `org-element-with-buffer-copy', but not
processing #+bind keywords.
(org-element-parse-secondary-string): Use
`org-element-with-buffer-copy' that takes care about not copying
element cache object by reference and thus not modifying that cache if
the buffer happens to be modified.
* lisp/ox.el (org-export--set-variables): New helper function that
sets an alist of variable/value pairs in current buffer.
(org-export-copy-buffer): Make use of `org-element-copy-buffer'.
(org-export-with-buffer-copy): Make use of
`org-element-with-buffer-copy'.

Reported-by: Edgar Lux <edgarlux@mailfence.com>
2023-10-10 13:53:07 +03:00
Ihor Radchenko ac108a3ac1
* lisp/ol-docview.el (org-docview-export): Update docstring and arglist
Document all the arguments. Add fourth argument as require by the
latest :export link property spec.  Rename FORMAT to BACKEND for more
clarity.
2023-10-09 16:33:28 +03:00
Ihor Radchenko 681f3fc8f9
* lisp/ol-docview.el (org-docview-open): Add docstring 2023-10-09 16:33:18 +03:00
Ihor Radchenko 54b9c845a7
* lisp/org-crypt.el: Fix outdated declare forms
(org-end-of-subtree):
(org-make-tags-matcher): Update the arglists.
2023-10-08 13:01:12 +03:00
Ihor Radchenko fe19ebe4af
* lisp/org-archive.el: Fix flycheck warnings
(org-add-archive-files):
(org-toggle-archive-tag): Document all the function arguments.
(org-timestamp-to-now): Add missing declare.
2023-10-08 12:58:29 +03:00
Ihor Radchenko e54c7e604b
Update version number for the 9.6.10 release 2023-10-08 10:54:43 +03:00
Ihor Radchenko 1003790d1d
* lisp/org-pcomplete.el (org-element-property): Fix malformed declare 2023-10-07 16:25:08 +03:00
Ihor Radchenko 1225f62576
org-babel-python-read-string: Upcase function argument in the docstring
* lisp/ob-python.el (org-babel-python-read-string):
2023-10-07 13:34:42 +03:00
Ihor Radchenko 26f1cb77a9
org-ascii-item: Fix for alphabetical bullets
* lisp/ox-ascii.el (org-ascii-item): Fix setting [@X] counter for
alphabetical lists.
* testing/lisp/test-ox-ascii.el:
(test-ox-ascii/list):  Add new test.
* testing/lisp/test-ox-latex.el (org-test-with-exported-text):
* testing/org-test.el (org-test-with-exported-text): Move macro to be
available across multiple test files.

Reported-by: Tom Alexander <tom@fizz.buzz>
Link: https://orgmode.org/list/36a62fbf-6484-456f-9537-a7aa40530068@app.fastmail.com
2023-10-07 13:22:09 +03:00
Ihor Radchenko 69c830f361
* lisp/ob-processing.el: Document all the function arguments
(org-babel-execute:processing):
(org-babel-variable-assignments:processing): Fix the docstrings.
2023-10-06 20:04:30 +03:00
Ihor Radchenko 4edfb69f86
* lisp/org-element.el (org-element--cache-for-removal): Add more logging
Log cache warning value when updating robust cached elements.
2023-10-06 14:27:22 +03:00
Ihor Radchenko e6690c5b79
* lisp/ob-screen.el (org-babel-execute:screen): Document the function args 2023-10-05 15:04:14 +03:00
Ihor Radchenko 88ff6c2fbc
org-reset-checkbox-state-subtree: Do not reset outside the subtree
* lisp/org-list.el (org-update-checkbox-count): Allow ALL argument to
have a value `narrow', meaning "update in accessible portion of the
buffer".  Update the docstring accordingly.
(org-update-checkbox-count-maybe): Document the special value of ALL
argument passed to `org-update-checkbox-count'.
(org-reset-checkbox-state-subtree): Update checkbox count within
subtree only.

Reported-by: J. G. <jerzor@pacbell.net>
Link: https://orgmode.org/list/1700336757.1605468.1695739462846@mail.yahoo.com
2023-10-05 12:34:42 +03:00
Ihor Radchenko 6d85f851b3
* lisp/ob-shell.el (org-babel-execute:shell): Document the function args 2023-10-04 12:28:10 +03:00
Ihor Radchenko 460c1a3524
Merge branch 'bugfix' 2023-10-04 11:42:16 +03:00
Ihor Radchenko bd3705c053
org-columns-remove-overlays: Fix when no columnview yet in buffer
* lisp/org-colview.el (org-columns-remove-overlays): Do not assume
that `org-columns-begin-marker' is a marker object.

Reported-by: John Borwick <borwick@uw.edu>
Link: https://orgmode.org/list/m2jzs47t36.fsf@uw.edu
2023-10-04 11:41:41 +03:00
Leo Butler 2ba45fcb78
* lisp/ob-maxima.el: enable use of batch' loader and draw'
* (org-babel-header-args:maxima): Document the two new header
arguments (batch and graphics-pkg) that are specific to ob-maxima.
* (org-babel-maxima--command-arguments-default): A new variable
storing the default command-line argument(s).  This value was
hard-coded in `org-babel-maxima:execute'.
* (org-babel-maxima--graphic-package-options): A new variable that
stores an alist of Maxima graphics packages and the Maxima code to set
up that package.
* (org-babel-maxima--default-epilogue): A new variable that stores an
alist of the clean-up code that is run at end of a `graphical-output'
or `non-graphical-output' source block.
* (org-babel-maxima--output-filter-regexps): A new variable that
stores a list of regexps to identify "bad" output lines to be removed
from Maxima's output.  Source-code comments document each regexp's
purpose.  Two additional regexps have been added: one filters
un-wanted output from `batch' and the other removes empty input lines
that `batch'-ed output may spuriously produce (actual empty input
lines are syntax errors, see the new tests below).
* (org-babel-maxima--output-filter): A new function that takes a
single line of Maxima output.  It returns nil if the line has zero
length or matches a regexp in
`org-babel-maxima--output-filter-regexps'; otherwise, it returns the
line.  This function and regexp replace the hard-coded filter in
`org-babel-execute:maxima'.
* (org-babel-maxima-expand): Prepare the source block for execution,
depending on whether it is producing graphical output or not.  In case
of graphical output, use the `graphics-pkg' header to set the graphics
package and use `org-babel-maxima--graphic-package-options' to set-up
the package.  Grovel the graphics terminal from the output filename.
* (org-babel-execute:maxima): Use the :batch header argument and
`org-babel-maxima--command-arguments-default' to execute the source
block.  Replace the existing, in-line output filter and its regexps
with `org-babel-maxima--output-filter' and
`org-babel-maxima--output-filter-regexps'.

* testing/examples/ob-maxima-test.org: Add test examples.

Include examples of the batch-related tests from
testing/lisp/test-ob-maxima.el.  Provide an example of the
`:graphics-pkg' header argument with the `draw' package.

* testing/lisp/test-ob-maxima.el: Introduce six new, batch-related
test functions.  Each test exercises the :batch header argument.  The
response to unusual inputs is tested (empty strings, strings with just
whitespace, input with the `:lisp' reader, and two syntax-related
errors).

link: https://list.orgmode.org/87cyz1ivzw.fsf@t14.reltub.ca/
2023-10-04 11:27:46 +03:00
Ihor Radchenko 3fcf3d2e24
* lisp/ob-R.el (org-babel-edit-prep:R): Add docstring 2023-10-02 16:29:10 +03:00
Ihor Radchenko 3c29e77b51
* lisp/org-capture.el: Fix malformed declare form 2023-10-02 14:19:43 +03:00
Ihor Radchenko 0ed8bf794f
* lisp/ob-python.el: Document some missing function arguments
(org-babel-execute:python):
(org-babel-variable-assignments:python):
(org-babel-python-format-session-value): Document all the function
arguments in the docstrings.
(org-babel-python-with-earmuffs):
(org-babel-python-without-earmuffs): Add docstring.
2023-10-01 13:41:59 +03:00
Ihor Radchenko 85ebb6d422
* lisp/ob-org.el: Document all the function arguments
(org-babel-expand-body:org): Add docstring.
(org-babel-execute:org): Explain all the arguments and describe what
execution of Org body means.
2023-09-29 16:27:11 +03:00
Ihor Radchenko aa9177e1a8
* lisp/ob-octave.el: Document all the function arguments
(org-babel-execute:matlab):
(org-babel-execute:octave):
(org-babel-variable-assignments:octave):
(org-babel-octave-var-to-octave):
(org-babel-matlab-initiate-session):
(org-babel-octave-initiate-session):
(org-babel-octave-evaluate-external-process): Update docstrings and
argument names.
2023-09-26 14:14:11 +03:00
Ihor Radchenko 224d455d60
* lisp/ob-ocaml.el: Document all the function arguments
(org-babel-execute:ocaml):
(org-babel-variable-assignments:ocaml): Fix docstrings.
2023-09-23 14:23:59 +03:00
Ihor Radchenko 4d0f89672a
* lisp/ob-maxima.el: Document all the function arguments
(org-babel-maxima-expand):
(org-babel-execute:maxima):
(org-babel-maxima-var-to-maxima): Document all the arguments.
(org-babel-prep-session:maxima): Add docstring.
2023-09-22 14:09:36 +03:00
Ihor Radchenko 7efd5bba0a
org-element-cache: Add switch to verify cache before writing to disk
*
lisp/org-element.el (org-element--cache-self-verify-before-persisting):
New internal variable toggling full verification pass before writing
cache to disk.

* lisp/org-element.el (org-element--cache-persist-before-write):
Verify cache and throw error on failure when
`org-element--cache-self-verify-before-persisting' is non-nil.
2023-09-22 11:42:52 +03:00
Ihor Radchenko d73d85b05e
* lisp/ob-makefile.el (org-babel-execute:makefile): Document function args 2023-09-21 13:59:23 +03:00
Ihor Radchenko 266aac1186
org-element--cache-persist-before-write: Warn when writing incorrect cache
* lisp/org-element.el (org-element--cache-persist-before-write): When
the cache being written has elements without parent, warn the user.
2023-09-20 14:22:31 +03:00
Ihor Radchenko 8b18fc5817
org-attach-dir-from-id: Detect attachments under default `org-attach-id-dir'
* lisp/org-attach.el (org-attach-dir-from-id): When searching for an
existing attachment directory, consider the default value of of
`org-attach-id-dir', if it is changed.  This way, if user used the
default value in the past (or accidentally via emacs -Q), we can still
find the existing attachment dir.
2023-09-20 13:39:20 +03:00
Ihor Radchenko 39314eab11
* lisp/ob-lisp.el (org-babel-lisp-vector-to-list): Add docstring 2023-09-20 13:20:34 +03:00
Ihor Radchenko b1c507c0ee
org-find-base-buffer-visiting: Document function argument
* lisp/org-macs.el (org-find-base-buffer-visiting): Fix the docstring.
2023-09-20 11:02:32 +03:00
Ihor Radchenko e42b7a6fdd
* lisp/ob-latex.el: Document all the function arguments
(org-babel-execute:latex):
(org-babel-latex-convert-pdf):
2023-09-19 15:49:09 +03:00
Ihor Radchenko 6c917e8904
org-timestamp-change: Fix increasing range with prefix arg
* lisp/org.el (org-modify-ts-extra): Treat INCREMENT-STEP argument as
multiplier for minutes.
(org-timestamp-change): Add commentary.  Make sure that minutes are
incremented by prefix argument when incrementing time range without
rounding.

Reported-by: Jorge P. de Morais Neto <jorge+list@disroot.org>
Link: https://orgmode.org/list/87wnoezd15.fsf@disroot.org
2023-09-19 15:31:43 +03:00
Ihor Radchenko a098c07973
* lisp/org.el (org-modify-ts-extra): Refactor the code
Rename arguments and variables to be more readable.  Add commentary
explaining the code.  Update the docstring, documenting the important
details and describing all the function arguments.
2023-09-19 14:57:20 +03:00
Ihor Radchenko edcb8eca5f
(org-fast-tag-selection): Honour tag groups when using <TAB> input
* lisp/org.el (org--add-or-remove-tag): New helper function to toggle
tags taking into account tag groups.
(org-fast-tag-selection): Factor out the tag toggling code into a new
function and re-use it in both key selection branch and in the <TAB>
completion interface.

Reported-by: sreenivas sumadithya <sumadithya@gmail.com>
Link: https://orgmode.org/list/CAHVqzFVP9KhrC5ZG_GUHbXZRBVg+PU+tR91vSfrnirLo7_T5Ug@mail.gmail.com
2023-09-19 12:43:00 +03:00
Ihor Radchenko c61ec6255d
org-agenda-get-scheduled: Fix call to `org-time-string-to-time'
* lisp/org-agenda.el (org-agenda-get-scheduled): Do not pass timestamp
object to `org-time-string-to-time'.  Convert it to string first.

Reported-by: Carlo Tambuatco <oraclmaster@gmail.com>
Link: https://orgmode.org/list/CAJb92EzRWO6v3MRVbU0XwQomx-A1eYvFaOaBsJemB85Y4nJ1eg@mail.gmail.com
2023-09-19 11:24:10 +03:00
Ihor Radchenko 6307a774a7
org-agenda-get-scheduled: Fix call to `org-time-string-to-time'
* lisp/org-agenda.el (org-agenda-get-scheduled): Do not pass timestamp
object to `org-time-string-to-time'.  Convert it to string first.

Reported-by: Carlo Tambuatco <oraclmaster@gmail.com>
Link: https://orgmode.org/list/CAJb92EzRWO6v3MRVbU0XwQomx-A1eYvFaOaBsJemB85Y4nJ1eg@mail.gmail.com
2023-09-19 11:22:00 +03:00
Ihor Radchenko 0d9efae43f
org-odt--translate-latex-fragments: Make sure that we use org-mode buffer
* lisp/ox-odt.el (org-odt--translate-latex-fragments): When exporting
Latex fragments, use Org mode buffer to setup parser properly.
2023-09-18 13:08:42 +03:00
Ihor Radchenko 5da44c7ba1
* lisp/ob-js.el: Document all the function arguments
(org-babel-execute:js):
(org-babel-variable-assignments:js):
2023-09-18 11:55:04 +03:00
Ihor Radchenko 72bbf89282
* lisp/ob-haskell.el (org-babel-haskell-execute): Document function arguments 2023-09-17 13:23:00 +03:00
Ihor Radchenko 14bde5aba5
ox-icalendar: Ensure that entries in icalendar end with a newline
* lisp/ox-icalendar.el (org-icalendar--vevent):
(org-icalendar--vtodo): Make sure that there is a newline after the
exported VEVENT and VTODO.

Reported-by: Henrik Frisk <frisk.h@gmail.com>
Link: https://orgmode.org/list/CAO0LSb4aQhUMny4xr=1LB3t5F-K-WnjK1zc+qR7Jy+69vr2wpw@mail.gmail.com
2023-09-17 12:49:46 +03:00
Ihor Radchenko 88f2dde0fc
* lisp/ob-python.el: Declare non-standard header args
(org-babel-default-header-args:python): New constant declaring
python-specific header arguments.
2023-09-17 12:39:40 +03:00
Ihor Radchenko c703541ffc
* lisp/ob-groovy.el: Fix checkdoc warnings
(org-babel-execute:groovy):
(org-babel-groovy-evaluate): Document all the function arguments.
(org-babel-groovy-initiate-session): Fix the docstring, explaining
that function does nothing.
2023-09-16 12:23:52 +03:00
Ihor Radchenko 2e5db7a591
org-element-cache: Catch problems with persistent cache and abort loading
* lisp/org-element.el (org-element--cache-persist-after-read): When
the persistent cache has elements without parent, do not use such
cache and report a warning to user.
2023-09-16 11:52:27 +03:00
Ihor Radchenko aee3f2227f
* lisp/org.el (org-mode): Initialize cache before parsing buffer keywords
If we load cache after `org-set-regexp-and-options', we may do double
job as `org-set-regexp-and-options' by itself queries cache.
2023-09-16 11:40:56 +03:00
Ihor Radchenko e90a8a69a7
org-element-cache: Log recovered persisted elements during loading
* lisp/org-element.el (org-element--cache-persist-before-read):
(org-element--cache-persist-after-read): Record diagnostics messages
when loading persistent cache.
2023-09-15 13:30:27 +03:00
Ihor Radchenko fd1418dadd
* lisp/ob-gnuplot.el: Document all the function arguments
(org-babel-execute:gnuplot):
(org-babel-variable-assignments:gnuplot):
2023-09-15 12:58:25 +03:00
Gerard Vermeulen d70c1200f7
ob-fortran.el: Fix name of caller in documentation
* lisp/ob-fortran.el (org-babel-execute:fortran): Fix name of caller
in documentation and conform to "rules" in sibling ob-XXX.el files.
2023-09-15 12:22:50 +03:00
Ihor Radchenko 9eaca51c51
* lisp/org-clock.el (org-clock--translate): Clarify "L" and "ALL" terms
Explain in a comment what "L" And "ALL" terms mean in the context of
clock table.

Reproted-by: emacs@supporter.mailer.me
2023-09-15 11:55:33 +03:00
Ihor Radchenko 765a84ea25
* lisp/ob-fortran.el: Document all the function arguments
(org-babel-execute:fortran):
(org-babel-expand-body:fortran):
(org-babel-fortran-ensure-main-wrap):
(org-babel-prep-session:fortran):
(org-babel-load-session:fortran):
(org-babel-fortran-var-to-fortran):
(org-babel-fortran-transform-list): Document function arguments and
make sure that the first line of the docstring is a short single
sentence.
2023-09-14 16:06:13 +03:00
Ihor Radchenko df0539d678
* lisp/org.el (org-cdlatex-mode): Try to load texmathp
Attempt to load texmathp before setting advice.  `texmathp' is
optional and must be loaded before `cdlatex'.
2023-09-14 12:37:12 +03:00
Ihor Radchenko 6fbeac84e6
* lisp/ob-lua.el: Fix checkdoc warnings
(org-babel-execute:lua):
(org-babel-variable-assignments:lua):
(org-babel-lua-with-earmuffs):
(org-babel-lua-without-earmuffs):
(org-babel-lua-evaluate):
(org-babel-lua-evaluate-external-process):
(org-babel-lua-read-string): Add or modify docstrings, documenting all
the function arguments.
2023-09-13 11:23:55 +03:00
Ihor Radchenko d96982f375
* lisp/ob-forth.el: Document all the function arguments.
(org-babel-execute:forth): Document the arguments.
(org-babel-forth-session-execute): Add docstring.
2023-09-12 12:30:51 +03:00
Ihor Radchenko 20162f5a5c
org-element-dynamic-block-open-re-nogroup: Demand block name
* lisp/org-element.el (org-element-dynamic-block-open-re-nogroup): Fix
inconsistency with `org-element-dynamic-block-open-re' - block name is
mandatory.
*
testing/lisp/test-org-element.el (test-org-element/dynamic-block-parser):
Add test.
2023-09-12 11:15:17 +03:00
Ihor Radchenko 4c0cde5783
org-babel-variable-assignments:eshell: Document PARAMS argument
* lisp/ob-eshell.el (org-babel-variable-assignments:eshell):
2023-09-11 11:51:59 +03:00
Juan Manuel Macias 893c5d0851
ox-latex.el: Fixes and improvements in `org-latex-language-alist'.
* (org-latex-language-alist): Fix a language code (`de-de') removed
when `org-latex-babel-language-alist' and
`org-latex-polyglossia-language-alist' were merged.  New admitted
properties: `:babel-ini-alt', `:script' and `:script-tag'.  Add
language code for ancient Greek.  Fix Afrikaans (was previously
removed).  New languages: Chinese Simplified and Traditional.
Correction of some typos, errors and inaccuracies.  `let' bindings
suggested by Ihor Radchenko.

* (org-latex-guess-babel-language): Some necessary modifications.

Link: https://orgmode.org/list/8734zoxzd0.fsf_-_@posteo.net
2023-09-10 16:32:29 +03:00
Ihor Radchenko 08f8c06b14
* lisp/ob-exp.el: Document all the function arguments
(org-babel-exp-do-export):
(org-babel-exp-code):
(org-babel-exp-results):
2023-09-10 11:45:02 +03:00
Ihor Radchenko c2594e7456
fixup! * lisp/ox.el (org-export-dictionary): Add Polish translation 2023-09-10 11:26:06 +03:00
Emacs User 7de89d0a42
* lisp/ox.el (org-export-dictionary): Add Polish translation
TINYCHANGE
2023-09-10 11:01:32 +03:00
Ihor Radchenko 515e4ed49b
* lisp/org.el (org--get-expected-indentation): Remove redundant cond clause
Reported-by: No Wayman <iarchivedmywholelife@gmail.com>
Link: https://orgmode.org/list/87wmwzdwx8.fsf@gmail.com
2023-09-10 10:38:19 +03:00
Ihor Radchenko 2030c111eb
* lisp/ob-emacs-lisp.el: Document all the function arguments
(org-babel-execute:emacs-lisp):
(org-babel-edit-prep:emacs-lisp): Document all the function arguments
in the docstrings.
2023-09-09 13:57:02 +03:00
Ihor Radchenko 163bafb43d
* lisp/ob-dot.el (org-babel-execute:dot): Document all the function arguments 2023-09-08 12:23:31 +03:00
Ihor Radchenko eed3ac9f78
* lisp/ob-haskell.el (inferior-haskell-root-dir): Declare external variable 2023-09-08 11:11:06 +03:00
Bruno BARBIER 36a786f7f9
ob-haskell: Implement sessions
* lisp/ob-haskell.el (org-babel-haskell-initiate-session): Implement
sessions.
(org-babel-haskell-with-session): New macro to manage sessions.
(org-babel-interpret-haskell): Refactor code.  Use
`org-babel-haskell-with-session` to manage sessions.

* testing/lisp/test-ob-haskell-ghci.el: Update tests related to
sessions.
2023-09-08 10:59:45 +03:00
Bruno BARBIER 924c2dd836
lisp/ob-haskell: Request the last value from GHCi
* lisp/ob-haskell.el (org-babel-interpret-haskell): When the result
type is 'value, use the last value as defined by GHCi.
(org-babel-haskell-eoe): New default value.
(org-babel-interpret-haskell): Update for the new value of `org-babel-haskell-eoe'.

* testing/lisp/test-ob-haskell-ghci.el: Update tests related to output/value.
2023-09-08 10:59:44 +03:00
Ihor Radchenko 5bffb9a1e3
org-babel-haskell-initiate-session: Remove secondary prompt
* lisp/ob-haskell.el (org-babel-haskell-initiate-session): Set
secondary prompt to "".  If we do not do this, org-comint may treat
secondary prompts as a part of output.
2023-09-08 10:59:42 +03:00
Ihor Radchenko 1f88acd013
* lisp/ob-core.el (org-babel-result-cond): Document all the arguments 2023-09-07 15:05:40 +03:00
Nicholas Vollmer 4fe52fc8ac
lisp/ob-lilypond.el: refactor org-babel-lilypond-compile-lilyfile
* ob-lilypond.el (org-babel-lilypond-compile-lilyfile):
Correct compilation message.
Remove superfluous local variables.
Remove unused ad-hoc debugging TEST parameter.

* test-ob-lilypond.el (ob-lilypond/ly-compile-lilyfile):
Locally bind variables which may generate output files.
Refactor to account for removed TEST parameter.
2023-09-06 12:33:35 +03:00
Ihor Radchenko 13e4ee7371
org-babel-comint-with-output: Fix for edge case of `comint-prompt-regexp'
* lisp/ob-comint.el (org-babel-comint-with-output): Implement more
universal algorithm catching agglomerated prompts.  The new approach
works for regexps that match ^, but not as the first char in the
regexp string.
* testing/lisp/test-ob-octave.el (ob-octave/session-multiline): Add
new test.

Reported-by: Paul Stansell <paulstansell@gmail.com>
Link: https://orgmode.org/list/CAMJKaZwuTV-06pPz5nv87CNcoVcqCwFjEodubXTzXs15Q=OFug@mail.gmail.com
2023-09-06 12:19:14 +03:00
Nicholas Vollmer f6fc385ed0
ob-lilypond.el: Fix docstring typos 2023-09-04 10:47:28 +03:00
Jens Schmidt 234650af2e
org-make-tags-matcher: Re-add quoting of property names
* lisp/org.el (org-make-tags-matcher):
* testing/lisp/test-org.el (test-org/map-entries): Move special cased
handling of LEVEL properties.  Add tests for other special cased
properties TODO and CATEGORY.

* lisp/org.el (org-make-tags-matcher):
* doc/org-manual.org (Matching tags and properties):
* testing/lisp/test-org.el (test-org/map-entries): Re-add and extend
quoting of property names in search strings.

Link: https://orgmode.org/list/87h6oq2nu1.fsf@gmail.com
2023-09-03 09:48:41 +03:00
Ihor Radchenko 806abc5a2b
Update version number for the 9.6.9 release 2023-09-03 09:35:50 +03:00
Ihor Radchenko dbf415b840
Revert "org-texinfo--match-definition: Drop redundant `save-match-data'"
This reverts commit e32bd5f7c7.

This is `pcase-let*', not `pcase', so the arguments are _all_
evaluated and match data must be preserved in the ARGS binding.

Link: https://yhetil.org/emacs-devel/877cp8bkpa.fsf@bernoul.li
2023-09-02 20:07:07 +03:00
Ihor Radchenko 21654e9a44
* lisp/ob-core.el (org-babel-examplify-region): Document all the arguments 2023-09-02 12:53:08 +03:00
Ihor Radchenko af9c063edf
* lisp/ob-core.el (org-babel-remove-result): Document function arguments 2023-09-01 14:03:39 +03:00
Ihor Radchenko f97877a069
ox-latex: Prefer :latex-src-block-backend INFO property over variable
* lisp/ox-beamer.el (org-beamer-template):
* lisp/ox-latex.el (org-latex-template): Reuse INFO plist to retrieve
src backend.  Direct usage can break user settings where INFO channel
is expected to be modified and have effect.
2023-09-01 13:42:27 +03:00
Ihor Radchenko 91a532b40e
org-babel-expand-noweb-references: Document all the function arguments
* lisp/ob-core.el (org-babel-expand-noweb-references): Fix the
docstring, documenting every argument.
2023-08-31 14:27:36 +03:00
Ihor Radchenko deb5ea0fc0
ob-ruby: Work around long line input
* lisp/ob-ruby.el (org-babel-ruby-var-to-ruby): Some comint buffers
are not able to process more than 4096 characters in one line - the
rest of the line can be silently ignored.  Work around this by
splitting list vars to multiple lines.

Link: https://orgmode.org/list/87pm3ut3zi.fsf@localhost
2023-08-31 12:47:01 +03:00
Ihor Radchenko db679cff98
* lisp/ob-ruby.el (org-babel-ruby-initiate-session): Fix multiline
Without a newline at the end, repl sometimes does not interpret the
prompt settings correctly.
2023-08-31 12:46:21 +03:00
Ihor Radchenko 83411c0d3e
* lisp/ob-ruby.el (org-babel-ruby-evaluate): Fix eoe indicator 2023-08-31 12:46:09 +03:00
Ihor Radchenko ff53846f31
org-babel-comint-with-output: Fix another edge case with REPL prompts
* lisp/ob-comint.el (org-babel-comint-with-output): Sometimes, REPL
can split whitespace between sequence of prompt prompt prompt.

In particular, inf-ruby did this on multiline input.
2023-08-31 12:42:21 +03:00
Jack Kamm b49275acbe Merge branch 'bugfix' 2023-08-30 21:48:18 -07:00
Jack Kamm c81dba2fb9 ob-python: Fix hanging on second start
See: https://list.orgmode.org/87ttsnh5bx.fsf@localhost/T/#t

* lisp/ob-python.el (org-babel-python-initiate-session-by-key): Switch
from `org-babel-comint-wait-for-output' to `sleep-for' while waiting
for `org-babel-python--initialized', to prevent hanging on restarted
Python process.
2023-08-30 21:38:09 -07:00
Ihor Radchenko d8af9c40e0
org-babel-remove-result-one-or-many: Document the prefix argument
* lisp/ob-core.el (org-babel-remove-result-one-or-many): Rename prefix
argument to the conventional ARG and document it in the docstring.
2023-08-30 08:24:11 +03:00
Ihor Radchenko cd0e225e34
* lisp/ob-core.el (org-babel-import-elisp-from-file): Document all function arguments 2023-08-29 12:47:12 +03:00
Ihor Radchenko 3f6c33b7b6
* lisp/ob-core.el (org-babel-temp-stable-file): Document all function arguments 2023-08-29 12:46:58 +03:00
Ihor Radchenko e32bd5f7c7
org-texinfo--match-definition: Drop redundant `save-match-data'
* lisp/ox-texinfo.el (org-texinfo--match-definition): It is safe to
drop `save-match-data' as the function modifies the match data anyway,
and `save-match-data' does not affect anything else.
2023-08-29 12:38:04 +03:00
Ihor Radchenko f02b4c8b4d
org-refile-get-targets: Improve malformed target handling
* lisp/org-refile.el (org-refile-get-targets): Throw better errors
when `org-refile-targets' value is malformed.  Allow common mistake
with not using a cons cell in the target description.
2023-08-27 15:18:12 +03:00
Ihor Radchenko 320c29c021
* lisp/ob-core.el (org-babel-remove-inline-result): Document DATUM argument 2023-08-27 14:04:25 +03:00
Ihor Radchenko 9f12a1b9e4
org-babel-map-executables: Avoid using `save-match-data'
* lisp/ob-core.el (org-babel-map-executables): Drop
`save-match-data' as it may be costly.
2023-08-27 13:10:44 +03:00
Ihor Radchenko 05064052ad
org-babel-map-call-lines: Avoid using `save-match-data'
* lisp/ob-core.el (org-babel-map-call-lines): Drop
`save-match-data' as it may be costly.
2023-08-27 13:10:26 +03:00
Ihor Radchenko 99b65bb212
org-babel-map-inline-src-blocks: Avoid using `save-match-data'
* lisp/ob-core.el (org-babel-map-inline-src-blocks): Drop
`save-match-data' as it may be costly.
2023-08-27 13:09:51 +03:00
Ihor Radchenko 1dcde9889b
Merge branch 'bugfix' 2023-08-26 19:13:33 +03:00
Ihor Radchenko 7c929e9d8c
* lisp/oc-basic.el: Fix parsing "editor" field in json bibliographies
(org-cite-basic--parse-json): Parse "editor" field, not "editors".
"editors" is a typo - the common field name is "editor".  For example,
see https://www.bibtex.com/e/book-entry/.

Reported-by: Margaret Patterson <emacs-m@ninecats.org>
Link: https://list.orgmode.org/orgmode/ea0d8557-f67d-c8b1-522f-b5ad37612d99@ninecats.org/
2023-08-26 19:10:05 +03:00
Ihor Radchenko b3c7ebecac
* lisp/ob-core.el (org-babel-format-result): Document SEP argument 2023-08-26 15:06:20 +03:00
Ihor Radchenko f299fbbbb0
org-export--prepare-file-contents: Drop redundant `save-match-data'
`save-match-data' is costly.  We should not use it unless necessary.
2023-08-26 14:29:17 +03:00
Ihor Radchenko 99c40177ad
org-babel-demarcate-block: Document prefix argument in the docstring 2023-08-25 14:26:44 +03:00
Ihor Radchenko 5ff5ac03b6
* lisp/ox.el (org-export-parse-include-value): Remove `save-match-data'
Avoid using GC-expensive `save-match-data'.
2023-08-25 14:13:23 +03:00
Ihor Radchenko 0ceb562b33
org-fold-core--specs: Remove wrong ":alias" alias
* lisp/org-fold-core.el (org-fold-core-get-folding-spec-from-alias):
Do not put ":alias" as an actual alias.  The code did not account that
`assq' returns the whole cons cell, not just value of the alist item.
2023-08-25 11:33:29 +03:00
Nicholas Vollmer 538ddecb30
* lisp/ob-lilypond.el: Satisfy checkdoc
(org-babel-lilypond-compile-post-tangle):
(org-babel-lilypond-display-pdf-post-tangle):
(org-babel-lilypond-play-midi-post-tangle):
(org-babel-execute:lilypond):
(org-babel-lilypond-tangle):
(org-babel-lilypond-process-basic):
(org-babel-lilypond-parse-line-num):
(org-babel-lilypond-set-header-args):
Fix docstring
2023-08-25 10:56:50 +03:00
Ihor Radchenko 7bdec435ff
org-export-expand-include-keyword: Drop unnecessary call to `save-match-data'
* lisp/ox.el (org-export-expand-include-keyword): Do not wrap
`org-element-at-point' into `save-match-data'.  The search data from
`re-search-forward' is unused in the code and `save-match-data' call
is costly.
2023-08-24 15:10:32 +03:00
Ihor Radchenko d5ee33fed8
lisp/ob-core: List all the arguments in some docstrings
* lisp/ob-core.el (org-babel-parse-multiple-vars):
(org-babel-goto-named-src-block):
(org-babel-goto-named-result): Describe all the function arguments in
the docstring.
2023-08-24 13:27:58 +03:00
Ihor Radchenko 85c94ecfc2
ox-latex: Improve warning for unexpected org-latex-src-block-backend
* lisp/ox-latex.el (org-latex-inline-src-block):
(org-latex-src-block): Update the warning text, explicitly mentioning
the variable name to be adjusted.

Reported-by: Guillaume MULLER <guillaume.muller@emse.fr>
Link: https://orgmode.org/list/b5c056cb-3258-4a11-2d9b-33c97b112d62@emse.fr
2023-08-24 10:37:52 +03:00
Ihor Radchenko 3c3db7b337
oc-basic: Fix detecting changes in symlinked bibliography
* lisp/oc-basic.el (org-cite-basic--parse-bibliography): Use
`file-truename' to follow symlinks first before checking bibliography
file change times.

Reported-by: Leo Butler <Leo.Butler@umanitoba.ca>
Link: https://orgmode.org/list/877cpmkds1.fsf@t14.reltub.ca
2023-08-24 10:21:21 +03:00
Ihor Radchenko 1665283f25
Merge branch 'bugfix' 2023-08-24 10:18:02 +03:00
Liu Hui 973e50c839
* lisp/org.el (org-at-timestamp-p): Fix match groups in docstring
The docstring was not accurate from the times when group information
was added to it.  The patch uses the groups, as they appear in the
function code itself.
2023-08-24 10:16:22 +03:00
Ihor Radchenko 5e7427c6d1
* lisp/ob-core.el (org-babel-hide-result-toggle): Document FORCE argument 2023-08-23 14:24:53 +03:00
Ihor Radchenko 430c72924c
ob-ruby: Fix ruby tests
* lisp/ob-ruby.el (org-babel-ruby-prompt):
(org-babel-ruby-define-prompt): New variables used to set appropriate
unique prompt and disable echo in session.
(org-babel-ruby-initiate-session): Setup prompt and echo during
session initialization.
(org-babel-ruby-evaluate): Rely on `org-babel-ruby-initiate-session'
to setup prompt and echo.  Re-setting the prompt back after every
evaluation can be tricky because of async nature of the prompt, so it
is now dropped.
2023-08-23 14:19:52 +03:00
Allen Li c905565fa8
org-element: Raise gc-cons-threshold for org-element-cache-map
This garbage collects many times when calling
`org-get-buffer-tags' (such as during tag completion) in a large file
with many tags.  Raise `gc-cons-threshold' as this may affect other
callers in large files.

Note that `org-element-parse-buffer' also raises `gc-cons-threshold'
as a precedent.

This has no effect on most callers and increases performance for
extreme cases.

* lisp/org-element.el (org-element-cache-map): Raise
`gc-cons-threshold'.
2023-08-23 12:54:43 +03:00
Jack Kamm 579e8c5723 ob-python: Results handling for dicts, dataframes, arrays, plots
Thanks to Ihor Radchenko and Liu Hui for valuable feedback on this
patch.

* lisp/ob-python.el (org-babel-execute:python): Parse graphics-file
from params, and pass it to `org-babel-python-evaluate'.
(org-babel-python--output-graphics-wrapper): New constant.  Python
code to save graphical output.
(org-babel-python--def-format-value): New constant.  Python function
to format and save value results to file.  Includes handling for
graphics, dataframes, and arrays.
(org-babel-python-table-or-string): Prevent `org-babel-script-escape'
from mangling dict results.
(org-babel-python--setup-session): New function to
run setup code within Python session.
(org-babel-python-initiate-session-by-key): Replace lambda with
`org-babel-python--setup-session' in `python-shell-first-prompt-hook',
or run it directly if the session was started outside Org.
(org-babel-python-wrapper-method): Removed.  Instead use part of the
string directly in `org-babel-python-evaluate-external-process'.
(org-babel-python-pp-wrapper-method): Removed.  Pretty printing is now
handled by `org-babel-python--def-format-value'.
(org-babel-python--exec-tmpfile): Removed.  Instead use the raw string
directly in `org-babel-python-evaluate-session'.
(org-babel-python-format-session-value): Updated to use
`org-babel-python--def-format-value' for formatting value result.
(org-babel-python-evaluate): New parameter graphics-file.  Pass
graphics-file onto downstream helper functions.
(org-babel-python-evaluate-external-process): New parameter
graphics-file.  Use `org-babel-python--output-graphics-wrapper' for
graphical output.  For value result, use
`org-babel-python--def-format-value'.  Don't call `org-trim' on
results, to prevent misalignment of pandas DataFrames.
(org-babel-python-evaluate-session): New parameter graphics-file.  Use
`org-babel-python--output-graphics-wrapper' for graphical output.
Replace the removed constant `org-babel-python--exec-tmpfile' with the
string directly.  Rename local variable tmp-results-file to
results-file, which may take the value of graphics-file when provided.
(org-babel-python-async-evaluate-session): New parameter
graphics-file.  Use `org-babel-python--output-graphics-wrapper' for
graphical output.  Rename local variable tmp-results-file to
results-file, which may take the value of graphics-file when provided.
2023-08-22 16:22:17 -07:00
Ihor Radchenko 53c9d91d3c
org-element: Fix post-blank shared between items
* lisp/org-element.el (org-element-item-parser): Do not parse beyond
LIMIT - they may extend :post-blank beyond parent list contents.
(org-element-plain-list-parser): Make sure that plain list always owns
the trailing blank lines.
(org-element-cache-version): Bump cache version.
* testing/lisp/test-org-element.el (test-org-element/item-parser): Add
test.

Reported-by: Tom Alexander <tom@fizz.buzz>
Link: https://orgmode.org/list/1c833eb8-c556-437b-ac5b-be360ebcc869@app.fastmail.com
2023-08-22 11:25:59 +03:00
Ihor Radchenko 80ae8462a6
org-element--standard-properties: Re-order, putting boundaries in order
* lisp/org-element-ast.el (org-element--standard-properties): Re-order
the properties, making the element boundaries in order as they will
appear in buffer.  Re-group other properties.
2023-08-22 11:23:16 +03:00
Ihor Radchenko 19a1a5024b
Update version number for the 9.6.8 release 2023-08-22 10:35:22 +03:00
Ihor Radchenko 7219b006bd
org-element: Fix loading obsolete persistent caches
* lisp/org-element.el (org-element-cache-version): New constant
defining the current cache version.
(org-element-cache-reset): Use the new variable.
* lisp/org.el (org-mode): Assert loading the correct cache version.

Reported-by: Gregor Zattler <telegraph@gmx.net>
Link: https://orgmode.org/list/87350cvm3d.fsf@no.lan
2023-08-21 13:24:41 +03:00
Ihor Radchenko 168b99ba94
org-babel-join-splits-near-ch: Fix the docstring
* lisp/ob-core.el (org-babel-join-splits-near-ch): Explain all the
arguments and what the function does.
2023-08-21 13:01:54 +03:00
Ihor Radchenko 299193bf09
org-display-remote-inline-images: Add new allowed value t
* lisp/org.el (org-display-remote-inline-images): Allow value t as
alias to cache.
(org--create-inline-image): Handle t value.
2023-08-20 14:15:49 +03:00
Ihor Radchenko e08d878314
org-columns-redo: Fix when `org-columns' is called with prefix arg
* lisp/org-colview.el (org-columns-global): New buffer-local variable
holding GLOBAL argument to `org-columns'.
(org-columns): Record the GLOBAL arg.
(org-columns-redo): Fix `org-columns' call, using
`funcall-interactively' and passing GLOBAL arg as well.  The previous
usage of `call-interactively' made no sense because
`org-column-current-fmt' would not be passed as an argument -
`call-interactively' does not allow passing arguments.

Link: https://orgmode.org/list/877culo1pb.fsf@localhost
2023-08-20 13:39:50 +03:00
Sławomir Grochowski 650e42996e
lisp/org-colview.el: Add new commands to move column view table row
* doc/org-manual.org (org-columns-move-row-up,
org-columns-move-row-down, org-columns-move-left,
org-columns-move-right): Document two new and two old commands.
* etc/ORG-NEWS (New commands to move rows up & down): Document the new
feature.
* lisp/org-colview.el (org-columns--move-row, org-columns-move-row-up,
org-columns-move-row-down): New functions.
* testing/lisp/test-org-colview.el (test-org-colview/columns-move-row-down,
test-org-colview/columns-move-row-up,
test-org-colview/columns--move-row-stay-at-the-same-column,
test-org-colview/columns-move-row-down-with-subheading): New tests.
2023-08-20 13:39:47 +03:00
Ihor Radchenko 58c5c5882c
org-columns: Fix when adding spaces to headings
* lisp/org-colview.el (org-columns): Use markers to store collected
column headline value positions.  This is necessary because
`org-columns--display-here' may modify buffer, invalidating headline
positions returned by `org-scan-tags'.

Reported-by: Jakob Schöttl <jschoett@gmail.com>
Link: https://orgmode.org/list/831f07e0-d86a-a0dc-c967-e48906f520a1@gmail.com
2023-08-20 11:54:20 +03:00
Ihor Radchenko 06714dea79
org-babel-current-result-hash: Mark unused argument
* lisp/ob-core.el (org-babel-current-result-hash): Mark INFO argument
as unused.  `org-babel-where-is-src-block-results' does not use INFO
argument even when passed.
2023-08-20 11:45:04 +03:00
Ihor Radchenko f86a2fb726
org-element--string-cache: Use hash table instead of obarray
* lisp/org-element.el (org-element--string-cache): Change the value to
hash table.  Update the docstring.
(org-element--get-cached-string): Use hash table.

obarrays have a number of rough edges when used for purposes other
than interning symbols.  Using obarrays may cause unexpected problems
and hash tables are preferred.  Credit: Stefan Monnier.
2023-08-20 10:14:57 +03:00
Ihor Radchenko 7a4784b122
org-fast-tag-selection: Fix when C-g is pressed
* lisp/org.el (org-fast-tag-selection): Fix "no catch" error.  But do
not directly set `quit-flag' as it was done in the earlier versions.
Instead, call `keyboard-quit', allowing it to perform the necessary
cleanups.
2023-08-20 09:36:40 +03:00
Ihor Radchenko e17ca87994
Merge branch 'bugfix' 2023-08-20 09:30:59 +03:00
Ihor Radchenko 7b38670e69
fixup! org-insert-heading: Fix when folded text is kept right at the new heading
* lisp/org.el (org-insert-heading): Fix missing newline when inserting
before existing heading.
* testing/lisp/test-org.el (test-org/insert-heading): Add test
checking for the fixed failure.  Update tests.
(test-org/insert-todo-heading-respect-content): Update tests.

Reported-by: Max Nikulin <manikulin@gmail.com>
Link: https://orgmode.org/list/ubrugh$be1$1@ciao.gmane.io
2023-08-20 09:28:15 +03:00
Ihor Radchenko 35960e1614
org-babel-execute-subtree: Document the argument in the docstring
* lisp/ob-core.el (org-babel-execute-subtree): Clarify the meaning of
command argument in the docstring.
2023-08-19 12:47:53 +03:00
Ihor Radchenko 54f8b0bfd0
Merge branch 'bugfix' 2023-08-19 10:55:08 +03:00
Ihor Radchenko 52bc95676c
org-insert-heading: Fix when folded text is kept right at the new heading
* lisp/org.el (org-insert-heading): Do not slurp blank lines after
previous heading into the contents of the newly added one.  These
blank lines might be folded and we end up with point before folded
spaces * <point>...
* testing/lisp/test-org.el (test-org/insert-heading): Add test.
(test-org/insert-todo-heading-respect-content): Do not expect trailing
newline after the newly added heading.  The test did not intentionally
test this particular behavior (other tests do not expect trailing
newlines to be _always_ added).

Reported-by: Max Nikulin <manikulin@gmail.com>
Link: https://orgmode.org/list/ubpcoi$f7n$1@ciao.gmane.io
2023-08-19 10:52:25 +03:00
Ihor Radchenko 928f2d7fb0
Revert "org-return: Do not insert inside folded region"
This reverts commit a25d00d5df.

Direct call to `org-fold-check-before-invisible-edit' is no longer
necessary on main.  We use `org-fold-catch-invisible-edits-commands'.
2023-08-19 10:27:09 +03:00
Ihor Radchenko 73e332a307
Merge branch 'bugfix' 2023-08-19 10:27:00 +03:00
Ihor Radchenko a25d00d5df
org-return: Do not insert inside folded region
* lisp/org.el (org--newline): When called interactively, check for
invisible edits.

Reported-by: Kaiyu Zheng <kaiyu_zheng@alumni.brown.edu>
Link: https://orgmode.org/list/87wmxs8hxt.fsf@localhost
2023-08-19 10:23:40 +03:00
Ihor Radchenko 3cbd9f4233
org-lint: New checker for SCHEDULED/DEADLINE with inactive timestamp
* lisp/org-lint.el (org-lint-inactive-planning): Add new checker.

Link: https://orgmode.org/list/875y5tlouo.fsf@localhost
2023-08-18 15:21:10 +03:00
Ihor Radchenko 7cc208af91
org-agenda: Do not err on SCHEDULED/DEADLINE with inactive timestamp
* lisp/org-agenda.el (org-agenda-get-deadlines):
(org-agenda-get-scheduled): Ignore SCHEDULED/DEADLINE set to inactive
timestamps.  Previously, an error would be thrown.

Reported-by: Christian Barthel <bch@online.de>
Link: https://orgmode.org/list/875y5tlouo.fsf@localhost
2023-08-18 15:19:25 +03:00
Ihor Radchenko d560a2d739
org-lint-invalid-id-link: Only update ID locations if there are ID links
* lisp/org-lint.el (org-lint-invalid-id-link): Avoid running
`org-id-update-id-locations' when there are no ID links in the linted
file.
2023-08-18 15:18:50 +03:00
Ihor Radchenko 83fd03fb6d
org-attach: Fix when called from agenda
* lisp/org-attach.el (org-attach): Do not try to call `org-attach-dir'
from non-Org buffer.  This requires parser, which cannot run in agenda
buffer.
2023-08-18 13:24:13 +03:00
Ihor Radchenko 79aa149143
org-babel-map-executable: Describe header arg in the docstring
* lisp/ob-core.el (org-babel-execute-buffer): Mention in the docstring
how prefix argument is handled.
2023-08-18 13:15:10 +03:00
Juan Manuel Macias 2eb4fd8900
lisp/ox-latex.el: Add the `:literal' attribute to verse block.
* (org-latex-verse-block): Now the treatment of blank lines is
consistent with the syntax of the LaTeX `verse' environment, and the
one provided by the `verse' package.  If the `:literal' attribute is
used, all blank lines are preserved and exported as
`\vspace*{\baselineskip}', including the blank lines before or after
contents.  The rx code has been suggested by Ihor Radchenko, to
improve readability.

* doc/org-manual.org (Verse blocks in LaTeX export): The new feature
is documented.

* testing/lisp/test-ox-latex.el (test-ox-latex/verse): Updated.
2023-08-18 11:41:24 +03:00
Ihor Radchenko f1359546ad
org-element-at-point: Throw an error when not in org-mode
* lisp/org-element.el (org-element-at-point): Explicitly throw an
error when not in org-mode buffer.  The parser expects certain
buffer-local constants and may fail otherwise.  It is better to
indicate the problem explicitly instead of dealing with cryptic
generic errors.
(org-element-plain-list-interpreter):
* testing/lisp/test-ox.el (test-org-export/expand-include/links): Make
sure that we never invoke parser in non-Org buffers.
2023-08-18 11:11:17 +03:00
Ihor Radchenko 3ec0933122
Fix Emacs 27 test failure
* lisp/org-id.el (org-id-find-id-in-file): Work around change
functions not always firing up in Emacs 27 when using
`insert-file-contents'.
2023-08-18 11:10:12 +03:00
Ihor Radchenko 933d282881
Fix Emacs 27 false-positive warnings
* lisp/org-element-ast.el (org-element--plist-property): Shield
annoying warning spam with `with-no-warnings'.  The warnings are not
present in newer Emacs.
* lisp/org-element.el (org-element--interpret-affiliated-keywords):
Suppress warning about two token unused `_' arguments.
* lisp/org-id.el (org-id-find-id-in-file): Suppress warning about
number of arguments.
2023-08-18 11:08:56 +03:00
Ihor Radchenko 3b49db8755
Revert "Prefer `string-search' when matching exact strings"
This reverts commit e9110a8dd7.

`string-search' is not available in Emacs<28 and also always
case-sensitive.
2023-08-18 11:00:13 +03:00
Ihor Radchenko d0c7cd48eb
org-babel-do-key-sequence-in-edit-buffer: Mention argument in docstring
* lisp/ob-core.el (org-babel-do-key-sequence-in-edit-buffer): Mention
argument KEY in the docstring.
2023-08-17 15:54:20 +03:00
Ihor Radchenko 1ae611c7e3
fixup! org-id-find-id-in-file: Prefer using temporary buffer
* lisp/org-id.el (org-id-find-id-in-file): Fix Emacs 27 compatibility.
Avoid modifications not captured by element cache.
2023-08-17 15:45:13 +03:00
Ihor Radchenko d1e4b93519
org-copy-subtree: Do not consider inlinetask to be a subtree of its own
* lisp/org.el (org-copy-subtree): Go up to parent heading when we are
at or inside inlinetask.
2023-08-17 14:25:43 +03:00
Ihor Radchenko f285ae37b3
org-agenda-get-todos: Fix for todo keywords that can be interpreted as regexp
* lisp/org-agenda.el (org-agenda-get-todos): Use `regexp-quote' to
match keywords.
(org-select-this-todo-keyword): Add docstring, clarifying the allowed
values.
* testing/lisp/test-org-agenda.el (test-org-agenda/todo-selector): Add
new test.

Reported-by: spookygostee@gmail.com
Link: https://orgmode.org/list/87jztuzzpl.fsf@gmail.com
2023-08-17 14:15:14 +03:00
Jonathan Gregory f78a3c2bdc
lisp/ob-lilypond.el: Prevent full page results in basic-mode
* ob-lilypond.el (org-babel-lilypond-paper-settings): New variable.
* lisp/ob-lilypond.el (org-babel-lilypond-process-basic): Pass the new
variable value to correctly set paper size on the generated transcript.

Link: https://list.orgmode.org/87a5w15jur.fsf@localhost/

TINYCHANGE
2023-08-17 13:20:08 +03:00
Ihor Radchenko b2e34474f5
org-lint: Allow jumping outside narrowing when jumping to source
* lisp/org-lint.el (org-lint--jump-to-source): When buffer is
narrowed and the location to jump is outside the narrowing, widen.
2023-08-17 12:50:52 +03:00
Ihor Radchenko 2cf245810b
org-lint-invalid-id-link: Improve performance
* lisp/org-lint.el (org-lint-invalid-id-link): Do not try to search
for exact position of every ID.  Instead, sync all the ID locations
once and then make use of the up-to-date locations state to query if
an ID is present.
2023-08-17 12:49:59 +03:00
Ihor Radchenko 4cf0b0433d
org-id-find-id-in-file: Prefer using temporary buffer
* lisp/org-id.el (org-id-find-id-in-file): Use a temporary throwaway
Org buffer to lookup IDs when we do not need to keep the buffer.  This
speeds up updating IDs.
2023-08-17 12:48:52 +03:00
Ihor Radchenko cc435cba71
lisp/ob-core.el: Fix some docstrings that do not detail all the arguments
* lisp/ob-core.el (org-babel-initiate-session):
(org-babel-switch-to-session):
(org-babel-switch-to-session-with-code): Explain all the arguments in
the docstring.
2023-08-16 13:32:06 +03:00
Ihor Radchenko e4504853b5
Merge branch 'bugfix' 2023-08-16 11:43:12 +03:00
Ihor Radchenko 27a41d418d
org-element--cache-before-change: Fix edge case creating heading
* lisp/org-element.el (org-element--cache-before-change): Fix edge
case when a heading is created because we insert a newline right
before ****.
* testing/lisp/test-org-element.el (test-org-element/cache-headline):
Add tests.

Reported-by: Rodrigo Morales <moralesrodrigo1100@gmail.com>
Link: https://orgmode.org/list/CAGxMbPbbqc33iaqJ=EceyKrLaf4maJAxaUmJGaPOvG_Rpw+xcQ@mail.gmail.com
2023-08-16 11:41:31 +03:00
Ihor Radchenko 9fd547dd3a
org-babel-where-is-src-block-result: Fix inside affiliated parsed keyword
* lisp/ob-core.el (org-babel-where-is-src-block-result): Do not assume
that parent has contents-end and that we are inside contents, but not
inside secondary object/affiliated keyword.
*
testing/lisp/test-ob.el (test-ob/inline-src_blk-default-results-replace-line-1):
Add tests.

Reported-by: Tom Gillespie <tgbugs@gmail.com>
Link: https://orgmode.org/list/CA+G3_PNt7WqkCzChV+dx1FeSPgTEVkNSE41a3qC5wv3g+jTwrQ@mail.gmail.com
2023-08-16 11:07:20 +03:00
Ihor Radchenko 54c09c84e9
org-element-context: Fix when point is at the beginning of parsed value
* lisp/org-element.el (org-element-context): When point is at the
first point in parsed affiliated keyword value, do not return parent
"keyword".

Reported-by: Tom Gillespie <tgbugs@gmail.com>
Link: https://orgmode.org/list/CA+G3_PNt7WqkCzChV+dx1FeSPgTEVkNSE41a3qC5wv3g+jTwrQ@mail.gmail.com
2023-08-16 11:06:08 +03:00
Ihor Radchenko 99c8425bc7
org-babel-insert-result: Remove duplicate let-binding
* lisp/ob-core.el (org-babel-insert-result): Remove duplicate
computation of the INLINE value.
2023-08-16 11:05:31 +03:00
Ihor Radchenko 487f39efa6
org-babel-insert-result: Err on :results drawer inline src block
* lisp/ob-core.el (org-babel-insert-result): Throw an error when
trying to insert :results drawer in inline src blocks.
2023-08-16 11:04:14 +03:00
Ihor Radchenko 5496f5277f
org-babel-load-in-session: Document argument INFO
* lisp/ob-core.el (org-babel-load-in-session): Update the docstring,
describing what INFO argument does.
2023-08-15 14:50:58 +03:00
Ihor Radchenko 570cdacdbf
org-export-smart-quotes-alist: Turn into a custom option
* lisp/ox.el (org-export-smart-quotes-alist): Change to `defcustom'.
Fix typo in the value.  Add :type/:package-version/:group definitions.
* etc/ORG-NEWS (~org-export-smart-quotes-alist~ is now a custom
option): Announce the change.

Link: https://orgmode.org/list/871qg5bnfh.fsf@bzg.fr
2023-08-15 14:16:41 +03:00
Ihor Radchenko 1d04af59b6
org-refile-get-targets: Barf when target is not an Org buffer
* lisp/org-refile.el (org-refile-get-targets): Display error when
target buffer is not in Org mode.  If we do not manually throw an
error, local variables like `org-complex-heading-regexp' will not be
defined, and the user would see a lot more cryptic error.
2023-08-15 13:54:00 +03:00
Ihor Radchenko dcd2ba4a02
* lisp/org-macs.el: Declare `org-buffer-text-pixel-width' 2023-08-15 13:49:02 +03:00
Ihor Radchenko 6954fe93ed
org-store-link: Never allow link duplicates in `org-stored-links'
* lisp/ol.el (org-link-store-existing): Remove the previously added
custom option.
(org-store-link): Do not use `org-link-store-existing' removing all
the code branches for values other than 'move-to-front.
* etc/ORG-NEWS (~org-store-link~ now moves an already stored link to
front of the ~org-stored-links~): Remove reference to the removed
custom option.

Link: https://orgmode.org/list/87leeffd1z.fsf@localhost
2023-08-15 13:48:55 +03:00
Ihor Radchenko 1c00632f11
org-latex-compile--postprocess: Fix when OUTFILE has no directory
* lisp/ox-latex.el: Make sure that we do not pass nil to
`directory-files'.  Use `default-directory' when OUTFILE is like
"file.foo" without any directory component.
2023-08-15 13:13:44 +03:00
Ihor Radchenko 572d01ab7e
Merge branch 'bugfix' 2023-08-15 12:59:18 +03:00
Ihor Radchenko 561c1d0db0
org-element-at-point: Fix cache initialization in indirect buffer
* lisp/org-element.el (org-element-at-point): Always check cache
variable in base buffer.

Reported-by: Adam Beckmeyer <adam_git@thebeckmeyers.xyz>
Link: https://orgmode.org/list/E1qVc9n-0006Ti-92@rmmprod06.runbox
2023-08-15 11:52:26 +03:00
Ihor Radchenko e340dde63e
org-element-export-snippet-parser: Fix when no closing @@
* lisp/org-element.el (org-element-export-snippet-parser): Return nil
when there is no closing @@.
* testing/lisp/test-org-element.el (test-org-element/context): Add
test.

Reported-by: Tom Alexander <tom@fizz.buzz>
Link: https://orgmode.org/list/fb61ea28-f004-4c25-adf7-69fc55683ed4@app.fastmail.com
2023-08-15 11:37:37 +03:00
Ihor Radchenko b89bc55867
org-babel-insert-header-arg: Describe arguments in the docstring
* lisp/ob-core.el (org-babel-insert-header-arg): Fix the docstring,
describing when the arguments do.
2023-08-14 14:59:11 +03:00
Ihor Radchenko 34ee6f1a21
Merge branch 'bugfix' 2023-08-13 19:24:50 +03:00
Ihor Radchenko 99cc9619c5
org-bibtex-yank: Fix bibtex parser not initialized in temp buffer
* lisp/ol-bibtex.el (org-bibtex-yank): Make sure that we parse bibtex
entry from the kill ring in a `bibtex-mode' buffer.  Otherwise,
calling `org-bibtex-read' (that calls `bibtex-parse-entry') may err
because some Bibtex parser variables are not initialized.

Reported-by: J. G. <jerzor@pacbell.net>
Link: https://orgmode.org/list/1939460027.3272000.1691771671040@mail.yahoo.com
2023-08-13 19:21:48 +03:00