Commit Graph

27954 Commits

Author SHA1 Message Date
Stefan Kangas fa7d7ec3bd Backport commit fb11294d4 from Emacs
; Fix typos
fb11294d4156a4be45080ff286a8ee0d5a3ede9b
Stefan Kangas
Sun Jun 23 16:40:06 2024 +0200
2024-06-27 23:13:49 -04:00
Ihor Radchenko 4077e9e45b Backport commit c645e1d82 from Emacs
org-link-expand-abbrev: Do not evaluate arbitrary unsafe Elisp code
c645e1d8205f0f0663ec4a2d27575b238c646c7c
Ihor Radchenko
Sat Jun 22 00:54:36 2024 +0200

[ km: This was independently covered on the bugfix branch with
  f4cc61636.  I'm applying it here too for bookkeeping/traceability
  purposes. ]
2024-06-27 23:13:49 -04:00
Stefan Kangas b72871ab6a Backport commit a7dff8c53 from Emacs
* lisp/ob-lua.el: Minor doc fixes.

a7dff8c53dde18c703f470cde9ad033cffe8c766
Stefan Kangas
Tue Jun 18 21:27:51 2024 +0200
2024-06-27 23:13:47 -04:00
Stefan Kangas 5d7218ceff Backport commit c0eefebab from Emacs
; Fix typos
c0eefebabfee011f0ec7631d055e482e4965a24d
Stefan Kangas
Sun Jun 16 22:38:26 2024 +0200
2024-06-27 22:47:14 -04:00
Ihor Radchenko b64dbd838f
org-babel-sh-evaluate: Always provide shebang in script files
* lisp/ob-shell.el (org-babel-sh-evaluate): When running src block as
script file, make sure that shebang is always added on top.  This is
to prevent <shell> <script> command in shells like dash form using
/bin/sh to evaluate scripts without shebang.  (In contrast with bash
that uses itself).  Add comment highlighting that
`with-connetion-local-variables' sets `shell-file-name' and
`shell-command-switch' as necessary.
*
testing/lisp/test-ob-shell.el (test-ob-shell/remote-with-stdin-or-cmdline):
Add new test.

Reported-by: Max Nikulin <manikulin@gmail.com>
Link: https://list.orgmode.org/orgmode/v0an63$3n2$1@ciao.gmane.io/
2024-06-27 15:07:19 +02:00
Ihor Radchenko 1c7b3ed26b
ob-shell: Pass :cmdline arguments consistently regardless of :shebang
* lisp/ob-shell.el (org-babel-sh-evaluate): When invoking script file
generated from the code block, consistently use
<shell-name> -c <script-file> <cmdline-args> command line, even when
:shebang is header argument is provided.  The previous approach with
<script-file> <cmdline-args> call caused differences in how shell
parsed the provided command line arguments.
* testing/lisp/test-ob-shell.el (test-ob-shell/cmdline): New test.

Reported-by: Max Nikulin <manikulin@gmail.com>
Link: https://orgmode.org/list/18f01342a2f.124ad27612732529.8693431365849276517@excalamus.com
2024-06-27 14:17:03 +02:00
Ihor Radchenko 9f6c29815d
Merge branch 'bugfix' 2024-06-27 12:11:10 +02:00
Ihor Radchenko 5ffb2675f5
org-persist: Avoid interactive query for coding system when computing hash
* lisp/org-persist.el (org-persist--normalize-associated): Force
'emacs-internal coding system when computing buffer contents hash.

Reported-by: Eli Zaretskii <eliz@gnu.org>
Link: https://orgmode.org/list/86jzia68ih.fsf@gnu.org
2024-06-27 12:07:29 +02:00
Ihor Radchenko 8a4a3ecb14
Merge branch 'bugfix' 2024-06-27 11:53:49 +02:00
Ihor Radchenko 14e8a68a67
org--collect-keywords-1: Fix when global `tab-width' is not 8
* lisp/org.el (org--collect-keywords-1): When faking that `org-mode'
is loaded, make sure that we set correct `tab-width' for the parser to
work.

Reported-by: kazark <kazark@zoho.com>
Link: https://orgmode.org/list/19056b6b712.b56dc3e1403727.546293949229584581@zoho.com
2024-06-27 11:49:21 +02:00
Ihor Radchenko e4250780ae
Merge branch 'bugfix' 2024-06-26 15:00:07 +02:00
Ihor Radchenko 498fd25d25
ob-R, ob-python, ob-shell: Fix async indicator regexps
* lisp/ob-R.el (ob-session-async-org-babel-R-evaluate-session):
* lisp/ob-python.el (org-babel-python-async-evaluate-session):
* lisp/ob-shell.el (org-babel-sh-evaluate): Make regexps stricter,
matching exactly for what we put there.  Previous regexps were not
always matching file names with underscores.

Reported-by: Sam Crawford <sam@crawf.uk>
Link: https://orgmode.org/list/h6c_ta-utc-ugGl4Bq1XXJpXcpXlm_rblFIGJKMH0xiPc-NnJsuVe2z8atXGNcsBlJiR9c24bqLyXFX3GO0tiWtyTUzXMJA81wRIIB-DQfo=@crawf.uk
2024-06-26 14:59:47 +02:00
Daniel M German 553d9b5798
ob-sqlite: Add ability to open a database in readonly mode
* lisp/ob-sqlite.el (org-babel-header-args:sqlite):
(org-babel-execute:sqlite): Add new header argument :readonly.
* etc/ORG-NEWS (ob-sqlite: Added ability to open a database in
readonly mode): Announce the new header argument.
2024-06-25 12:53:52 +02:00
Ihor Radchenko de775a36d9
org-manual: Fix grammar issues identified by LanguageTool
* doc/org-manual.org:
2024-06-23 13:14:40 +02:00
Matthias Hetzenberger bd16944e1b
org-babel-merge-params: Rename plists to alists
* lisp/ob-core.el (org-babel-merge-params): Rename PLIST(S)
variables/args to ALIST(S).

TINYCHANGE
2024-06-23 11:11:12 +02:00
Ihor Radchenko 39272e2165
Merge branch 'bugfix' 2024-06-22 17:59:26 +02:00
Ihor Radchenko eafa479069
Update version number for the 9.7.5 release 2024-06-22 17:53:19 +02:00
Ihor Radchenko e6de840889
etc/ORG-NEWS: Announce security fix
* etc/ORG-NEWS (Arbitrary shell commands are no longer run when
turning on Org mode):
2024-06-22 17:53:17 +02:00
Ihor Radchenko f4cc616369
org-link-expand-abbrev: Do not evaluate arbitrary unsafe Elisp code
* lisp/ol.el (org-link-expand-abbrev): Refuse expanding %(...) link
abbrevs that specify unsafe function.  Instead, display a warning, and
do not expand the abbrev.  Clear all the text properties from the
returned link, to avoid any potential vulnerabilities caused by
properties that may contain arbitrary Elisp.
2024-06-22 16:32:33 +02:00
Ihor Radchenko 6cada29c08
org-link-plain-re: Do not allow spaces inside URL
* lisp/ol.el (org-link-make-regexps): Improve plain URL regexp.
Prohibit all kinds of spaces.

Suggested-by: Max Nikulin <manikulin@gmail.com>
Link: https://orgmode.org/list/v516i1$kuv$1@ciao.gmane.io
2024-06-22 15:35:47 +02:00
Ihor Radchenko 7fa1694ec6
mk/targets.mk (.PHONY): Add missing non-file targets 2024-06-20 18:29:44 +02:00
Ihor Radchenko 4c5132b9f1
Fix parallel execution of Makefiles
* lisp/Makefile (.NOTPARALLEL):
* mk/targets.mk (.NOTPARALLEL): Do not fiddle with explicit
.NOTPARALLEL.  Given that we provide correct dependencies, parallel
execution should work, and it does work.
2024-06-20 18:27:04 +02:00
Ihor Radchenko 77403e376a
Revert "mk: Allow parallel execution"
This reverts commit 71fbe92c2e.

Parallel make still does not work.
2024-06-20 18:11:18 +02:00
Al Haji-Ali a4ff518a2e
org-refile-get-location: Fix outline path to a symlink of current buffer
* lisp/org-refile.el (org-refile-get-location): When current buffer
file is a symlink to refile location, do not append the file name to
the outline path, just as we do when current buffer is the same as
refile location file.

TINYCHANGE
2024-06-20 16:48:28 +02:00
Ihor Radchenko 9f4f7338d7
org-element-timestamp-parser: Fix regexp
* lisp/org-element.el (org-element--timestamp-regexp): Do not match
malformed timestamps like:

<202-07-10 .+1d>

`org-ts-regexp-both' already covers the removed part of the regexp.
It appears that the problematic regexp is coming from a copy-paste from
`org-agenda-get-timestamps' where the inaccurate regexp is used to
search timestamps with repeaters in conjunction to searching for exact
agenda dates.  In `org-agenda-get-timestamps', inaccuracy is not a
problem because proper matching against `org-ts-regexp-both' is
performed later, simply skipping non-timestamps.

Reported-by: Platon Pronko <platon7pronko@gmail.com>
Link: https://orgmode.org/list/6000e3bf-f95f-44fd-b321-cf44acd5c485@gmail.com
2024-06-20 16:26:37 +02:00
Andras Simonyi 782f6c33be oc-csl: New custom option `org-cite-csl-bibtex-titles-to-sentence-case'
* lisp/oc-csl.el (org-cite-csl-bibtex-titles-to-sentence-case): New
variable.
(org-cite-csl--processor): Create the itemgetter using the new option.
* etc/ORG-NEWS (New option
~org-cite-csl-bibtex-titles-to-sentence-case~): Announce the change.
2024-06-20 07:41:56 +02:00
Morgan Smith fc0fb90b67
; fix typos
* doc/org-manual.org: Add missing '~'.
* lisp/org-element-ast.el (org-element-deferred): Fix typo in docstring.
* lisp/org-element.el (org-element-archive-tag,
org-element-drawer-re-nogroup, org-element--cache-log-message): Fix
typos in docstring.
(org-element--current-element, org-element--cache-find,
org-element-cache-map): Fix typos in comments.
2024-06-19 17:34:31 +02:00
Ihor Radchenko a92951d0c6
org-link-expand-abbrev: Auto-disable custom abbrevs that fail to expand
* lisp/ol.el (org-link-expand-abbrev): When a custom link abbrev
function errs or returns non-string, show a warning and disable that
abbrev.
2024-06-19 17:14:02 +02:00
Ihor Radchenko 840cb395aa
test-org-capture/entry: Fix Emacs 27 compatibility
* testing/lisp/test-org-capture.el (test-org-capture/entry): Use
`org-dlet' instead of `dlet' that is not yet available in Emacs 27.
2024-06-18 18:09:21 +02:00
Ihor Radchenko c37a17ac2a
make up1/up2/update/update2: Clean and generate autoloads before building docs/tests
We need to run clean to get rid of stale .elc files from before git
fetch, and we need to generate autoloads to make things run properly.

Reported-by: Rustom Mody <rustompmody@gmail.com>
Link: https://orgmode.org/list/CAJ+TeofCBfEo-WyGk-n0DATW3QNKjBRayQYbMXrTFAy-TX+ovA@mail.gmail.com
2024-06-18 17:22:53 +02:00
Ihor Radchenko defcf83365
Makefile ($(info): Document make repro
Reported-by: Rustom Mody <rustompmody@gmail.com>
Link: https://orgmode.org/list/CAJ+TeofCBfEo-WyGk-n0DATW3QNKjBRayQYbMXrTFAy-TX+ovA@mail.gmail.com
2024-06-18 17:01:01 +02:00
Ihor Radchenko 267c5dae32
mk/default.mk (REPRO): Ensure consistency with make vanilla 2024-06-18 17:00:42 +02:00
Visuwesh fed19a934d
org-plot: Respect parameters given in `org-plot/preset-plot-types'
* org-plot.el (org-plot/gnuplot-script-preamble)
(org-plot/gnuplot-term-extra): Explain what "plot type" means.
(org-plot/preset-plot-types): Fix docstring and correct the lambda
argument order for the 'grid' plot type.
(org-plot/gnuplot): Merge the parameters given in
`org-plot/preset-plot-types' and the #+PLOT line to ensure the former
is respected everywhere.

Reported-by: Visuwesh <visuweshm@gmail.com>
Link: https://orgmode.org/list/87cypbjw50.fsf@gmail.com
2024-06-18 16:24:17 +02:00
Ihor Radchenko 2fbb73b560
Merge branch 'bugfix' 2024-06-18 14:51:40 +02:00
Raffael Stocker 157a0559e5
lisp/org-colview.el: Prevent repeated indentation of keyword lines
* org-colview.el (org-columns-dblock-write-default): Left trim keyword
and TBLFM lines to prevent repeated indentation.

Link: https://list.orgmode.org/orgmode/yplmfrtchs0u.fsf@mnet-mail.de/

TINYCHANGE
2024-06-18 14:50:53 +02:00
Ihor Radchenko 5e9ac146fb
ob-shell: Add "initiate" session implementation for "shell" blocks
* lisp/ob-shell.el (org-babel-shell-initiate-session): Define an an
alias to `org-babel-sh-initiate-session' for #+begin-src shell blocks.

Reported-by: Suhail Singh <suhailsingh247@gmail.com>
Link: https://orgmode.org/list/87tthrv2wt.fsf@gmail.com
2024-06-18 14:43:36 +02:00
Ihor Radchenko 3271d7d9f8
etc/ORG-NEWS: Fix headline level for feature announcement 2024-06-18 14:34:02 +02:00
Nafiz Islam 5265153fc5
org-capture-templates: Allow headline/olp target to be function or symbol
* doc/org-manual.org: Add target spec format for function and symbol
for headline and olp.
* etc/ORG-NEWS: Announce the updated options for
`org-capture-templates'.
* lisp/org-capture.el (org-capture-templates): Update customization
type for `file+headline', `file+olp', and `file+olp+datetree' targets,
and update docstring.
(org-capture-expand-headline): Define a new function that computes
headline string from target spec.
(org-capture-expand-olp): Define a new function that computes olp list
from target spec.
(org-capture-set-target-location): Use `org-capture-expand-headline'
to expand headline, and use `org-capture-expand-olp' to expand outline
path.
* testing/lisp/test-org-capture.el (test-org-capture/entry): Add tests
for at most three different kinds of target for `file+headline',
`file+olp', and `file+olp+datetree'.
(test-org-capture/org-capture-expand-olp): Add tests for
`org-capture-expand-olp'.
2024-06-18 14:33:55 +02:00
Visuwesh 102181e030
org-plot: Make data-file stable for replot-on-resize
* lisp/org-plot.el (org-plot/gnuplot): Use a stable data-file to make
replot-on-resize in GUI terminals work.

Reported-by: Visuwesh <visuweshm@gmail.com>
Link: https://orgmode.org/list/87mso7sl6g.fsf@gmail.com
2024-06-17 19:03:12 +02:00
Ihor Radchenko 5b366a731b
org-babel-shell-initialize: Define session API backend for all the shells
* lisp/ob-shell.el (org-babel-shell-initialize): Define
org-babel-prep-session:<shell-name> and
org-babel-<shell-name>-initiate-session functions.

Without this, `org-babel-switch-to-session' does not work for ob-shell
blocks.
2024-06-17 17:44:31 +02:00
Ihor Radchenko 7393803716
Merge branch 'bugfix' 2024-06-17 17:35:28 +02:00
Ihor Radchenko e666660c7d
ob-shell: Fix header arg definitions for specific shells
* lisp/ob-shell.el (org-babel-shell-initialize): Assign default value
from `org-babel-default-header-args:shell' and
`org-babel-header-args:shell' for specific shell variables.

Reported-by: Suhail Singh <suhailsingh247@gmail.com>
Link: https://orgmode.org/list/87frtczgu6.fsf@gmail.com
2024-06-17 17:34:28 +02:00
Ihor Radchenko 84f9d81abc
org-update-checkbox-count: Do not move point beyond current heading
* lisp/org-list.el (org-update-checkbox-count): Do not move point
before current heading when point is already on heading.

Reported-by: Bruno Cardoso <cardoso.bc@gmail.com>
Link: https://orgmode.org/list/878qz49an7.fsf@gmail.com
2024-06-17 17:21:01 +02:00
Morgan Smith b7b188e233
lisp/org-compat.el: Allow using imenu to visit non-leaf headlines
* lisp/org-compat.el (org-imenu-get-tree): Add the current headline to
the tree as a simple item even if it isn't a leaf.

With a file like this:

* headline 1
** headline 2

We currently produce an imenu tree that looks like this:

'(("headline 1" ("headline 2" . marker-2)))

imenu has no clue where "headline 1" is located and thus the user
can't navigate to it.  With this patch installed imenu knows where
non-leaf headlines are as the tree will now look like this:

'(("headline 1" . marker-1)
  ("headline 1" ("headline 2" . marker-2)))

Quirks:

With the default `imenu-flatten' value of nil, it is still impossible
to visit non-leaf headlines and no change is perceived.

Setting `imenu-flatten' to 'group works as expected with the quirk
that top level headlines don't end up in the group.

Ex:
* Headline 1
Group is "*"
Setting the group to "Headline 1" somehow might be nice but would
require upstream changes in imenu.
** Headline 2
Group is "Headline 1"
*** Headline 3
Group is "Headline 1:Headline 2"

Everything seems to work as expected when `imenu-flatten' is set to
'prefix or 'annotation.

Link: https://orgmode.org/list/CH3PR84MB34241FF78D2A1D8653FE6056C5C22@CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM
2024-06-17 15:20:33 +02:00
Kyle Meyer 165319f584 ob-core: Revert recent indentation change
* lisp/ob-core.el (org-babel-insert-result): Fix indentation change
from e4902995a.
2024-06-15 14:19:28 -04:00
Kyle Meyer d0b1729ad5 Merge branch 'km/from-emacs-master' into bugfix 2024-06-15 13:24:08 -04:00
Stefan Kangas 8a82a06bec ORG-NEWS: Backport commit 77d0eed74 from Emacs
; Fix typos
77d0eed74e1d934e28f364cb3adb06365e71335e
Stefan Kangas
Mon Jun 10 00:40:26 2024 +0200

[km] This should have been included with 2a6a0480d.
2024-06-15 13:22:28 -04:00
Ihor Radchenko 008c28426d
ob-clojure-cli-command: Fix :type declaration
* lisp/ob-clojure.el (ob-clojure-cli-command): Allow nil value.  It
can happen, even though it will yield error (which is a different
issue).  But let's follow other defcustoms in the file.

Reported-by: Mattias Engdegård <mattias.engdegard@gmail.com>
Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71566
2024-06-15 16:45:54 +02:00
Ihor Radchenko 12243b9910
lisp/ob-lilypond.el (org-src-lang-modes): Fix alist value
LilyPond-mode name should be a symbol as per `org-src-lang-modes'
spec.

Reported-by: Michael Albinus <michael.albinus@gmx.de>
Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71566
2024-06-15 16:33:12 +02:00
Stefan Monnier 96d149a660
testing/lisp/*.el: Fix second arg to `signal'
The second argument to `signal' should be a list, as explained in its
docstring.  Fix `missing-test-dependency' signals accordingly.
2024-06-15 16:27:24 +02:00