Commit Graph

18389 Commits

Author SHA1 Message Date
Kyle Meyer bd5a39e60e Merge branch 'bugfix' 2022-12-09 22:55:39 -05:00
Kyle Meyer 33d0263de8 Merge branch 'km/from-emacs-29' into bugfix 2022-12-09 22:52:09 -05:00
Stefan Kangas c056afc153 Backport commit 262670405 from Emacs
; Normalize GPLv3 license statements in new files
26267040549da6e7f8223bea3b5344d0d5bef527
Stefan Kangas
Fri Dec 9 00:13:00 2022 +0100
2022-12-09 22:50:54 -05:00
Stefan Kangas 1ce9da0048 Backport commit 8fb2afe05 from Emacs
; Fix typos
8fb2afe051168b2eac2bba0ee102039d0af90a05
Stefan Kangas
Thu Dec 8 07:17:47 2022 +0100
2022-12-09 22:49:40 -05:00
Ihor Radchenko 49cf3e3a7c
Merge branch 'bugfix' 2022-12-08 15:45:46 +03:00
Ihor Radchenko 34a8133715
Revert "lisp/ox-latex.el: put labels inside example blocks"
This reverts commit 304f18cb72.

This patch will break verbatim environment as the label will be
interpreted verbatim as well.
2022-12-08 15:44:58 +03:00
Ihor Radchenko 0baa75bb45
Merge branch 'bugfix' 2022-12-08 15:06:59 +03:00
Ihor Radchenko 8b6df19dc7
org-fold-core-get-regions: Search whole buffer when FROM and TO are nil
* lisp/org-fold-core.el (org-fold-core-get-regions): Fix non-intuitive
when FROM and TO are nil.  Update the docstring.

Reported-by: Daniel Mendler
2022-12-08 15:04:11 +03:00
Ihor Radchenko 697aa627ac
Merge branch 'bugfix' 2022-12-08 14:38:47 +03:00
Hugo Heagren 304f18cb72
lisp/ox-latex.el: put labels inside example blocks
* lisp/ox-latex.el (org-latex-example-block): Instead of
`org-latex--wrap-label', manually add label after
\begin{<environment>}.

This produces proper label resolution in LaTeX.  Labels before the
environment begins can be interpreted as referring to the surrounding
section.
2022-12-08 14:35:01 +03:00
Jeremie Juste 1ad16ffb95 ob-R.el: Restore the handling of org-list in as var
* ob-R.el (org-babel-R-assign-elisp): Use the patch from
ccberry@health.ucsd.edu, to print org-list as a one column table as it
was the case in release_9.5. The break in R is due commit b4e437f96 *
ob-core: Resolve named list references to simple lists.

* test-ob-R.el (ob-R-nested-list): New function to test that org list
with multiple level are handled as expected in R.

see https://list.orgmode.org/87bkofh0ir.fsf@localhost/ for context.
2022-12-07 22:06:40 +01:00
Ihor Radchenko c59d6d82e6
Merge branch 'bugfix' 2022-12-07 17:02:51 +03:00
Ihor Radchenko 97a780f0be
org-table-justify-field-maybe: Do not allow newlines inside cells
* lisp/org-table.el (org-table-justify-field-maybe): Remove newlines
from cell values, when present.  Newlines will alter the table cell
structure.

Reported-by: Julien Palard <julien@palard.fr>
Link: https://orgmode.org/list/638faf1b.050a0220.2bd96.904b@mx.google.com
2022-12-07 16:59:21 +03:00
Ihor Radchenko 0ccf1da3dd
Merge branch 'bugfix' 2022-12-07 16:07:00 +03:00
Ihor Radchenko 3176ed9052
org-persist: Never write data associated with encrypted files
* lisp/org-persist.el (org-persist-write): Do not write data
associated with gpg-encrypted files.  This will avoid data leakage.
(org-persist--storage-version): Bump storage version to invalidate
previously stored, potentially leaked, data.

Reported-by: Clément Pit-Claudel <clement.pitclaudel@live.com>
2022-12-07 16:05:21 +03:00
Ihor Radchenko 1f5afbbcfb
Merge branch 'bugfix' 2022-12-07 14:25:17 +03:00
Ihor Radchenko 5d14e88c51
org-make-tags-matcher: Fix regexp
* lisp/org.el (org-make-tags-matcher): Match
<now>/<today>/<tomorrow>/<+3d>/etc time queries.  They are allowed by
"11.3.3 Matching tags and properties" section of the manual.

Fixes regression from e022a0cea.

Reported-by: Carlo Tambuatco <oraclmaster@gmail.com>
Link: https://orgmode.org/list/87bkokgtd7.fsf@kyleam.com
2022-12-07 14:23:29 +03:00
Ihor Radchenko 06648d43e4
Merge branch 'bugfix' 2022-12-07 14:15:31 +03:00
Ihor Radchenko cc5427b7ef
org-babel-result-to-file: Fix results file inside attachment dir
* lisp/ob-core.el (org-babel-result-to-file): When file path in the
result contains attachment dir, reduce the path to relative file name
when generating attachment: link.
* testing/lisp/test-ob.el (test-ob-core/dir-attach): Add test.

Reported-by: Johan Tolö <johan@toloe.se>
Link: https://orgmode.org/list/875yesnia6.fsf@toloe.se
2022-12-07 14:13:49 +03:00
Ihor Radchenko dd499ccab8
Merge branch 'bugfix' 2022-12-07 13:52:17 +03:00
Ihor Radchenko 4dddbc1436
org-clock-update-time-maybe: Preserve point position better
* lisp/org-clock.el: Try harder to preserve point position upon
updating the clock line.  Even when `save-excursion' is not
sufficient.

Reported-by: Daniel Clemente <n142857@gmail.com>
Link: https://orgmode.org/list/CAJKAhPDVs5GRKR-cmyeNd5cQFHyKpw_=JptBzi1f0FYNTqqjzA@mail.gmail.com
2022-12-07 13:48:32 +03:00
Rudolf Adamkovič 78d283e27d
ob-core: Remove the confusing "result silenced" message
* lisp/ob-core.el (org-babel-execute-src-block): Do not say "result
silenced" after executing the source blocks with `:results none' to
avoid confusion with `:results silent'.
2022-12-05 14:26:46 +03:00
Yuval Langer c4de06ce10
lisp/org.el: Mention how to widen in docstrings of commands that do narrowing
lisp/org.el: (org-narrow-to-subtree, org-toggle-narrow-to-subtree,
org-narrow-to-block, org-narrow-to-element): Mention how to widen in
docstrings of commands that do narrowing.

TINYCHANGE
2022-12-05 14:21:27 +03:00
Stefan Kangas 81b083b083
Improve Swedish entry in org-export-dictionary
* lisp/ox.el (org-export-dictionary): Improve Swedish localization.
2022-12-04 16:27:33 +03:00
Ihor Radchenko f41ef345b6
Merge branch 'bugfix' 2022-12-04 16:19:47 +03:00
Ihor Radchenko 7e6b55b8fd
org-element--cache-active-p: Fix when cache is disabled in indirect buffers
* lisp/org-element.el (org-element--cache-active-p): Consider cache
disabled when any of the indirect buffers do not have modification
detection.  This can be important when one uses
`combine-after-change-calls' inside an indirect buffers disabling
`after-change-functions' temporarily in the indirect buffer.

Reported-by: Feng Shu <tumashu@163.com>
Link: https://orgmode.org/list/87359z8ssb.fsf@163.com
2022-12-04 16:10:25 +03:00
Ihor Radchenko 461eb2a0ec
org-fold-core-cycle-over-indirect-buffers: Fix missing indirect capture buffers
* lisp/org-fold-core.el (org-fold-core-cycle-over-indirect-buffers):
Fix logic detecting foreign `org-fold-core--indirect-buffers'.
`current-buffer' is not always at `car'.  Before this change, capture
buffers could be missed when cycling over indirect buffers causing
subtle bugs.

Reported-by: Alexandros Prekates <aprekates@posteo.net>
Link: https://orgmode.org/list/20221128122841.2246aa08@enous
2022-12-04 16:10:19 +03:00
Gerard Vermeulen 4af243166c
org-clock-clocktable-language-setup: Fix Dutch translation
* lisp/org-clock.el (org-clock-clocktable-language-setup): Use Rubriek
for "heading".  It is more accurate as "Hoofding" refers to newspaper
headline.  Add the missing translation for "Clock summary at".

TINYCHANGE

Link: https://orgmode.org/list/4057b0bb88604e0f1ac4d18e11bf60f5@posteo.net
2022-12-04 14:13:15 +03:00
Ihor Radchenko 53814a8068
Merge branch 'bugfix' 2022-12-02 14:01:25 +08:00
Ihor Radchenko 4564627415
org-babel-comit-with-output: Fix when prompt is emitted partially
* lisp/ob-comint.el (org-babel-comint-with-output): Do not rely on
output filter when detecting prompt lines.  Search for
`comint-prompt-regexp' in the full output after applying the filter.
This is needed when the filter is supplied with partial prompts.

Reported-by: Frédéric Santos <frederic.santos@u-bordeaux.fr>
Link: https://orgmode.org/list/877czca7oj.fsf@u-bordeaux.fr
2022-12-02 13:59:24 +08:00
Ihor Radchenko 9e9412919e
org-element: Prefer `org-element-with-disabled-cache' macro
* lisp/org-element.el (org-element--cache-verify-element):
(org-element-at-point-no-context): Use
`org-element-with-disabled-cache' instead of let-binding
`org-element-use-cache' variable.  The former is more reliable.
2022-12-02 13:26:56 +08:00
Kyle Meyer d122c2b5b4 ox-md: Tweak a defcustom type for compatibility with Emacs<28
* lisp/ox-md.el (org-md-toplevel-hlevel): Change the type from natnum
to integer, which is less accurate but compatible with all Emacs
versions that Org supports.

This is a follow-up to the recent port of 4b2f5425d.
2022-12-01 17:26:01 -05:00
Eli Zaretskii 3159ea296f Backport commit 8b3baadf6 from Emacs
* lisp/org-clock.el (org-x11idle-exists-p): Don't try to
invoke "command x11idle" on MS-Windows and MS-DOS.  This fixes a
hang during byte-compilation of Org.

Fix compilation of Org 9.6 on MS-Windows
8b3baadf671b7b3d5058808c4655eca8bd46015e
Eli Zaretskii
Thu Dec 1 14:40:47 2022 +0200
2022-12-01 17:25:59 -05:00
Mattias Engdegård 9b856c273f Backport commit 4b2f5425d from Emacs
* lisp/ob-clojure.el
(ob-clojure-babashka-command, ob-clojure-nbb-command):
Account for the possibility of nil (commands absent).
* lisp/org.el (org-safe-remote-resources):
* lisp/ox-md.el (org-md-toplevel-hlevel):
Fix incorrect or invalid types.

Fix types in various defcustom declarations
4b2f5425d7af1a6f992ad8ce0a4452a2e778815a
Mattias Engdegård
Thu Dec 1 13:03:19 2022 +0100

[km] The natnum change will be adjusted in an upcoming commit because
     natnum not available until Emacs 28.
2022-12-01 17:25:58 -05:00
Stefan Kangas c8ad9e4b28 Backport commit 8617edfff from Emacs
; Fix typos
8617edfffd07eb80561b4de6a37c5b0b5f442e07
Stefan Kangas
Wed Nov 30 16:59:41 2022 +0100
2022-11-30 17:19:12 -05:00
Mattias Engdegård 7ba099a3fd Backport commit c3466099c from Emacs
* lisp/org-element.el (org-element--get-node-properties):
Escape literal `+`.
* lisp/org-persist.el (org-persist-load:index):
Replace line-start with string-start when the latter is meant.

Org regexp style fixes
c3466099c5f44c52ec73a1bbbb2b42de6f29ac7f
Mattias Engdegård
Wed Nov 30 13:23:38 2022 +0100
2022-11-30 08:55:24 -05:00
Kyle Meyer 5fd5912fa4 ob-core: Silence byte-compiler warning
* lisp/ob-core.el (org-babel-read-list): Reflow docstring paragraph to
silence "docstring wider than 80 characters" warning.
2022-11-29 21:22:05 -05:00
Bastien b3da427ebb Update version numbers for the 9.6 release 2022-11-29 07:34:50 +01:00
Ihor Radchenko 9276219103
org-export--get-subtree-options: Do not jump to parent subtree
* lisp/ox.el: Never jump to parent heading even when point is at an
existing heading.
* testing/lisp/test-ox.el (test-org-export/get-subtree-options): Fix
test assuming that current subtree may include parent.

Reported-by: Kaushal Modi <kaushal.modi@gmail.com>
Link: https://orgmode.org/list/CAFyQvY3mxi4DRTS+W-AX7bFELVujqH4DODEYPy3hyGRRuMEPSw@mail.gmail.com
2022-11-27 16:48:44 +08:00
Ihor Radchenko eed4708b66
org-babel: Add new :results discard header argument
* lisp/ob-core.el (org-babel-result-cond): Unconditionally return nil
and suppress all the processing for :results discard.
(org-babel-common-header-args-w-values):
(org-babel-sha1-hash): Add the new value to know :results value list.
* doc/org-manual.org (Handling):
* etc/ORG-NEWS (New =:results discard= header argument): Document the
new value.

Reported-by: Daniel Ortmann <daniel.ortmann@oracle.com>
Link: https://orgmode.org/list/87tu2tjary.fsf@localhost
2022-11-27 08:32:51 +08:00
Ihor Radchenko b4e437f968
ob-core: Resolve named list references to simple lists
* lisp/ob-core.el (org-babel-read-list): Return a simple list instead
of list of lists.  Document this in the docstring.
* testing/lisp/test-ob-java.el (ob-java/read-return-list):
(ob-java/read-list-return-array):
(ob-java/read-return-list-with-package): Fix tests assuming previous
behavior.
* testing/lisp/test-ob.el (test-ob/simple-variable-resolution): Add
new tests.
* etc/ORG-NEWS (List references in source block variable assignments
are now proper lists): Document the change.

This commit fixes the broken promise in the manual section 16.4
Environment of a Code Block where the named references to lists should
be converted to simple lists consisting of the top-level items.

The inconsistency existed for a while and possibly lurked into some
third-party packages.  So, announcement in NEWS is required.

Reported-by: Alain.Cochard@unistra.fr
Link: https://orgmode.org/list/87pmdqfao4.fsf@localhost
2022-11-26 09:51:36 +08:00
Ihor Radchenko c72d5ee840
org-table-convert-refs-to-rc: Fix failing test
* lisp/org-table.el (org-table-convert-refs-to-an): Leave $0
references (current row) unchanged during conversion.
*
testing/lisp/test-org-table.el (test-org-table/org-table-convert-refs-to-an/2):
Re-enable the failing test.
2022-11-25 14:45:09 +08:00
Rudolf Adamkovič 5337a49f32
org.el: Use long option names when launching dvisvgm
* lisp/org.el (org-preview-latex-process-alist): Use long option names
when launching dvisvgm, optimizing for maintainability, instead of
brevity.  For example, use `--no-fonts' instead of `-n'.
2022-11-25 10:07:00 +08:00
Rudolf Adamkovič 52ebf6b45e
org.el: Compute bounds exactly when converting LaTeX output to SVG
* lisp/org.el (org-preview-latex-process-alist): Call `dvisvgm' with
`-e' (`--exact-bbox') instead of `-b min' (`--bbox=min') to measure
the exact bounds around visual glyphs, as opposed to using font
metrics, to avoid clipping at the edges.

Link: https://orgmode.org/list/m2v8n4w00w.fsf@me.com
2022-11-25 10:06:44 +08:00
Ihor Radchenko 670f68bea2
lisp/org-agenda.el: Obsolete unused `org-let' and `org-let2'
* lisp/org-agenda.el (org-let):
(org-let2):
* lisp/org-compat.el (org-let):
(org-let2): Move to org-compat and mark for removal.

P.S. Save the kittens!
2022-11-25 09:42:17 +08:00
Ihor Radchenko d4522dd4df
lisp/org.el: Fix toggling overlays in region
* lisp/org.el (org--inline-image-overlays): New function returning
overlays in region.
(org-toggle-inline-images): Respect BEG and END arguments when
determining presence of overlays.
(org-remove-inline-images): Clear up deleted overlays.

Reported-by: William Denton <wtd@pobox.com>
Link: https://orgmode.org/list/alpine.DEB.2.22.394.2211221559080.61289@shell3.miskatonic.org
2022-11-24 10:11:15 +08:00
Ihor Radchenko 1cdac8ef6a
* lisp/ob-eval.el (org-babel--get-shell-file-name): Update fixme 2022-11-24 09:49:09 +08:00
Kyle Meyer c75aec4e6c Merge branch 'km/from-emacs-master' 2022-11-23 15:13:24 -05:00
Stefan Kangas 529c2a3df1 Backport commit beaa2e495 from Emacs
; Fix typos (misspelled symbols)
beaa2e49530b8149d2c22cb5fa15b8d48f7937b6
Stefan Kangas
Mon Nov 21 15:20:11 2022 +0100
2022-11-23 15:09:24 -05:00
Rudolf Adamkovič 7f4d91040a
ox-html: Use accurate MathJax versions
* etc/ORG-NEWS (HTML export uses MathJax 3+ instead of MathJax 2):
* lisp/ox-html.el (org-html-mathjax-options): Mention Mathjax 4+
version support where applicable.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://orgmode.org/list/m28rk2k8so.fsf@me.com
2022-11-23 19:08:27 +08:00
Ihor Radchenko 89af7b11a4
org-sbe: Fix when the macro is expanded outside Org file
* lisp/ob-table.el (org-sbe): Do not try to execute code block during
macro expansion.
* testing/lisp/test-ob-table.el (test-ob-table/sbe): Uncomment the
test.  Update the expected return value.
2022-11-23 17:26:55 +08:00
Ihor Radchenko 07eced3639
org-make-parameter-alist: Change the argument name
* lisp/org-macs.el (org-make-parameter-alist): Change the argument
name to conventional PLIST, as the FIXME suggests.
2022-11-22 11:09:53 +08:00
Ihor Radchenko f995425d06
org-table-convert-region: Update docstring
* lisp/org-table.el (org-table-convert-region): Mention when an error
can be thrown in the docstring.
2022-11-22 10:11:33 +08:00
Stefan Kangas f78dfea63d
Remove 'org-speed-commands-user' warning
* lisp/org-keys.el (org-speed-command-help): Remove
'org-speed-commands-user' warning.
2022-11-21 19:42:43 +08:00
Kyle Meyer aed55381bd Merge branch 'km/from-emacs-master' 2022-11-20 22:30:47 -05:00
Stefan Kangas 2e0fcc14e2 Backport commit ba485eb94 from Emacs
; Fix typos
ba485eb949ddec53b1d7b5d78f3fcfbe2be60d7d
Stefan Kangas
Fri Nov 18 16:02:19 2022 +0100
2022-11-20 22:26:22 -05:00
Juanma Barranquero c53d752e61 Backport commit 623db40dd from Emacs
* lisp/ol.el (org-link-search-must-match-exact-headline):
* lisp/org-faces.el (org-column): Fix typos in docstrings.

; * lisp/*.el: Fix typos in docstrings
623db40dd1cd21623c5cecdc0abbf3ce885f92b1
Juanma Barranquero
Thu Nov 17 08:48:02 2022 +0100
2022-11-20 22:20:12 -05:00
Rudolf Adamkovič 62e1513b5a
ox-html: Update from MathJax 2 to MathJax 3+
* lisp/ox-html.el (
org-html-mathjax-options,
org-html-mathjax-template,
org-html--build-mathjax-config
): Update from MathJax 2 to 3 while maintaining compatibility.  All
legacy options should continue to work, except for the 'path' option
which must now point to MathJax 3 or later.
* testing/lisp/test-ox-html.el (
ox-html/mathjax-path-none,
ox-html/mathjax-path-default,
ox-html/mathjax-path-custom,
ox-html/mathjax-path-in-buffer,
ox-html/mathjax-options-default,
ox-html/mathjax-options-custom,
ox-html/mathjax-options-in-buffer,
ox-html/mathjax-legacy-scale-default,
ox-html/mathjax-legacy-scale-custom,
ox-html/mathjax-legacy-scale-in-buffer,
ox-html/mathjax-legacy-scale-message,
ox-html/mathjax-legacy-scale-message-in-buffer,
ox-html/mathjax-legacy-scale-ignore,
ox-html/mathjax-legacy-autonumber-ams,
ox-html/mathjax-legacy-autonumber-ams-in-buffer,
ox-html/mathjax-legacy-autonumber-none,
ox-html/mathjax-legacy-autonumber-none-in-buffer,
ox-html/mathjax-legacy-autonumber-all,
ox-html/mathjax-legacy-autonumber-all-in-buffer,
ox-html/mathjax-legacy-autonumber-message,
ox-html/mathjax-legacy-autonumber-message-in-buffer,
ox-html/mathjax-legacy-font-tex,
ox-html/mathjax-legacy-font-tex-in-buffer,
ox-html/mathjax-legacy-font-stix-web,
ox-html/mathjax-legacy-font-stix-web-in-buffer,
ox-html/mathjax-legacy-font-asana-math,
ox-html/mathjax-legacy-font-asana-math-in-buffer,
ox-html/mathjax-legacy-font-neo-euler,
ox-html/mathjax-legacy-font-neo-euler-in-buffer,
ox-html/mathjax-legacy-font-gyre-pagella,
ox-html/mathjax-legacy-font-gyre-pagella-in-buffer,
ox-html/mathjax-legacy-font-gyre-termes,
ox-html/mathjax-legacy-font-gyre-termes-in-buffer,
ox-html/mathjax-legacy-font-latin-modern,
ox-html/mathjax-legacy-font-latin-modern-in-buffer,
ox-html/mathjax-legacy-line-breaks-true,
ox-html/mathjax-legacy-line-breaks-true-in-buffer,
ox-html/mathjax-legacy-line-breaks-false,
ox-html/mathjax-legacy-line-breaks-false-in-buffer,
ox-html/mathjax-legacy-line-breaks-message,
ox-html/mathjax-legacy-line-breaks-message-in-buffer): Test MathJax in
general and also the conversion of legacy options from MathJax 2 to 3.
* testing/org-test.el (org-test-capture-messages): Add a new macro
useful for testing the messages put in the echo area.
* etc/ORG-NEWS: Document MathJax 2 to 3 upgrade, highlighting the
benefits of the new version but also mentioning the fact that the user
may need to update the `path' option in `org-html-mathjax-options'.
* doc/org-manual.org (Math formatting in HTML export): Update the link
to the MathJax CDN and the example of how to use `+HTML_MATHJAX' with
MathJax 3.  Also, remove the note on MathJax extensions, as they did
not work (and do not work) as documented.

Link: https://list.orgmode.org/orgmode/m2a667n4ax.fsf@me.com/
2022-11-21 10:44:56 +08:00
Ihor Radchenko 1d985406d8
Revert "ob-core: Do not limit table size in babel output"
This reverts commit 5347f4c75a.

`org-table-convert-region-max-lines' has been introduced explicitly
for the problem of babel output.  Therefore the commit was against the
established logic.  A different approach needs to be used to tackle
the reported problem.
2022-11-20 13:19:43 +08:00
Ihor Radchenko 5347f4c75a
ob-core: Do not limit table size in babel output
* lisp/ob-core.el (org-babel-import-elisp-from-file): Do not limit the
maximum possible resulting table to
`org-table-convert-region-max-lines'.

Reported-by: Daniel Ortmann <daniel.ortmann@oracle.com>
Link: https://orgmode.org/list/b7021ff3-60d7-863a-5579-dff60f7e1337@oracle.com
2022-11-20 13:15:44 +08:00
Ihor Radchenko 4c40fc3d4d
org: Allow spaces in #+LINK abbreviation definitions
* lisp/org.el (org-set-regexps-and-options): Allow spaces when
defining link abbreviations via #+LINK keyword.
* testing/lisp/test-org-element.el (test-org-element/link-parser): Add
a new test.
* doc/org-manual.org (Link Abbreviations): Add example demonstrating
link abbreviation with spaces.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://orgmode.org/list/87zgf7zujc.fsf@localhost
2022-11-20 13:15:02 +08:00
Juan Manuel Macias fcf63fb31e
lisp/ox-latex.el: fix `org-latex-guess-babel-language'
* (org-latex-guess-babel-language): If the user puts a string other
than AUTO as an argument to `\babelprovide', it gives an error when
exporting. For example:

`#+LaTeX_Header: \babelprovide[onchar=ids,import]{hebrew}'
2022-11-18 16:28:24 +08:00
Ihor Radchenko 70cee1810b
lisp/ox.el: Fix compiler warning
* lisp/ox.el (org-export--parse-option-keyword): Remove unused
variable.
2022-11-17 13:43:19 +08:00
Ihor Radchenko ad62379984
org-export: Allow "string with spaces" as #+OPTIONS: values
* lisp/ox.el (org-export--parse-option-keyword): Allow `read'ing the
option value as far as needed.  Do not restrict the value to the first
whitespace only.  This way, one can use Elisp strings with all the
escaping options as values.
* testing/lisp/test-ox.el (test-org-export/parse-option-keyword): Add
test for option value with a space inside.

Reported-by: Pierre Balayé <pierrebalaye@gmail.com>
Link: https://list.orgmode.org/orgmode/CANpQAF-n+4xhNvL8aaP8j2gJ70vbu80wmh9a4Oj0BxNHA5-yDA@mail.gmail.com/
2022-11-17 12:49:29 +08:00
Ihor Radchenko 5c247fb27b
org-html-postamble: Clarify that string value is format string
* lisp/ox-html.el (org-html-postamble): Clarify that string value of
the variable is not inserted verbatim, but used as format string.

Reported-by: Tim Cross <theophilusx@gmail.com>
Link: https://orgmode.org/list/86wn8gbvk0.fsf@gmail.com
2022-11-16 12:47:59 +08:00
Ihor Radchenko 84b4878680
ox-html: Do not allow `org-html-preamble' to be 'auto
* lisp/ox-html.el (org-html--build-pre/postamble): Avoid building
date/author/email info line when `org-html-preamble' is set to
'auto.  This is only meaningful in `org-html-postamble'.
2022-11-16 12:47:58 +08:00
Ihor Radchenko d094135388
ob-octave: Fix octave :results value parsing
* lisp/ob-octave.el (org-babel-octave-wrapper-method): Use fdisp
instead of fprintf.

Reported-by: Alexandre Duret-Lutz <adl@lrde.epita.fr>
Link: https://orgmode.org/list/217078597.347872.1639979694777@email.ionos.de
2022-11-16 12:42:58 +08:00
Kyrylo Simonov 00778ce2a6
Fix missing customization groups
* lisp/ob-tangle.el (org-babel-tangle): Add missing group definition.
(org-babel-post-tangle-hook):
(org-babel-pre-tangle-hook):
(org-babel-tangle-body-hook):
(org-babel-tangle-finished-hook):
(org-babel-tangle-comment-format-beg):
(org-babel-tangle-comment-format-end):
(org-babel-tangle-uncomment-comments):
(org-babel-process-comment-text):
(org-babel-tangle-default-file-mode): Move under `org-babel-tangle'
group.
* lisp/ol-bbdb.el (org-bbdb-anniversaries): Move under `org-agenda'
instead of a non-existent `org-bbdb'.
* lisp/ol-bibtex.el (org-bibtex): Add missing group definition.
* lisp/ol-gnus.el (org-gnus-no-server): Move under group
`org-link-follow' instead of a non-existent `org-gnus'.
* lisp/org-plot.el (org-plot): Add missing group definition.
* lisp/org.el (org-startup): Add missing group definition.
* lisp/ox-latex.el (org-latex-pdf-process): Move under
`org-export-latex' instead of a non-existent `org-export-pdf'.
* lisp/ox-man.el (org-man-pdf-process): Remove reference to
non-existent group `org-export-pdf'.

TINYCHANGE
2022-11-16 09:59:44 +08:00
Max Nikulin 08a8c9e678
org-attach.el: ID to path functions may return nil
* lisp/org-attach.el (org-attach-dir-from-id): Ignore nil values
returned by entries from `org-attach-id-to-path-function-list'.
(org-attach-dir-get-create): Signal an error suggesting customization
of `org-attach-id-to-path-function-list' if all ID-to-path functions
return nil.
(org-attach-id-to-path-function-list): Add to the docstring examples
how to handle unusual IDs.
(org-attach-id-uuid-folder-format, org-attach-id-ts-folder-format):
Return nil if ID is too short.
(org-attach-id-fallback-folder-format): New function that may be added
as the last element of `org-attach-id-path-function-list' to handle
unexpectedly short IDs.
* etc/ORG-NEWS: Advertise the change.

Earlier an obscure error like 'org-attach-id-ts-folder-format: Args out
of range: "ftt", 0, 6' was signalled in the case of unexpectedly short
ID.

Reported-by: Janek F <xerusx@pm.me>
Link: https://list.orgmode.org/KC8PcypJapBpJQtJxM0kX5N7Z0THL2Lq6EQjBMzpw1-vgQf72egZ2JOIlTbPYiqAVD4MdSBhrhBZr2Ykf5DN1mocm1ANvvuKKZShlkgzKYM=@pm.me
2022-11-16 09:47:03 +08:00
Ihor Radchenko 21413d3589
org-clock-report: Improve docstring
* lisp/org-clock.el (org-clock-report): Clarify :scope when called
from inside a heading or before first heading.  Separate :scope
description into a separate paragraph.

Reported-by: Uwe Brauer <oub@mat.ucm.es>
Link: https://orgmode.org/list/87h6z2c8pf.fsf@mat.ucm.es
2022-11-16 09:26:03 +08:00
Ihor Radchenko de2d2d928f
ob-python: Wait for session initialization on slow machines
* lisp/ob-python.el (org-babel-python--initialized): New internal flag
used to indicate that python session has been initialized in buffer.
(org-babel-python-initiate-session-by-key): Set
`org-babel-python--initialized' in `python-shell-first-prompt-hook'
when using built-in python.el.  Wait until the hook is fired before we
finish initiating the session.

This patch intends to fix CI test failures where the CPU allocation is
limited and python loading is extremely slow.
2022-11-15 11:39:04 +08:00
Ihor Radchenko 4f88116e52
org-fold-subtree: Hide blank lines at the end as well
* lisp/org-fold.el (org-fold-subtree): Hide blank lines before the
next subtree as well.  Add docstring.

Reported-by: Alexandros Prekates <aprekates@posteo.net>
Link: https://orgmode.org/list/20221114020008.03f40695@enous
2022-11-14 12:22:03 +08:00
Kyle Meyer 77d35c4eec Silence byte-compiler under 'make single'
The org-list and org-priority warnings would show up when these
changes made their way to the Emacs repo.  (The ob-eval warning
wouldn't because string-empty-p has been moved to simple.el in Emacs's
master branch.)
2022-11-13 18:01:00 -05:00
Kyle Meyer e4ed6c92b4 Merge branch 'km/from-emacs-master' 2022-11-13 17:37:11 -05:00
Stefan Kangas 801ca4c6d0 Backport commit 0f5352377 from Emacs
* lisp/org-ctags.el:
* lisp/org-protocol.el: Remove redundant installation instructions
for packages bundled with Emacs.

Remove redundant library installation instructions
0f5352377539bc2587b9bfd068de0f4b3bf8b248
Stefan Kangas
Fri Nov 11 04:29:29 2022 +0100
2022-11-13 17:32:10 -05:00
Ihor Radchenko 5a10517d02
Add missing :package-version tags in changed `defcustom'
* lisp/ob-clojure.el (ob-clojure-babashka-command):
(ob-clojure-nbb-command):
* lisp/ob-exp.el (org-babel-exp-code-template):
* lisp/ob-latex.el (org-babel-latex-pdf-svg-process):
* lisp/org-agenda.el (org-agenda-show-outline-path):
* lisp/org-capture.el (org-capture-templates):
* lisp/org-clock.el (org-clocktable-defaults):
* lisp/org-persist.el (org-persist-directory):
(org-persist-remote-files):
(org-persist-default-expiry):
* lisp/org-refile.el (org-refile-use-outline-path):
* lisp/org-src.el (org-src-lang-modes):
* lisp/org.el (org-resource-download-policy):
(org-safe-remote-resources):
(org-time-stamp-custom-formats):
(org-property-separators):
(org-preview-latex-process-alist):
(org-structure-template-alist):
* lisp/ox-latex.el (org-latex-inline-image-rules):
(org-latex-src-block-backend):
(org-latex-engraved-options):
(org-latex-engraved-theme):
* lisp/ox-md.el (org-md-toplevel-hlevel):
* lisp/ox-texinfo.el (org-texinfo-with-latex): Add :package-version
keywords to the new custom options, and those with the value or
meaning changed.
2022-11-13 15:29:15 +08:00
Ihor Radchenko f83e45526b
org-toggle-item: Move footnote-definitions out of the lists
* lisp/org-list.el (org-toggle-item): When headings contain
footnote-definitions, move them out of the list.  Footnote-definitions
must not be indented and hence cannot belong to the list.  Ensure that
definitions do not slurp the following element after the list.
Consider when the list created by `org-toggle-item' is continued by an
existing list.
* testing/lisp/test-org-list.el (test-org-list/toggle-item): Add
tests.

Reported-by: Ypo <ypuntot@gmail.com>
Link: https://orgmode.org/list/877d3k70lu.fsf@localhost
2022-11-11 13:19:01 +08:00
Ihor Radchenko 4517fba441
org-html-htmlize-output-type: Mark safe as buffer-local
* lisp/ox-html.el (org-html-htmlize-output-type): This variable is
safe to set buffer-locally as a symbol.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://orgmode.org/list/m28ruxklo5.fsf@me.com
2022-11-11 11:31:58 +08:00
Ihor Radchenko 10e857d428
org-babel-read: Obey `org-confirm-babel-evaluate'
* lisp/ob-core.el (org-babel-read): Do not execute arbitrary Elisp
without prompt, according to `org-confirm-babel-evaluate'.

Reported-by: Max Nikulin <manikulin@gmail.com>
Link: https://orgmode.org/list/tjct9e$179u$1@ciao.gmane.io
2022-11-10 13:52:56 +08:00
Ihor Radchenko 51bb222260
ob-tangle: Update docstrings
* lisp/ob-tangle.el (org-babel-tangle-file):
* lisp/ob-tangle.el (org-babel-tangle): Clarify return values.
2022-11-10 13:36:01 +08:00
Ilya Chernyshov 6c285af9fb
ox-icalendar: Create export backend options for deadline/scheduled-summary-prefix defcustoms
ox-icalendar.el (org-export-define-derived-backend):

Add export backend options:
:deadline-summary-prefix
:scheduled-summary-prefix

ox-icalendar.el (org-icalendar-entry):

Use :deadline-summary-prefix export backend option instead of
`org-icalendar-deadline-summary-prefix'.  If the option is not
explicitly set, use the value of the custom variable.

Use :scheduled-summary-prefix export backend option instead of
`org-icalendar-scheduled-summary-prefix'.  If the option is not
explicitly set, use the value of the custom variable.

Convert `deadline/scheduled-summary-prefix' string to iCal-compatible
format via `(org-icalendar-cleanup-string)'

TINYCHANGE
2022-11-10 10:38:06 +08:00
Bruno BARBIER 620a96dd68
org-babel-insert-result: Avoid errors in `unwind-protect' unwindforms
lisp/ob-core.el (org-babel-insert-result): Don't reset the marker
`end' if it is not defined.  Such scenario happens when
`unwind-protect' BODY forms throw an error.

Reported-by: Bruno Barbier <perso.bruno.barbier@free.fr>
Link: https://orgmode.org/list/E1osecc-00046e-UI@lists.gnu.org
2022-11-09 14:40:37 +08:00
Bruno BARBIER 7f72807aea
lisp/ob-haskell.el: Fix org-babel-script-escape expects a string
* lisp/ob-haskell.el (org-babel-interpret-haskell): Don't call
`org-babel-script-escape' when the result is nil.
2022-11-09 10:34:03 +08:00
Ihor Radchenko 8a827437a5
org--at-headline-data-p: Fix when at :post-blank after heading
* lisp/org.el (org--at-headline-data-p): Fix infinite loop when within
blank lines after empty heading.

Reported-by: David Lukeš <dafydd.lukes@gmail.com>
Link: https://orgmode.org/list/CAEPTPEw9hugOWmzhNWCzCeXzV_qNePAdz4BbOp_sanTH9ZJ+AA@mail.gmail.com
2022-11-08 21:18:42 +08:00
Bruno BARBIER 0de063a521
org-babel-interpret-haskell: Don't remove outputs that match inputs
* lisp/ob-haskell.el (org-babel-interpret-haskell): Change the call to
`org-babel-comint-with-output'.
2022-11-07 15:23:05 +08:00
Ihor Radchenko e3a7c01874
Refactor `org-time-stamp-custom-formats' and `org-time-stamp-formats'
* lisp/org.el (org-time-stamp-formats):
* lisp/org.el (org-time-stamp-custom-formats): Change the default
values stripping leading "<" and trailing ">".  Update the docstring
explaining the format and that leading and trailing brackets are now
ignored.  Update the :type specification to more precise.
(org-time-stamp-format): Update the argument list and docstring
allowing to use the function more flexibly to find the time stamp
format for both `org-time-stamp-formats' and
`org-time-stamp-custom-formats'.  Rename `long' argument to more
accurate `with-time'.  Ignore brackets in the `org-time-stamp-formats'
and `org-time-stamp-custom-formats'.  Allow `inactive' argument to be
`no-brackets'
(org-format-timestamp):
(org-read-date-display):
(org-insert-time-stamp):
(org-display-custom-time):
(org-timestamp-translate):
* lisp/org-compat.el (org-timestamp-format): Rename
`org-timestamp-format' to `org-format-timestamp'.  The old variant is
too similar with other `org-time-stamp-format' function.  Also, use
`org-time-stamp-format' to determine the timestamp format instead of
using `org-time-stamp-formats' directly.
* lisp/ol.el (org-store-link):
* lisp/org-agenda.el (org-agenda-get-timestamps):
(org-agenda-get-progress):
* lisp/org-archive.el (org-archive-subtree):
(org-archive-to-archive-sibling):
* lisp/org-clock.el (org-clock-special-range):
* lisp/org-colview.el (org-colview-construct-allowed-dates):
* lisp/org-element.el (org-element-timestamp-interpreter):
* lisp/org-macro.el (org-macro--find-date):
* lisp/org-pcomplete.el (pcomplete/org-mode/file-option/date):
* lisp/ox-odt.el (org-odt--format-timestamp):
(org-odt-template):
* lisp/ox.el (org-export-get-date):
* testing/lisp/test-org.el (test-org/timestamp-format): Use
`org-time-stamp-format' instead of directly examining
`org-time-stamp-custom-formats' and `org-time-stamp-formats'.  Use the
new function name `org-format-timestamp'.
* etc/ORG-NEWS (Default values and interpretations of ~org-time-stamp-formats~ and ~org-time-stamp-custom-formats~ are changed):
(~org-timestamp-format~ is renamed to ~org-format-timestamp~):
(Updated argument list in ~org-time-stamp-format~): Document the
user-facing changes.

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

Reported-by: Uwe Brauer <oub@mat.ucm.es>
Link: https://orgmode.org/list/87k04ppp1t.fsf@localhost
2022-11-07 15:05:37 +08:00
Adam Porter 155dc778e8
* lisp/org.el: (org-get-indirect-buffer) Allow indirect base buffers
Previously, calling this function on an indirect buffer would fail,
preventing the user from making a new indirect buffer based on an
indirect buffer (e.g. imagine the user makes an indirect buffer for a
large subtree, then wants to make another one for a subtree of that).
Now, the base buffer of the buffer is used, when applicable.

Also, the function is partially rewritten to be clearer, and a
docstring is added.

Link: https://orgmode.org/list/8b2c1814-2c6f-fdca-8ba7-63c415bfca5e@alphapapa.net
2022-11-07 11:16:08 +08:00
Daniel Ziltener 5e0c5c186d
org-babel: Add new "strip-tangle" :noweb argument value
* lisp/ob-tangle.el (org-babel-tangle-single-block): Strip noweb tags
from block if :noweb has been set to "strip-tangle".
* lisp/ob-core.el (org-babel-common-header-args-w-values): Add
"strip-tangle" as new allowed value.
* lisp/ob-core.el (org-babel-noweb-p): Add "strip-tangle" at the
appropriate positions.
* testing/lisp/test-ob-tangle.el (ob-tangle/strip-tangle): Add new test
case for "strip-tangle".
* doc/org-manual.org (Noweb Reference Syntax): Adjust documentation for
the noweb header argument.
* etc/ORG-NEWS: Add entry for new header argument value.

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

TINYCHANGE
2022-11-07 10:54:13 +08:00
Ihor Radchenko 26a2811b06
org-cite-basic-export-bibliography: Skip missing bibliography keys
* lisp/oc-basic.el (org-cite-basic-export-bibliography): Ignore
citation keys that are not present in bibliography.  Previously, an
error was thrown.
2022-11-06 15:44:44 +08:00
Leo Butler 9abf1b5167
lisp/ob-maxima.el: correct placement of $ in command string
* ob-maxima.el (org-babel-maxima:execute): Commit 6156b57bdf fixed a
quoting problem encountered on windows. However, the dollar sign ($)
is part of the maxima command string and needs to be escaped on
gnu/linux.

Reported by: Eric Fraga
Ref:
https://list.orgmode.org/950eb41c-1c8a-c891-af8d-276f6a452eaa@electrum-bikes.pl/T/#m4b5a54551604e5b3ec21f317c4a31b547ccada68

TINYCHANGE
2022-11-06 10:51:06 +08:00
Ihor Radchenko 946abeb49a
org-sting-width: Do no err in dedicated windows
* lisp/org-macs.el (org-string-width): Do not err when current window
is dedicated.  Force-remove dedicated status temporarily during the
call.  This should be safe as we only need to take over the window
temporarily to hook into Emacs display and calculate the string
width.

Reported-by: Bruno BARBIER <brubar.cs@gmail.com>
Link: https://orgmode.org/list/63662793.5d0a0220.62647.3003@mx.google.com
2022-11-05 17:38:37 +08:00
Ihor Radchenko 3e010d81dc
org-element-adopt-elements: Skip nil children
* lisp/org-element.el (org-element-adopt-elements): Ignore nil
children instead of throwing an error.

Reported-by: Alain.Cochard@unistra.fr
Link: https://orgmode.org/list/25445.34286.700495.260710@gargle.gargle.HOWL
2022-11-05 12:02:02 +08:00
Ihor Radchenko a3b9bb8faa
org-lint: Fix #+INCLUDE keyword parsing
* lisp/org-lint.el (org-lint-wrong-include-link-parameter): Use
non-greedy regexp to parse included file name.

Reported-by: gerard.vermeulen@posteo.net
Link: https://orgmode.org/list/ceef41267fcb44cdcbd7986f599bf332@posteo.net
2022-11-05 11:31:37 +08:00
Ihor Radchenko 0d60013f0e
org-attach-attach: Fix when `org-attach-store-link-p' is t
* lisp/org-attach.el (org-attach-attach): Store link to the original
file location when `org-attach-store-link-p' is set to t, as promised
by the variable docstring.
2022-11-05 11:00:15 +08:00
Ihor Radchenko 094ee4490d
org-attach-store-link-p: Explain all the values in the docstring
* lisp/org-attach.el (org-attach-store-link-p): Detail what each of
the allowed values mean, in addition to the :type tags.
2022-11-05 11:00:14 +08:00
Rudolf Adamkovič f7b16402e6
org-babel: Never throw away standard error
* lisp/ob-eval.el (org-babel-eval-error-notify): Do not insert
superfluous whitespace.
* lisp/ob-eval.el (org-babel-eval): Show standard error even if the
command exits with a zero code.
* testing/lisp/test-ob-shell.el(
ob-shell/standard-output-after-success,
ob-shell/standard-output-after-failure,
ob-shell/error-output-after-success,
ob-shell/error-output-after-failure,
ob-shell/error-output-after-failure-multiple,
ob-shell/exit-code,
ob-shell/exit-code-multiple
): Add tests to avoid regressions.
2022-11-04 10:48:38 +08:00
Ihor Radchenko 2924c77848
org-compat: Add missing argument to `connection-local-get-profiles'
* lisp/org-compat.el (with-connection-local-variables): Add missing
required argument to the `connection-local-get-profiles' call.

Reported-by: Max Nikulin <manikulin@gmail.com>
Link: https://orgmode.org/list/tk0pjd$ebo$1@ciao.gmane.io
2022-11-04 10:41:59 +08:00
Bastien bd468136dd lisp/ob-sql.el: Add Daniel Kraus as the maintainer 2022-11-03 09:27:36 +01:00
Rudolf Adamkovič 17425599cf
ob-latex: Call Inkscape with descriptive arguments
* lisp/ob-latex.el (org-babel-latex-pdf-svg-process): Use descriptive
arguments, such as '--export-area-drawing' instead of '-D', to
optimize for readability and not brevity (which makes sense for
interactive use, which does not apply here).
2022-11-03 15:27:49 +08:00
Rudolf Adamkovič aaccbb2f98
ob-latex: Export the full area of the drawing
* lisp/ob-latex.el (org-babel-latex-pdf-svg-process): Add the argument
-D (--export-area-drawing) to avoid sub-point cuts on hi-DPI screens,
where Inkscape sometimes cuts off a single physical pixel from the
exported drawing.
2022-11-03 15:27:48 +08:00
Ihor Radchenko 210630e546
org-odt-link: Fix relative file links
* lisp/ox-odt.el (org-odt-link): Append an extra "../" to relative
links.  This is needed to conform with OpenOffice convention to treat
base path inside the odt archive.  The path containing the odt file is
thus "../".

Reported-by: Ihor Radchenko <yantar92@posteo.net>
Link: https://orgmode.org/list/87ilkc30wd.fsf@localhost
2022-11-03 14:18:36 +08:00
Ihor Radchenko 5bc6741a5a
org-clock-update-time-maybe: Update the containing timestamps as well
* lisp/org-clock.el (org-clock-update-time-maybe): Update the
containing timestamps inside the clock, not only the clock sum.

Reported-by: Bruce E. Robertson <brucer42@gmail.com>
Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=53393
2022-11-01 15:52:25 +08:00
Ihor Radchenko 9987451252
org-babel-execute-src-block: Do not err on virtual src blocks
* lisp/ob-core.el (org-babel-execute-src-block): Handle no block at
point.  Do not err when block info does not have position data.

Reported-by: Alan Schmitt <alan.schmitt@polytechnique.org>
Link: https://orgmode.org/list/87r0yol8kp.fsf@m4x.org
2022-11-01 10:12:54 +08:00
Daniel Kraus fbbc8b55cf
ob-sql.el: Respect all params when using dbconnection
* etc/ORG-NEWS (Miscellaneous): Document the change.
* lisp/ob-sql.el (org-babel-find-db-connection-param): Make it
possible to overwrite parameters that are set from :dbconnection.
2022-11-01 09:55:35 +08:00
Ihor Radchenko 5dc8ea0abe
org-paste-subtree: Fix when `kill-ring' is empty
* lisp/org.el (org-paste-subtree): Allow pasting from system
clipboard.
2022-11-01 09:41:38 +08:00
Ihor Radchenko 33cbb11d5a
org-kill-is-subtree-p: Handle clipboard
* lisp/org.el (org-kill-is-subtree-p): Allow `current-kill' to return
clipboard (even when `kill-ring' is empty).  Do not throw error when
clipboard is also empty.
2022-11-01 09:28:48 +08:00
Max Nikulin 57abbd4b92
org.el: Fix first call of `org-paste-subtree'
* lisp/org.el (org-paste-subtree): Do not check `kill-ring' before
calling `current-kill' since the latter can pull content of clipboard.

First call of `org-paste-subtree' failed if nothing had been yanked
before since Emacs start but system clipboard had text with valid
subtree originating from other application.  The bug was where since
the commit adding `org-paste-subtree'.

If both `kill-ring' and system clipboard are empty then `current-kill'
generates meaningful error.
2022-11-01 09:26:50 +08:00
Ihor Radchenko 6ef33b6dd6
org-latex-src-block--listings: Put options within lstlisting environment
* lisp/ox-latex.el (org-latex-src-block--listings): Do not use global
\lstset to set options.  Prefer optional argument to lstlisting
environment instead.

Reported-by: Denis Bitouzé <denis.bitouze@univ-littoral.fr>
Link: https://orgmode.org/list/87pmepvb7u.fsf@example.com
2022-10-31 16:15:11 +08:00
Ihor Radchenko c12175003a
org-ctags: Fix interactive calls to `visit-tags-table'
* lisp/org-ctags.el (org-ctags-get-filename-for-tag):
(org-ctags-all-tags-in-current-tags-table):
(org-ctags-rebuild-tags-file-then-find-tag): Fix the calls.
2022-10-31 14:22:40 +08:00
Ihor Radchenko 2ab762e93b
ob-scheme: Use new `geiser' function when available
* lisp/ob-scheme.el (geiser): Add new declare.
(org-babel-scheme-get-repl): When possible, call the newer `geiser'
instead of the obsolete `run-geiser'.
2022-10-31 14:22:39 +08:00
Daniel Kraus bd68ece99c
ob-clojure.el: Auto detect backend
* lisp/ob-clojure.el (org-babel-clojure-backend): Set the backend
to an available cli program or elisp package.
2022-10-30 12:18:58 +01:00
Ihor Radchenko e0a87eba18
org-element-cache: Fix cache updates from indirect buffers
* lisp/org-element.el (org-element--cache-active-p):
(org-element--cache-put):
(org-element--cache-process-request):
(org-element--parse-to): Ensure that cache updates are done in base
buffer.
(org-element--cache-remove): Ensure that cache updates are done in base
buffer.  Watch for cache size to be non-negative.
2022-10-30 10:14:51 +08:00
Ihor Radchenko e675affe93
org-macs: Add new macro `org-with-base-buffer'
* lisp/org-macs.el (org-with-base-buffer): New macro to run code in
base buffer of current or given buffer.
* lisp/org-element.el (org-element-org-data-parser):
(org-element--cache-find):
(org-element--cache-sync):
(org-element--cache-before-change):
(org-element--cache-after-change):
(org-element--cache-submit-request):
(org-persist-after-read-hook): Use the new macro.
2022-10-30 10:14:50 +08:00
Ihor Radchenko a182add4a4
org-clock-x11idle-program-name: Fix link to x11idle source code
* lisp/org-clock.el (org-clock-x11idle-program-name): Fix the link to
default x11idle program.  It is not distributed via WORG.
2022-10-30 10:14:49 +08:00
Daniel Kraus a51cf1cc6b
ob-clojure.el: Fix bug with inline comments
* lisp/ob-clojure.el (ob-clojure-eval-with-cider): Filter out
  nil values from cider evaluation.
2022-10-29 22:22:12 +02:00
Kyle Meyer 0681babab4 Fix recent doc string quoting issues
* lisp/org-agenda.el (org-agenda-show-outline-path):
* lisp/org.el (org-display-outline-path): Surround symbols with `...'
rather than using leading quote.

See 6013cb161 (Fix doc string quoting problems with ', 2022-07-25) for
a more detailed explanation.
2022-10-29 15:49:04 -04:00
Kyle Meyer 6ca9022dc4 ob-lob: Clean up spacing to pass Emacs's pre-commit check
* lisp/ob-lob.el (org-babel-lob-get-info): Remove trailing whitespace
from docstring.
2022-10-29 15:23:00 -04:00
Kyle Meyer bfc859fedf org-cycle: Silence byte-compiler under 'make single'
These are warnings that would show up when these changes made their
way to the Emacs repo.
2022-10-29 15:22:58 -04:00
Kyle Meyer 0b6a138bd3 ob-core: Silence byte-compiler 2022-10-29 15:15:29 -04:00
Kyle Meyer 27bc5c9a28 Merge branch 'km/from-emacs-master' 2022-10-29 15:15:03 -04:00
Stefan Kangas 4f0a4e07fd Backport commit db2ed9f33 from Emacs
; Fix several symbol name typos
db2ed9f333879e5ac283fb48c8b06ed4022f0af9
Stefan Kangas
Wed Oct 26 23:04:23 2022 +0200
2022-10-29 14:22:29 -04:00
Nikolay Kudryavtsev 6156b57bdf
ob-maxima.el: Fix execution on MS Windows
* ob-maxima.el (org-babel-execute:maxima): Change command line
invocation to a one that should work everywhere.

TINYCHANGE
2022-10-29 14:03:10 +08:00
Ihor Radchenko 7880695221
org-set-tags-command: Fix handling `org-loop-over-headlines-in-active-region'
* lisp/org.el (org-set-tags-command): Respect the non-nil value of
`org-loop-over-headlines-in-active-region'.  The code is adapted from
similar uses in other commands.

Reported-by: Alex Giorev <alex.giorev@gmail.com>
Link: https://orgmode.org/list/CAMq3WZh1sGW+BNKW1hZA+wP=iFskzShF-D-wUqWYqb_EponZ8g@mail.gmail.com
2022-10-29 13:25:38 +08:00
Ihor Radchenko c70a422082
org-babel-execute-src-block: Ensure that buffer is not changed
* lisp/ob-core.el (org-babel-execute-src-block): Ensure that we insert
results into the buffer where the src block is located.  Even when the
execution yields changing current buffer.

Reported-by: John Kitchin <jkitchin@andrew.cmu.edu>
Link: https://orgmode.org/list/CAJ51ETqMBqiHy+W3CZ+EtSPzVb1ihbX6v+NQsZKojN6jF8zoBQ@mail.gmail.com
2022-10-29 12:43:03 +08:00
Ihor Radchenko a51bb2c448
org-x11idle-exists-p: Do not demand X window system at load time
* lisp/org-clock.el (org-x11idle-exists-p): Do not check if load-time
`window-system' is `x'.  Instead, rely on the check in
`org-user-idle-seconds'.

Emacs may start as a daemon and hence `window-system' may not yet be
`x' during startup.

Reported-by: Julien Cubizolles <j.cubizolles@free.fr>
Link: https://orgmode.org/list/871qqs6gqs.fsf@free.fr
2022-10-29 10:44:08 +08:00
Ihor Radchenko b93a61af9c
org-latex-line-break-safe: Use safer value of "\\[0pt]"
* lisp/ox-latex.el (org-latex-line-break-safe):
(org-latex-table-row):
Change \empty ending to explicit optional argument.  \empty still has
undesired side effects in some cases.

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

Reported-by: Juan Manuel Macías <maciaschain@posteo.net>
Link: https://orgmode.org/list/87o7u9rz1a.fsf@posteo.net
2022-10-29 10:34:05 +08:00
Daniel Kraus 0e175f11fd
lisp/ob-clojure.el: Fix header argument :var binding
* lisp/ob-clojure.el (org-babel-expand-body:clojure): Always quote
the variables passed from org-mode in Clojure let binding.
When a variable is a table or list, it's value is "(..data..)"
and without quotes, Clojure would try to execute the first
value as a function.
2022-10-28 11:50:03 +02:00
Bastien efcfaca72d lisp/ob-clojure.el: Update headers 2022-10-28 10:48:16 +02:00
Ihor Radchenko d87a496b54
org-babel-eval-error-notify: Always display exit code
* lisp/ob-eval.el (org-babel-eval-error-notify): Display exit code
even when stderr is not empty.

Link: https://orgmode.org/list/m21qqux0ga.fsf@me.com
2022-10-27 11:49:05 +08:00
Ihor Radchenko 6bbd08f5aa
org-datetree-insert-line: Fix blank line insertion
* lisp/org-datetree.el (org-datetree-insert-line): Use
`org--blank-before-heading-p' check.

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

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

Reported-by: Richard Walker <walkerrichardj@gmail.com>
Link: https://list.orgmode.org/orgmode/CAFyNgSE4mAt+b0Ks8L9bg2LbHcXnayOh+bYyONTQ4jN+zx3C1w@mail.gmail.com/
2022-10-26 15:25:24 +08:00
stardiviner 46b71f9108
org.el: Support auto display inline images when cycling
* lisp/org.el (org-toggle-inline-images): Support region.
(org-display-inline-images): Fix refresh argument logic.
(org-remove-inline-images): Support region.

* lisp/org-keys.el (org-toggle-inline-images): Update arguments.

* lisp/org-cycle.el (org-cycle-inline-images-display): Add new option to
control whether auto display inline images when cycling.
(org-cycle-display-inline-images): Add new hook function to auto display
inline images when cycling.
(org-cycle-hook): Add `org-cycle-display-inline-images' into cycling
hook by default.

* doc/org-manual.org (Exporting):
* etc/ORG-NEWS: Document the new option.
2022-10-26 12:43:07 +08:00
Ihor Radchenko 9490baa8bc
ob-python: Handle newer version of python-mode.el
* lisp/ob-python.el (py-choose-shell):
(py-toggle-shells): Use the new function name.
(py-default-interpreter): Remove the variable that is no longer
provided by python-mode.el.
(org-babel-python-initiate-session-by-key): Use `py-choose-shell'.

Reported-by: Christian Köstlin <christian.koestlin@gmail.com>
2022-10-26 12:40:05 +08:00
Ihor Radchenko bb40848458
org-odt-plain-text: Fix stripping spaces around plain-text segments
* lisp/ox-odt.el (org-odt-plain-text): Do not strip whitespace around
individual plain-text objects.

Reported-by: András Simonyi <andras.simonyi@gmail.com>
Link: https://orgmode.org/list/CAOWRwxC2MTqAmXVXtLJi39f=KEC-6tmWJ6XC3OMTXqvC2hC_xw@mail.gmail.com
2022-10-26 12:33:55 +08:00
Ihor Radchenko e022a0cea1
org-make-tags-matcher: Do not treat PROPERTY="[X]" as timestamp match
* lisp/org.el (org-make-tags-matcher): Improve heuristics used to
detect timestamps in the matcher.

Reported-by: Daniel J. Sinder <djsinder@gmail.com>
Link: https://orgmode.org/list/CAHND-wwBsoAQs2a5XTGKyX-=fFL5AwCPup=uA+R=FRH=1rUeVg@mail.gmail.com
2022-10-25 18:36:25 +08:00
Ihor Radchenko cd835dcad8
org-babel-demarcate-block: Fix when within blank after src block
* lisp/ob-core.el (org-babel-where-is-src-block-head): Clarify that
return value is nil within blank after src block.
(org-babel-demarcate-block): Insert new block inheriting language when
within blank lines after existing src block.  Document the behavior.

Reported-by: dalanicolai <dalanicolai@gmail.com>
Link: https://orgmode.org/list/CACJP=3nCekgX4RuYBWf=R_2t05-s4ikx-L9qP7W0cSicNG55BA@mail.gmail.com
2022-10-25 17:38:35 +08:00
Mikhail Skorzhinskii c3aa6a6d43
org-refile.el: Show refile targets with a title
* lisp/org-refile.el (org-refile-get-targets): Use a document
title (#+TITLE) instead of file or buffer name in outline path, if a
corresponding customisation option is set to 'title.  Fallback to a
filename if there is no title in the document.

* lisp/org-refile.el (org-refile-use-outline-path): Add a new option
'title, see above.
2022-10-25 14:53:14 +08:00
Mikhail Skorzhinskii 55767b792e
org-agenda.el: Show document title in outline path
* lisp/org-agenda.el (org-agenda-show-outline-path): Add an option to
show a document title at start of an outline path, instead of a file or
a buffer name.

* lisp/org.el (org-display-outline-path): Show a document title (#+TITLE
value) and an outline path in an echo area if the customisation option
is set to 'title.  Fallback to a file or a buffer name if the document
title is absent.
2022-10-25 14:53:14 +08:00
Mikhail Skorzhinskii d4e7bcb4bd
org-clock.el: Rename org-clock-get-file-title
* lisp/org.el (org-get-title): A new function to collect a document
title from an org-mode buffer, based on a `org-clock-get-file-title'
implementation.

* lisp/org-clock.el (org-clock-get-file-title): Removed.
2022-10-25 14:53:01 +08:00
Ihor Radchenko 2b9f9646ef
org-cite: Fix style completion
* lisp/oc.el (org-cite-make-insert-processor): Provide the required
argument to SELECT-STYLE.

Reported-by: Kierin Bell <bellkierin@gmail.com>
Link: https://orgmode.org/list/875yg940z8.fsf@gmail.com
2022-10-25 14:25:37 +08:00
Ihor Radchenko 48b237d9e2
org-attach-attach: Fix storing link to attached files
* lisp/org-attach.el (org-attach-attach): Fix typo when
`org-attach-store-link-p' is set to t.  Instead of `file', we need
`attach-file': the link to the attached file, not the original.
2022-10-24 12:37:32 +08:00
Ihor Radchenko d4e3598ab8
fixup! org-babel-read: Fix cells like '"string" more' 2022-10-23 15:33:24 +08:00
Ihor Radchenko 633ca9e69e
org-babel-read: Fix cells like '"string" more'
* lisp/ob-core.el (org-babel-read): Do not consider every cell
starting from \" as `read'able.  Check closing \" at least.

Reported-by: Greg Minshall <minshall@umich.edu>
Link: https://orgmode.org/list/4033335.1638552531@apollo2.minshall.org
2022-10-23 14:44:07 +08:00
Ihor Radchenko 9a3dd429bb
org-babel-import-elisp-from-file: Fix when \"s are not around
* lisp/ob-core.el (org-babel-string-read): Only considered \" at the
string boundaries, not inside.
* testing/lisp/test-ob-shell.el (ob-shell/results-table): Add a test.
2022-10-23 14:30:57 +08:00
Ihor Radchenko f8a9cd2308
org-babel-eval: Return command output even upon failure
* lisp/ob-eval.el (org-babel-eval): Return the available command
output even when the command fails.

This is useful for bash scripts that can produce useful output even
upon failing.  The error window is still displayed to inform users.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://orgmode.org/list/m2czakgpk8.fsf@me.com
2022-10-23 12:22:25 +08:00
Ihor Radchenko ab7eff9d9c
org-babel-eval-error-notify: Avoid uninformative empty error buffer
* lisp/ob-eval.el (org-babel-eval-error-notify): When STDERR is empty,
display the exit code in the error buffer rather than empty buffer.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://orgmode.org/list/m2czakgpk8.fsf@me.com
2022-10-23 12:21:15 +08:00
Ihor Radchenko 1ef420b19d
org-babel-comint-with-output: Handle output without trailing newlines
* lisp/ob-comint.el (org-babel-comint-with-output): Consider scenarios
when comint emits output without trailing newlines.  The strategy to
split the full concatenated output using `comint-prompt-regexp' does
not work when the regexp matches bol.  Use a constant string as a
separator instead of relying upon `comint-prompt-regexp'.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://orgmode.org/list/m2czakgpk8.fsf@me.com
2022-10-23 12:08:37 +08:00
Ihor Radchenko 69e3a4db3d
org-babel: Refactor temporary directory usage
* lisp/ob-core.el (org-babel-temp-directory): Fix return value for
remote directory.
(org-babel-temp-file): Simplify using `org-babel-temp-directory'.  Fix
incorrect file location when PREFIX is "".
(org-babel-temp-stable-directory): New macro returning suitable
temporary stable directory.
(org-babel-temp-stable-file): Simplify using
`org-babel-temp-stable-directory'.  Fix incorrect file location when
PREFIX is "".
* lisp/ob-java.el (org-babel-execute:java): Use
`org-babel-temp-directory'.

Reported-by: Ferdinand Pieper <fer@pie.tf>
Link: https://orgmode.org/list/87r0yz7u9q.fsf_-_@pie.tf
2022-10-23 11:49:00 +08:00
Ihor Radchenko 2f5e7103e5
ox-odt: Improve link generation in 4e5c737311
* lisp/ox-odt.el (org-odt-link): Use file: link code branch when
exporting id: links to document property drawers.  Call `org-odt-link'
with equivalent file: link instead of duplicating the existing code.

Reported-by: Max Nikulin <manikulin@gmail.com>
Link: https://orgmode.org/list/tiubca$1252$1@ciao.gmane.io
2022-10-22 12:55:11 +08:00
Ihor Radchenko 801c93638a
ob-shell: Fix multi-line scripts in sessions
* lisp/ob-comint.el (org-babel-comint-with-output): Clean up empty
output.  Such output is emitted unnecessarily for multi-line scripts.
* lisp/ob-shell.el (org-babel-shell-set-prompt-commands): Disable
PS2 and equivalent prompts.  Make sure that PROMPT_COMMAND does not
interfere with PS1 setting in POSIX shells.
(org-babel-sh-evaluate): Do not send input line-by-line.  Instead, let
`org-babel-coming-with-output' handle waiting for the output as well
as recording it.  Update to the new `org-babel-coming-with-output'
behavior of cleaning empty outputs.
* testing/lisp/test-ob-shell.el (test-ob-shell/session): Add a test.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://list.orgmode.org/orgmode/m2r0zboix1.fsf@me.com/
2022-10-22 12:15:51 +08:00
Vikas Kumar e700578799
ob-core.el: Fix indentation of multiline text in list output
* lisp/ob-core.el (org-babel-format-result): Use `org-list-to-org'
instead of `org-list-to-generic' to format result in Org list.

The problem was in formatting a multiline text result into an Org
list.  Additional lines of a list item should be indented with the
first line of the item.  The method used for this
formatting (`org-list-to-generic') does not add the extra indentation
to additional lines of an item.  Using `org-list-to-org' instead fixes
the problem.

TINYCHANGE
2022-10-21 14:33:05 +08:00
Ihor Radchenko 85ab64c2b3
org-clock-select-task: Do not offer non-printable characters in selection
* lisp/org-clock.el (org-clock-insert-selection-line): Display N/A
when non-printable character selection is requested.  Non-printable
characters cannot be entered through `read-char'.

Reported-by: Kevin Brubeck Unhammer <unhammer@fsfe.org>
Link: https://orgmode.org/list/87y2krmzol.fsf@trigram.no
2022-10-21 13:59:17 +08:00
Ihor Radchenko 3502ce2dbb
ox-odt: Fix newlines replaced by spaces in Han script
* lisp/ox-odt.el (org-odt-plain-text): Use `fill-region' to unfill the
paragraphs with newlines accounting for scripts without spaces between
words.

Reported-by: James Harkins <jamshark70@zoho.com>
Link: https://orgmode.org/list/sbhnlv$4t1$1@ciao.gmane.io
2022-10-21 13:37:17 +08:00
Ihor Radchenko d98a496480
org-lint: Fix regexp when matching header-args
* lisp/org-lint.el (org-lint-wrong-header-argument): Correctly handle
header-args:lang+ properties.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://orgmode.org/list/m2y1ta9rqe.fsf@me.com
2022-10-21 11:58:50 +08:00
Rudolf Adamkovič ee3dbb0fdb
ob-java: Define the list of all supported header arguments
* lisp/ob-java.el (org-babel-header-args:java): Complete the list of
header arguments supported for Java source blocks.
* testing/lisp/test-ob-java.el (ob-java/lint-header-arguments): Test
that the linter approves of all the supported arguments.
2022-10-21 11:43:19 +08:00
Max Nikulin deb1517fe9
org-macs.el: Do not compare wall time and file modification time
* lisp/org-macs.el (org-file-newer-than-p): Recommend passing file
modification time instead of wall time to avoid truncation of timestamp
precision for the sake of filesystems with coarse time resolution.
(org-compile-file): Store file modification time instead of system clock
for later comparison by `org-file-newer-than-p'.
* lisp/org.el (org-babel-load-file): Use `file-newer-than-file-p'
instead of `org-file-newer-than-p' since the former is more suitable
for target-prerequisite relation in the case of equal timestamps.
Improve error reporting when source file does not exist.
Update timestamp after tangling of an org file, not before it.

This is assumed to be a better fix of the problem with change of time
representation in Emacs-29. The problem was reported by Mark Barton
<mbarton98@gmail.com> in
https://list.orgmode.org/BF5B9308-3FEF-4DC6-98C9-BFF36F19D36C@gmail.com
Paul Eggert <eggert@cs.ucla.edu> committed another variant to Emacs
as 3abb3681b5.  It was ported to Org as commit 56ba22b9df several months
later.

Unchanged timestamp of a file means failure of `org-compile-file' but in
`org-babel-load-file' the target may be considered as up to date if its
timestamp is equal to the one for the prerequisite.
So `org-file-newer-than-p' is not suitable for both cases.  The
difference matters for filesystems with coarse timestamp resolution, for
example HFS+.

Earlier call of `org-babel-load-file' for a non-existing .org file
caused "Bad bounding indices: 0, 2" error.

Update file timestamp (introduced by the commit 1525a5a64e)
after tangling of the file.  Change caused by conflict resolution during
rebasing of the initial version of the patch.  See
https://list.orgmode.org/t75efi$9pv$1@ciao.gmane.io for an argument
in support of such change.
2022-10-21 11:22:34 +08:00
Bruno BARBIER 98cae03b7d
lisp/org-element: Add a parameters-line property to special blocks
Add a property `:parameters' to special blocks, to store the
PARAMETERS as a string.

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

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

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

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

*
testing/lisp/test-org-element.el (test-org-element/special-block-interpreter):
Test the case with no content.
2022-10-20 17:39:54 +08:00
Ihor Radchenko 7f8e616f3b
org-num-mode: Clear remaining num overlays before activation
* lisp/org-num.el (org-num-mode): Call `org-num--clear' when enabling
the mode.  This avoids duplicate overlays when the mode was active
prior (org-num-mode +1) call.

Reported-by: Ruijie Yu
Link: https://orgmode.org/list/sdvbkq8a7lp.fsf@fw.net.yu
2022-10-20 12:50:41 +08:00
Lucas V. R a7a579d06a
ox-latex: Allow markup objects inside %D spec
* lisp/ox-latex.el (org-latex--format-spec): Pass date through
`org-export-data' just as other backends do.

TINYCHANGE
2022-10-20 12:19:09 +08:00
Ihor Radchenko 3d1f4e0af0
org-cite-insert: Allow citations at the beginning of empty heading
* lisp/oc.el (org-cite--allowed-p): When heading is empty, allow
to insert citations after priority/todo/stars.

Reported-by: Scott Otterson <scotto@sharpleaf.org>
Link: https://orgmode.org/list/CAPY3P0TBuoU2AJX78Qi2FevGuCx6KW1YSoSGQQZrzusTiuphRA@mail.gmail.com
2022-10-20 11:22:05 +08:00
Ihor Radchenko 4e5c737311
ox-odt: Allow id: links to files
* lisp/ox-odt.el (org-odt-link): Transcode id: links to file property
drawers.

Reported-by: Moritz Schäfer <mail@moritzs.de>
Link: https://orgmode.org/list/CA+FVMQDBUwCQHFOWieELaB3=4MH2ybA66+NpCuQwvvv_1HVMzg@mail.gmail.com
2022-10-19 18:33:44 +08:00
fpi e58bd039e3
org-babel-get-src-block-info: Rename light argument
* lisp/ob-core.el (org-babel-get-src-block-info): Rename argument
light to no-eval.
2022-10-19 14:55:53 +08:00
fpi bbec9aafee
org-babel-lob-get-info: Add no-eval argument
* lisp/ob-lob.el (org-babel-lob-get-info): Add no-eval argument to
prevent recursive evaluation of lisp values in parameters.
2022-10-19 14:55:52 +08:00
Ihor Radchenko 4b9aef20d8
org-fold-hide-entry: Fix on empty heading with a child.
* lisp/org-fold.el (org-fold-hide-entry): Consider case when a child
heading is right at the next line below empty heading.
* testing/lisp/test-org-fold.el (test-org-fold/org-fold-hide-entry):
Add tests.

Reported-by: k_foreign@outlook.com
Link: https://orgmode.org/list/BY5PR10MB4289036F2436A909412E9D5096299@BY5PR10MB4289.namprd10.prod.outlook.com
2022-10-17 21:04:31 +08:00
Ihor Radchenko c0d629b5bd
org-read-date-get-relative: Assure case-insensitive weekday matching
* lisp/org.el (org-read-date-get-relative): Bind `case-fold-search' to
non-nil when matching weekdays.  This is to avoid breakage for
non-default value of `case-fold-search'.
2022-10-17 20:33:09 +08:00
Kyle Meyer cb1359a3ce agenda: Clean up spacing to pass Emacs's pre-commit check
* lisp/org-agenda.el (org-agenda-set-mode-name): Avoid space before
tab in indent.
2022-10-16 17:45:57 -04:00
Kyle Meyer 21155f007c Merge branch 'km/from-emacs-master'
- Take the change from 58a46fab0 (doc/org-manual.org: Mention that
   Network Theory Ltd. is closed, 2022-10-16) over Emacs's a95062e036d
   (Delete broken link to Network Theory Ltd, 2022-10-15).

 - Do not keep the {http => https}://staff.science.uva.nl/c.dominik/
   change from Emacs's 318722541 because that value is intended to be
   an example for the http row (with an https example in the next
   row).
2022-10-16 17:43:29 -04:00
Stefan Kangas b7aad5b095 Backport commit 318722541 from Emacs
; Prefer HTTPS to HTTP in many URLs
3187225416c66061b67e89092addc15cad2202b9
Stefan Kangas
Sat Oct 15 13:06:45 2022 +0200

[ km: Note that the staff.science.uva.nl change in the "External
  Links" table will be discarded in the merge because the value is
  supposed to be an example of an http link, not an https one (which
  is covered by the next row). ]
2022-10-16 17:42:05 -04:00
Ihor Radchenko d972cfac89
org-create-formula-image: Do not err when `noninteractive'
* lisp/org.el (org-create-formula-image): Do not err during
noninteractive export.  Just use a fallback DPI value instead of
requesting actual display DPI.

Reported-by: Daniel Guimaraes <dcguim@gmail.com>
Link: https://orgmode.org/list/e22e7cac-03c1-ddee-1b1d-09981a384bfc@gmail.com
2022-10-16 20:48:50 +08:00
Ihor Radchenko 87c294c7b6
org-agenda-new-marker: Do not create maker in killed agenda buffers
* lisp/org-agenda.el (org-agenda-new-marker): Do not create buffer
marker unless agenda buffer is live.

Reported-by: Hu Lucius <orctarorga@gmail.com>
Link: https://orgmode.org/list/CACDPnMHOfUmO4sjer_pcox5Z5sodkVN-UW29AAYdL8V-iOiGoA@mail.gmail.com
2022-10-16 18:38:49 +08:00
Ihor Radchenko 15b3aa43a8
org-store-link: Fix for sticky agenda buffers
* lisp/ol.el: Do not assume a single agenda buffer at a time.  Simply
check if we are in a buffer with `org-agenda-mode' active.
2022-10-16 16:22:38 +08:00
Ignacio 31f2510995
org-clock.el: resolve running clock after being idle only once
* lisp/org-clock.el (org-resolve-clocks-if-idle): Cancel timer
for `org-resolve-clocks-if-idle' while `org-clock-resolve' waits for
the user to answer the prompt.

After the user answered the prompt to resolve the running clock, the
pending scheduled calls to `org-resolve-clocks-if-idle' (one for each
minute it took the user to answer) were being executed immediately.
But after an old change in Emacs, the user answer does not reset the
idle timer anymore, so each of those calls thought that the user was
still idle and prompted them again, to the user had to answer the same
prompt again N times.  This commit fixes that bug.

TINYCHANGE
2022-10-16 13:13:26 +08:00
Ihor Radchenko 5fa66c7ffc
org-latex-verse-block: Fix regression from 3f60acff7
* lisp/ox-latex.el (org-latex-verse-block): Fix logic replacing sole
paragraph breaks according to the new template.
* testing/lisp/test-ox-latex.el: New test file.
(org-test-with-exported-text): New macro for testing export.
(test-ox-latex/verse): New test.
* mk/default.mk (BTEST_RE): Select the new test by default.

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

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

    | a |
    |---|

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

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

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

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

Reported in
gerard.vermeulen, Wed, 12 Oct 2022 03:15:49 +0000.
https://list.orgmode.org/784cf8be450b7d676ddd60214cc847db@posteo.net
2022-10-14 10:27:14 +08:00
Ihor Radchenko d331f52cac
org-crypt-key-for-heading: Handle CRYPTKEY nil value
* lisp/org-crypt.el (org-crypt-key-for-heading): Do not fallback to
`org-crypt-key' when heading explicitly sets CRYPTKEY property.

Reported-by: Ignacio Casso <ignaciocasso@hotmail.com>
Link: https://orgmode.org/list/PAXPR06MB7760DA356C7C27045BEB64F6C6449@PAXPR06MB7760.eurprd06.prod.outlook.com
2022-10-14 10:16:47 +08:00
Ihor Radchenko 3790bf8ea1
org-clock-sum: Do not err when have malformed clock lines
* lisp/org-clock.el: Only consider proper clock elements when
calculating clock sum.  Do not rely on crude regexp.

Reported-by: Gregor Zattler <grfz@gmx.de>
Link: https://orgmode.org/list/87y1yecmgb.fsf@localhost
2022-10-13 14:12:36 +08:00
Ihor Radchenko 0e4874f17c
org-up-element: Fix jumping up from inlinetask
* lisp/org.el (org-up-element): Do not assume that
`org-back-to-heading' skips inlinetasks.  Avoid that `if' branch by
skipping over section parents.

Reported-by: Michael Dauer <mick.dauer@gmail.com>
Link: https://orgmode.org/list/CAP7OBxKKeuK_uH46SyEqQbsuBsE=XPkB=ks1TkCZTwyPZ40KaA@mail.gmail.com
2022-10-13 11:06:36 +08:00
stardiviner 601ce688d5
lisp/ob-clojure.el: Fix :backend override not work with `org-babel-clojure-backend'
* lisp/ob-clojure.el (org-babel-expand-body:clojure): When The source
block specified header argument :backend, the global option
`org-babel-clojure-backend' value is default 'cider, the
`cider-buffer-ns` is not void error.
2022-10-13 10:51:19 +08:00
Ihor Radchenko 4c0641837c
org-babel-script-escape: Turn empty lists into nil
* lisp/ob-core.el: Translate (), {}, and [] to nil.
* testing/lisp/test-ob.el (test-ob/script-escape): Add tests.

Reported-by: Jonas Bernoulli <jonas@bernoul.li>
Link: https://list.orgmode.org/87v8opfhk1.fsf@bernoul.li/T/#u
2022-10-12 19:46:14 +08:00
Ihor Radchenko 416c839c59
lisp/org-agenda.el: Remove unused `org-agenda-last-dispatch-buffer'
* lisp/org-agenda.el (org-agenda-last-dispatch-buffer):
(org-agenda): Remove unused variable.

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

Reported-by: Eduardo Suarez <esuarez@itccanarias.org>
Link: https://orgmode.org/list/20220409202736.GA28127@itccanarias.org
2022-10-12 13:47:41 +08:00
Ihor Radchenko 88c85d620b
org-map-entries: Do not demand file buffer when SCOPE is nil
* lisp/org.el (org-map-entries): Avoid calling
`org-agenda-prepare-buffers' for non-file buffers.
`org-agenda-prepare-buffers' expects a file buffer and gives
unexpected dialogue otherwise.  Since `org-agenda-prepare-buffer' only
contains optional cache calculations and things only useful for agenda
generation, not calling it should be reasonably safe.

Reported-by: Rodrigo Morales <moralesrodrigo1100@gmail.com>
Link: https://orgmode.org/list/871r54m6xm.fsf@gmail.com
2022-10-11 16:23:05 +08:00
Ihor Radchenko dd2212395b
org-ctrl-c-ctrl-c: Update timestamp at point inside clock lines
* lisp/org.el (org-ctrl-c-ctrl-c): Update the timestamp at point, if
any; not just the clock sum.

Reported-by: "Bruce E. Robertson" <brucer42@gmail.com>
Link: https://orgmode.org/list/87mtjo2twj.fsf@gmail.com
2022-10-11 15:54:23 +08:00
Ihor Radchenko 3f60acff77
ox-latex: Protect [...] after \\ to be interpreted as LaTeX argument
* lisp/ox-latex.el (org-latex-linebreak-safe): New constant holding
safe version of LaTeX line break.
(org-latex-table-matrix-macros):
(org-latex-clock):
(org-latex-line-break):
(org-latex-plain-text):
(org-latex-planning):
(org-latex--org-table):
(org-latex--math-table):
(org-latex-table-row):
(org-latex-verse-block): Use the new constant.

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

Reported-by: Stewart Thomas <sjt015@bucknell.edu>
Link: https://orgmode.org/list/ce760fc3-5aae-144d-2d02-7dea215f73fc@gmail.com
2022-10-11 11:32:52 +08:00
Chris Clark 4d07df718b
ob-clojure.el: Add a :backend header arg to clojure code blocks
* ob-clojure.el (org-babel-header-args:clojure,
org-babel-execute:clojure): Add a :backend header arg that can
override the configured `org-babel-clojure-backend'.

TINYCHANGE
2022-10-11 10:49:56 +08:00
Kyle Meyer e2d41c84e1 Merge branch 'km/from-emacs-master' 2022-10-10 15:41:07 -04:00
Stefan Monnier 616fc20445 Backport commit f3769bc32 from Emacs
* lisp/org.el (org-unfontify-region): Use `with-silent-modifications`.
(org-display-inline-remove-overlay): Remove ineffective binding of
`inhibit-modification-hooks` around code which doesn't modify the
buffer anyway.

org.el: Improve bindings of `inhibit-*` vars
f3769bc32a3d32377a83b33d416205f80814e422
Stefan Monnier
Fri Oct 7 12:29:56 2022 -0400
2022-10-10 15:40:05 -04:00
Ihor Radchenko 192742c9c5
org-export-with-buffer-copy: Allow safe reusable buffer copy
* lisp/ox.el (org-export--generate-copy-script):
(org-export-copy-buffer):  Accept cl-style key arguments.
* lisp/ox.el (org-export-with-buffer-copy): Allow optional cl-style
key arguments for fine-grained control on what to copy from the target
buffer and which buffer to use as a target.  Do not kill the target
buffer upon finished, when the target is provided.  Make sure that
remaining buffer copy does not preserve `buffer-file-name' from the
original buffer and that it never overwrites the file associated with
the original buffer.
* lisp/ox-html.el (org-html-format-latex): Use the new version of
`org-export-with-buffer-copy' instead of managing edge cases by
itself.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://orgmode.org/list/87zge8j5iu.fsf@localhost
2022-10-10 17:36:10 +08:00
Rudolf Adamkovič e7feeb2225
org-export: Propertize keybindings in Org Export dispatch UI
* lisp/ox.el (org-export--dispatch-ui): Propertize the navigational
keybindings.
2022-10-09 15:46:14 +08:00
Ihor Radchenko f4149681ee
org-babel: Fix usage of `org-babel-temporary-directory'
* lisp/ob-core.el (org-babel-temp-directory): New macro, returning
suitable temporary directory.  The macro considers remote
`default-directory' and nil values of
`org-babel-temporary-directory'.
* lisp/ob-gnuplot.el (org-babel-gnuplot-process-vars):
* lisp/ob-java.el (org-babel-execute:java):
* lisp/ob-processing.el (org-babel-processing-view-sketch): Use the
new macro.

Reported-by: Christian Köstlin <christian.koestlin@gmail.com>
2022-10-09 12:30:00 +08:00
Ihor Radchenko 41a409f79d
org-src-font-lock-fontify-block: Do not fold links inside src blocks
* lisp/org-src.el (org-src-font-lock-fontify-block): Overwrite link
fontification after regexp-based `org-activate-links' fontifies links
disregarding Org parser.  Hidden parts of link-looking text are
explicitly unfolded now.  This commit relies on specific fontification
order in `org-font-lock-keywords'.
(org-fold-region): Declare function.

Reported-by: Tim Loderhose <tim@loderhose.com>
Link: https://orgmode.org/list/XdWFnN3XCJ67x3SvoiVo_itGGYfboKmuWp7OxQxRZ_SGA5vgb72oWBoqTmOUUtiqUR890-kIXjI7uhlse-HFYqNVJTyVlc15zAzbP8qHVdo=@loderhose.com
2022-10-09 11:45:44 +08:00
Roméo La Spina de553d1dc7
lisp/org-clock.el: Fix bug in prompt for resolving clocks
* lisp/org-clock.el (org-clock-resolve):
Avoid unwanted disappearing of the prompt when clicking somewhere, by
using `read-char-exclusive' instead of `read-char'.

Link: https://orgmode.org/list/87o82yaeie.fsf@gmail.com

TINYCHANGE
2022-10-09 11:19:48 +08:00
Kyle Meyer 04d9d4b3db compat: Load subr-x for Emacs < 28 compatibility
* lisp/org-compat.el: Require subr-x at compile time to define
string-trim for older Emacs versions.

Before Emacs 28.1, string-trim was defined in subr-x, leading to 'make
single' complaining about an undefined string-trim in the recently
added org-string-clean-whitespace.

Reported-by: Ihor Radchenko <yantar92@gmail.com>
Link: https://list.orgmode.org/8735c01aho.fsf@localhost
2022-10-08 01:40:07 -04:00
Ihor Radchenko 233ad88651
org-export: Do not use `always' not available in Emacs <28
* lisp/ox.el (org-export--generate-copy-script): Use explicit `lambda'
instead of `always', which is not yet available in all the supported
Emacs versions.

Reported-by: Kyle Meyer <kyle@kyleam.com>
2022-10-08 13:30:36 +08:00
Ihor Radchenko ae028d0a25
org-toggle-heading: Document checkbox conversion to TODO keywords
* lisp/org.el (org-toggle-heading): Update the docstring.
2022-10-08 12:45:59 +08:00
Ihor Radchenko fcd3817450
org-toggle-heading: Use buffer-local keyword settings when possible
* lisp/org.el (org-toggle-heading): Prefer `car' of
`org-done-keywords' and `org-not-done-keywords' when converting
checkboxes to TODO-keywords.

Reported-by: autofrettage <autofrettage@protonmail.ch>
Link: https://orgmode.org/list/87v91vle4u.fsf@gmail.com
2022-10-08 12:39:31 +08:00
Ihor Radchenko b68c1666c2
org-ts-regexp0: Fix matching timestamps with no day name
* lisp/org.el (org-ts-regexp1): Update regexp to match strings like
"2022-04-29 02:00" with no day name.

Reported-by: Russell Adams <RLAdams@adamsinfoserv.com>
Link: https://orgmode.org/list/87zgk8tc17.fsf@localhost
2022-10-08 12:01:14 +08:00
Ihor Radchenko eeae6ed4bf
org-agenda-lisp: Add FIXME about let-binding `inhibit-redisplay'
* lisp/org-agenda.el (org-agenda-list): The purpose of binding
`inhibit-redisplay' is unclear and apparently not in git logs.
2022-10-07 19:45:38 +08:00
Ihor Radchenko 86b6d843f6
org-html-format-latex: Prevent side effects of copying `buffer-file-name'
* lisp/ox-html.el (org-html-format-latex): Unset `buffer-file-name'
after we are done with transcoding LaTeX.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://list.orgmode.org/m2k05c579o.fsf@me.com/T/#m949ed054f0f219e2742697c4c4f49fbe07909f5a
2022-10-07 18:06:19 +08:00
Ihor Radchenko 17708ab3fa
org-export-copy-buffer: Document the caveats
* lisp/ox.el (org-export-copy-buffer): Mention that `buffer-file-name'
is copied around and explain the consequences.  Document why
`buffer-file-name' is copied.
2022-10-07 18:06:12 +08:00
Ihor Radchenko 3de74bbeff
fixup! org-export-copy-buffer: Prevent saving to disk
* lisp/ox.el (org-export--generate-copy-script): Set
`write-contents-functions' after running `major-mode'.
* testing/lisp/test-ox.el (test-org-export/org-export-copy-buffer):
Add test.
2022-10-07 17:46:15 +08:00
Ihor Radchenko 1a62cd94cf
org-pcomplete: Fix completion inside bracketed link
* lisp/org-pcomplete.el (pcomplete/org-mode/searchhead): Drop closing
brackets when completing inside bracketed link [[*head<point>]].

Reported-by: Carlos Pita <carlosjosepita2@gmail.com>
Link: https://orgmode.org/list/87r1cfvvd0.fsf@localhost
2022-10-07 15:49:46 +08:00
Jonas Bernoulli fc8e375b9b
Begin messages about executing code blocks with a capital letter
lisp/ob-awk.el (org-babel-expand-body:awk):
lisp/ob-core.el (org-babel-execute-src-block):
lisp/ob-groovy.el (org-babel-execute:groovy):
lisp/ob-maxima.el (org-babel-execute:maxima):
lisp/ob-sed.el (org-babel-execute:sed):
Begin message with capital letter.

By Emacs' convention all messages should begin with a capital letter.
2022-10-07 13:51:35 +08:00
Jonas Bernoulli 2f4de60980
ob-emacs-lisp: Don't print arguments of post-process arguments to stdout
* lisp/ob-emacs-lisp.el (org-babel-expand-body:emacs-lisp): Do not
print post-processing argument.

It is unclear whether the arguments were printed on purpose.  It might
be useful to do so at times for debugging purposes, but generally they
drown out other messages when a lot of post-processing is being done;
making it harder to spot messages of interest that would otherwise
allow noticing regressions.  This is particularly troublesome when
running `org-babel-execute-buffer' from a Makefile or script.
2022-10-07 13:50:21 +08:00
Nicholas Vollmer 7f3a6cf6e7
org-capture: Add template hook properties
* lisp/org-capture.el (org-capture-templates): Document template hook properties.
(org-capture-finalize): Execute :prepare/:before/:after-finalize functions.
(org-capture-place-template): Execute :hook functions.

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

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

* testing/lisp/test-org-capture.el: Add tests for template hook properties.
2022-10-07 13:38:52 +08:00
Ihor Radchenko 0be36ac13e
org-html-format-latex: Prevent save prompt for temporary buffer
* lisp/ox-html.el (org-html-format-latex): Mark the temporary Org
buffer as unchanged to prevent buffer saving prompt before exiting
Emacs.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://list.orgmode.org/m2zgef774u.fsf@me.com/T/#t
2022-10-07 13:15:18 +08:00
Ihor Radchenko dcdf98a564
org-export-copy-buffer: Update declarations
* lisp/ob-exp.el (org-export-copy-buffer): Update declaration with the
new function arguments.
2022-10-07 13:15:17 +08:00
Ihor Radchenko 514e3a9cd2
org-export: Suppress cache persistence in buffer copies during export
* lisp/org-element.el (org-element-cache-reset): Add new optional
argument that suppresses all persistence-related calculations.
* lisp/org-table.el (org-element-cache-reset):
* lisp/org.el (org-element-cache-reset): Update function signature.
* lisp/ox.el (org-export--generate-copy-script): Do not try to use
cache persistence in throwaway buffer copies.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://list.orgmode.org/m2zgef774u.fsf@me.com/T/#t
2022-10-07 13:15:17 +08:00
Ihor Radchenko 09fd5f886a
org-html-format-latex: Avoid unnecessary string allocation
* lisp/ox.el (org-export--generate-copy-script): Add new optional
arguments to limit what is being copied.
(org-export-copy-buffer): Allow copying into provided buffer and copy
selectively passing the new optional arguments to
`org-export--generate-copy-script'.  Do not try to check if all the
local variable values are `read'able - it is only needed during async
export.
* lisp/ox-html.el (org-html-format-latex): Re-use the same hidden
buffer during export.  Only copy local variables into that buffer.

This commit avoids excessive calls to `org-mode' and copying the
exported buffer contents for every single latex fragment.  The result
is lower impact on GC and better overall performance.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://list.orgmode.org/m2zgef774u.fsf@me.com/T/#t
2022-10-07 13:15:16 +08:00
Ihor Radchenko b45911d41e
org-export-copy-buffer: Prevent saving to disk
* lisp/ox.el (org-export--generate-copy-script): Prevent Emacs from
ever saving copied buffer contents to disk despite `buffer-file-name'
being set to the original value.
2022-10-07 13:15:15 +08:00
Ihor Radchenko 0551eba40c
org-export-get-ordinal: Cache results
* lisp/ox.el (org-export-get-ordinal): Cache results while counting to
avoid quadratic scaling.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://list.orgmode.org/m2zgef774u.fsf@me.com/T/#t
2022-10-07 13:15:14 +08:00
Ihor Radchenko 4cb1b8ebd0
org-export-ignored-local-variables: Do not copy cache
* lisp/ox.el (org-export-ignored-local-variables): Do not copy buffer
cache.  It is large by size (and, thus, slow to `read') and may be
changed destructively by reference, interfering with the original
buffer when calling `org-export-copy-buffer'.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://list.orgmode.org/m2zgef774u.fsf@me.com/T/#t
2022-10-07 13:15:14 +08:00
Ihor Radchenko aa90e5b59c
org-export-with-buffer-copy: Avoid all the hooks, not just `org-mode-hook'
* lisp/ox.el (org-export--generate-copy-script): Use
`delay-mode-hooks' to disable all the hooks to be executed instead of
only `org-mode-hook'.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://list.orgmode.org/m2zgef774u.fsf@me.com/T/#t
2022-10-07 13:15:13 +08:00
Ihor Radchenko 5a167f6ef2
org-element-cache-reset: Never use cache persistence in non-file buffers
* lisp/org-element.el (org-element-cache-reset): Disable cache
persistence in non-file buffers.  In particular, do not try to restore
cache for temporary buffers based on their contents hash.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://list.orgmode.org/m2zgef774u.fsf@me.com/T/#t
2022-10-07 13:15:12 +08:00
Ihor Radchenko 279bee087d
org-element-clock-line-re: Fix Emacs 26 compatibility after e305755b1
* lisp/org-element.el (org-element-clock-line-re): Use Emacs
26-compatible `rx' notation.
2022-10-07 13:09:32 +08:00
Rudolf Adamkovič a220492064
ob-sed: Fix typo
* lisp/ob-sed.el: Fix a typo in a comment
2022-10-07 12:10:21 +08:00
Jonas Bernoulli 9b690462a3
Allow returning empty list from post-processing block
* lisp/ob-ref.el (org-babel-ref-resolve): When the result an empty
list, then treat it as a list, not as the symbol nil.
* testing/lisp/test-ob.el (test-ob/post-header-arguments): Add new
test.
* etc/ORG-NEWS (Post-processing code blocks can return an empty list):
Document change in behavior.
2022-10-07 12:06:30 +08:00
Stefan Kangas 0b67b9f64f
Improve documentation of org-kill-line
* lisp/org.el (org-special-ctrl-k): Doc fix; clarify what is being
killed and improve wording.  Add command substitutions.
(org-kill-line): Doc fix; mention user options that this command
relies on.
2022-10-07 11:47:45 +08:00
Stefan Kangas e28e3aaabb
Improve documentation of org-agenda-skip-*
* doc/org-manual.org (Special Agenda Views): Improve indexing.
* lisp/org-agenda.el (org-agenda-skip-function)
(org-agenda-skip-entry-if, org-agenda-skip-subtree-if): Expand
docstrings.
(org-agenda-skip-if): Doc fix; clarify wording.
2022-10-07 11:47:44 +08:00
Stefan Kangas 101280aa66
Add crossreference to org-stuck-projects docstring
* lisp/org-agenda.el (org-stuck-projects): Add Info manual reference
to docstring.
2022-10-07 11:47:43 +08:00
Liu Hui edf5afc1d8
Fix filter preset problem for sticky agenda
* lisp/org-agenda.el (org-agenda-local-vars):
(org-agenda-filters-preset): Add a new variable
`org-agenda-filters-preset' for storing per-buffer filter presets.
(org-agenda):
(org-agenda-filter-any):
(org-agenda-prepare):
(org-agenda-finalize):
(org-agenda-redo):
(org-agenda-filter-by-tag):
(org-agenda-filter-make-matcher):
(org-agenda-set-mode-name):
(org-agenda-reapply-filters): Use `org-agenda-filters-preset' for
getting and setting per-buffer filter presets, rather than modifying
the global symbol property.  Change `org-lprops' from symbol property
to per-buffer text property.  Delete unused `last-args' symbol
property.
* testing/lisp/test-org-agenda.el (test-org-agenda/sticky-agenda-filter-preset):
(test-org-agenda/redo-setting): Add tests.
2022-10-07 11:43:32 +08:00
Ihor Radchenko f0b7dfb3a0
org-table: Repair table before inserting rows/columns
* lisp/org-table.el (org-table-insert-column):
(org-table-insert-row): Repair the table as needed before inserting.
The internal insertion logic assumes that the table is valid.  The
rapair checks are copied from `org-table-insert-hline'.

Reported-by: Mauro Aranda <maurooaranda@gmail.com>
Link: https://orgmode.org/list/87o8csah5t.fsf@localhost
2022-10-06 16:22:57 +08:00
Ihor Radchenko 224708323e
org-clock: Do not assume that clock is always inside capture buffer
* lisp/org-capture.el (org-capture): Store the clock marker in `org-capture-clock-was-started'.
(org-capture-clock-was-started): Document that the variable holds
clock marker.
(org-capture-finalize): Check the stored value of the clock marker
when deciding if the currently running clock has been started by
capture.

Reported-by: Bernt Hansen <bernt@norang.ca>
Link: https://orgmode.org/list/878rza7c0w.fsf@localhost
2022-10-06 16:00:59 +08:00
Ihor Radchenko 2c8bd0cc9b
org-fill-element: Respect region selection when filling src-block
* lisp/org.el (org-fill-element): When region is not active, run
`fill-paragraph' at point inside src block.  When region is active and
within src block boundaries, run `fill-paragraph' preserving the
region.  When region is active and crosses src block boundaries, fill
the whole src block.

Reported-by: Fabio Natali <me@fabionatali.com>
Fixes: https://orgmode.org/list/201b44de-1f97-1b23-1767-970ee00f259c@posteo.eu
2022-10-05 13:20:58 +08:00
Ihor Radchenko ceb99b8600
org-table-fix-formulas: Ensure shifting columns after removing invalid
* lisp/org-table.el (org-table-fix-formulas): Search from the
beginning of table formula when shifting moved column numbers.

Reported-by: Uwe Brauer <oub@mat.ucm.es>
Link: https://orgmode.org/list/87r1gaw0av.fsf@mat.ucm.es
2022-10-05 13:13:36 +08:00
Ihor Radchenko e305755b1a
org-element: Parse malformed clock lines as paragraphs
* lisp/org-element.el (org-element-clock-line-re): Update the regexp
matching the actual required clock line structure.
(org-element--set-regexps): Use `org-element-clock-line-re'.

Link: https://orgmode.org/list/87h7571bpb.fsf@localhost
2022-10-05 12:51:46 +08:00
Kyle Meyer 1f8cc85542 org-agenda: Replace 29.1 version keywords with package-version
* lisp/org-agenda.el (org-agenda-block-separator):
(org-agenda-time-grid):
(org-agenda-current-time-string): Replace version keyword with
package-version keyword.

Prefer package-version so that the help buffer shows

  This variable was introduced, or its default value was changed, in
  version 9.6 of the Org package that is part of Emacs 29.1.

rather than

  This variable was introduced, or its default value was changed, in
  version 29.1 of Emacs.
2022-10-04 21:07:19 -04:00
Kyle Meyer 95a4c59bfe compat: Add compatibility wrapper for format-prompt
* lisp/org-compat.el (org-format-prompt): New compatibility
function.
* lisp/org-capture.el (org-capture-fill-template):
* lisp/org-refile.el (org-refile-get-location): Use org-format-prompt.

Prefer a wrapper to inlining compatibility kludges.

This is a follow-up to the port of Emacs's 664094222.
2022-10-04 18:38:25 -04:00
Kyle Meyer 07b6a0e044 compat: Use org- wrapper for string-equal-ignore-case compatibility
* lisp/org-compat.el (org-string-equal-ignore-case): New compatibility
function.
(org-mode-flyspell-verify):
* lisp/ob-core.el (org-babel-results-keyword):
(org-babel-insert-result):
* lisp/org-lint.el (org-lint-duplicate-custom-id):
* lisp/ox.el (org-export-resolve-radio-link):
Use org-string-equal-ignore-case.

Prefer an explicit org- wrapper to isolate the kludge and avoid any
confusion about where it is defined.

This is a follow-up to the port of Emacs's 70341cab3.
2022-10-04 18:38:25 -04:00
Kyle Meyer 75d63533d3 compat: Move string-equal-ignore-case to correct section
Emacs's 70341cab3 put this in the "Emacs < 24.4 compatibility" section
(which no longer exists in main), but string-equal-ignore-case is new
to Emacs 29.
2022-10-04 18:38:25 -04:00
Kyle Meyer 98e168b489 compat: Add compatibility wrapper for string-clean-whitespace
* lisp/org-compat.el (org-string-clean-whitespace): New compatibility
function.
* lisp/ox.el (org-export-resolve-radio-link): Use
org-string-clean-whitespace.

This is a follow-up to the port of Emacs's 70341cab3.
2022-10-04 18:38:25 -04:00
Kyle Meyer 0e0fe76ae4 ox-icalendar: Fix time zone construct from recently ported commit
* lisp/ox-icalendar.el (org-icalendar--combine-files): Correct typo in
format-time-string specifier.

This is a follow-up to the port of Emacs's e0ca8f791.
2022-10-04 18:38:25 -04:00
Kyle Meyer 6dd736ab35 ol-eshell: Make recently ported change compatible with Emacs < 29
* lisp/ol-eshell.el (org-eshell-open): Inline action if
display-comint-buffer-action isn't bound.

This is a follow-up to the port of Emacs's 18b680cfd.
2022-10-04 18:38:25 -04:00
Kyle Meyer abc34b458f org-mouse: Make recently ported change compatible with Emacs < 29
* lisp/org-mouse.el (org-mouse-show-context-menu): Conditionally
restore old code path, falling back to double-click-time if
mouse-double-click-time isn't available.

This is a follow-up to the port of Emacs's 2fba71cf1.
2022-10-04 18:38:25 -04:00
Kyle Meyer 42c418693f Merge branch 'km/from-emacs-master' 2022-10-04 18:37:42 -04:00
Kyle Meyer aeb934b598 Merge branch 'km/from-emacs-28' 2022-10-04 18:36:31 -04:00
Kyle Meyer 631d4eb6af org-macs: Move org-current-text-indentation to silence byte-compiler
Move org-current-text-indentation upstream of first use to avoid 'make
single' (and the Emacs repo) reporting

  org-macs.el:1106:11: Warning: macro ‘org-current-text-indentation’ defined too
      late
2022-10-04 18:36:19 -04:00
Lars Ingebrigtsen 9b62bcc9c6 Backport commit 8dacd8cd9 from Emacs
* lisp/org/org-macro.el (vc-exec-after): Update declaration.

Add a new command vc-pull-and-push
8dacd8cd914fdbe0f6f17ca57915611d48e9124d
Lars Ingebrigtsen
Sat Sep 24 15:19:03 2022 +0200
2022-10-04 17:18:04 -04:00
Stefan Kangas c2c8e66e5d Backport commit b7e867b84 from Emacs
Make point-at-eol and point-at-bol obsolete
b7e867b841f47dcff3aeaef9b5608a237386ce70
Stefan Kangas
Tue Aug 23 04:54:57 2022 +0200

[ km: This was independently covered on the main branch with
  e73c5b7d0.  I'm applying it here too for bookkeeping/traceability
  purposes. ]
2022-10-04 17:18:04 -04:00
Lars Ingebrigtsen 9c2bc2877f Backport commit 06d716147 from Emacs
Fix some no-X build warnings
06d7161476255c77defa119fffa842b7abaa0dcb
Lars Ingebrigtsen
Mon Aug 22 19:22:33 2022 +0200
2022-10-04 17:18:04 -04:00
Lars Ingebrigtsen add8552b1d Backport commit 48aacbf29 from Emacs
* lisp/oc-basic.el (org-cite-basic--set-keymap): Adjust
buffer-substring generalized variable usage.

Make many seldom-used generalized variables obsolete
48aacbf292fbe8d4be7761f83bf87de93497df27
Lars Ingebrigtsen
Sun Aug 21 22:12:43 2022 +0200

[ km: This was independently covered on the main branch with
  a526ea6a3.  I'm applying it here too for bookkeeping/traceability
  purposes. ]
2022-10-04 17:18:04 -04:00
Stefan Kangas e58217ff1f Backport commit 57259773b from Emacs
; * lisp/org/org.el: Delete unnecessary declarations.
57259773b4f0b992e38843859a8b93d82317ded3
Stefan Kangas
Sun Aug 14 23:46:33 2022 +0200
2022-10-04 17:18:04 -04:00
Stefan Kangas 25e638f726 Backport commit 1137219c9 from Emacs
Make compat alias image-refresh obsolete
1137219c97dda512a309ce4bfad5abde0d2be206
Stefan Kangas
Tue Aug 9 14:04:39 2022 +0200

[ km: This was independently covered on the main branch with
  e73c5b7d0.  I'm applying it here too for bookkeeping/traceability
  purposes. ]
2022-10-04 17:18:04 -04:00
Peder O. Klingenberg 2ac8c44f04 Backport commit b335e1a04 from Emacs
* lisp/org.el (eq): Fix load of compiled or compressed
org-loaddefs (bug#56982).

* lisp/org/org.el: Fix load of compiled or compressed org-loaddefs
b335e1a0469105bb55b9741ae3106dc0a6023ce2
Peder O. Klingenberg
Thu Aug 4 20:27:56 2022 +0200
2022-10-04 17:18:04 -04:00
Stefan Kangas 883f87c3e7 Backport commit 4d64c39fa from Emacs
; * lisp/org/ob-lilypond.el: Add FIXME.
4d64c39fad481f2dc125aa4d207ab191bf697529
Stefan Kangas
Thu Aug 4 14:48:44 2022 +0200
2022-10-04 17:18:04 -04:00
Lars Ingebrigtsen 1bbd86310a Backport commit 4c1bc8315 from Emacs
* lisp/ob-core.el (org-src-sha): Avoid triggering the
`register-definition-prefixes' in doc strings (bug#56968).

Fix up some prefix registration problems in doc strings
4c1bc8315d8e677e4eeb2760d7a5ab7b7553359b
Lars Ingebrigtsen
Thu Aug 4 11:03:10 2022 +0200
2022-10-04 17:18:04 -04:00
Lars Ingebrigtsen e9df837d8a Backport commit 0a6e2b3bf from Emacs
* lisp/ox.el (org-export-to-file): Fix quoting of #' in doc strings.

Fix quoting of #' in some doc strings
0a6e2b3bfce8b5ae9e713e0668cb3cf5609073e2
Lars Ingebrigtsen
Wed Aug 3 13:14:32 2022 +0200
2022-10-04 17:18:04 -04:00
Lars Ingebrigtsen 19c3969e75 Backport commit 2682ea1b3 from Emacs
* lisp/org.el (org-dynamic-block-define): Autoload because
it's referred to in org-loaddefs.el.

Fix org.el byte-compile warning in org-loaddefs.el
2682ea1b3a9524eb54efac41b3221b514374c232
Lars Ingebrigtsen
Sun Jul 31 11:43:48 2022 +0200
2022-10-04 17:18:04 -04:00
Stefan Kangas e7059f7dbe Backport commit 22a5f0223 from Emacs
* lisp/org.el (org-file-apps):
Doc fixes; don't mention XEmacs specific library EFS.

Doc fixes: don't mention EFS
22a5f022344af8c0c0a9eddc2ac5ad36392d0cef
Stefan Kangas
Thu Jul 28 10:48:38 2022 +0200
2022-10-04 17:18:04 -04:00