Commit Graph

27776 Commits

Author SHA1 Message Date
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
Stefan Monnier cb758720f3
testing/org-test.el (<toplevel>): Remove dead code
(featurep 'org) is always non-nil here since we have a (require 'org)
further up.  I suspect other `require's nearby could be removed or
moved to toplevel.
2024-06-15 16:27:15 +02:00
Stefan Monnier 3fa18371ee
mk/default.mk (BTEST): Remove `-l cl'
The CL library is deprecated and it's not needed here any more.
I suspect other `-l' could be removed here since `org-test' loads
those libraries anyway.
2024-06-15 16:27:04 +02:00
Stefan Monnier 4d4bc20861
(org-*-in-calendar): Prefer `apply' to `eval'
* lisp/org.el (org-funcall-in-calendar): Rename from `org-eval-in-calendar'.
Use `apply' rather than `eval'.  Use `with-selected-window' rather than
cooking our own version of it.  Update all callers.
(org-read-date): Use `with-current-buffer' to set `cursor-type' since
it's not affected by the selected window.
Move the `calendar-forward-day' call to `org-funcall-in-calendar' to
clarify the need to update `org-date-ovl'.
(org-eval-in-calendar): New backward compatibility function.

* lisp/org-keys.el (org-eval-in-calendar): Remove unused declaration.
2024-06-15 16:26:39 +02:00
Ihor Radchenko a9a05dab81
lisp/org-src.el (org-src-lang-modes): Fix :type definition
Reported-by:  Mattias Engdegård <mattias.engdegard@gmail.com>
Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71566
2024-06-15 16:15:45 +02:00
Ihor Radchenko be39e61c4e
Use emacs-internal coding system to read/write Elisp data
* lisp/org-persist.el (org-persist--read-elisp-file):
(org-persist--write-elisp-file):
* lisp/ox.el (org-export-async-start):

Suggested by Emacs maintainer.

Link: https://list.orgmode.org/861q4zy0va.fsf@gnu.org/
2024-06-15 15:45:40 +02:00
Rudolf Adamkovič c4434f825d
ob-lua: Do not confuse list-like strings with lists
* lisp/ob-lua.el (org-babel-lua-wrapper-method): Prevent Org Babel
from confusing strings that look like lists with actual lists.
* testing/lisp/test-ob-lua.el (test-ob-lua/result/none):
(test-ob-lua/result/nil):
(test-ob-lua/result/nil/multiple):
(test-ob-lua/result/boolean):
(test-ob-lua/results/number/integer):
(test-ob-lua/results/number/integer/negative):
(test-ob-lua/results/number/integer/multiple):
(test-ob-lua/results/number/real):
(test-ob-lua/results/number/real/multiple):
(test-ob-lua/results/number/infinity):
(test-ob-lua/results/string/single-quotes):
(test-ob-lua/results/string/double-quotes):
(test-ob-lua/results/string/multiple):
(test-ob-lua/results/string/list-like):
(test-ob-lua/results/string/list-like/brackets):
(test-ob-lua/results/string/list-like/curlies):
(test-ob-lua/results/string/list-like/multiple):
(test-ob-lua/result/table):
(test-ob-lua/result/table/pretty-print):
(test-ob-lua/result/table/pretty-print/sorted):
(test-ob-lua/results/value-separator): Add new tests.
2024-06-15 14:59:09 +02:00
Rudolf Adamkovič c23d5fc5dc
ob-lua: Improve documentation strings and commentary
* lisp/ob-lua.el (org-babel-lua-mode):
(org-babel-lua-hline-to):
(org-babel-lua-None-to):
(org-babel-lua-var-to-lua):
(org-babel-lua-table-or-string):
(org-babel-lua-evaluate-external-process): Harmonize spelling,
capitalization, and quoting.
2024-06-15 14:59:08 +02:00
Rudolf Adamkovič 58e5d1d5a6
ob-lua: Remove half-baked session support
* lisp/ob-lua.el (org-babel-execute:lua):
(org-babel-prep-session:lua):
(org-babel-load-session:lua):
(org-babel-lua-session-buffer):
(org-babel-lua-with-earmuffs):
(org-babel-session-buffer:lua):
(org-babel-lua-without-earmuffs):
(lua-default-interpreter):
(lua-which-bufname):
(lua-shell-buffer-name):
(org-babel-lua-initiate-session-by-key):
(org-babel-lua-initiate-session):
(org-babel-lua-evaluate):
(org-babel-lua-evaluate-external-process):
(org-babel-lua-evaluate-session):
(org-babel-lua-read-string): Remove all unfinished Lua and Emacs Lisp
code related to sessions and emit a user error when a Lua session is
requested.
* testing/lisp/test-ob-lua.el (test-ob-lua/no-sessions): Test the user
error emitted when requesting a Lua session.

Link: https://list.orgmode.org/87y192etb4.fsf@localhost/
2024-06-15 14:59:07 +02:00
Rudolf Adamkovič 80f6a949e5
ob-lua: Sort tabular results
`test-ob-lua/colnames-yes-header-argument-pp' fails intermittently due
to tabular results being returned from Lua to Emacs Lisp in different
order than expected.  We fix the problem by sorting all tabular
results before returning them.

* lisp/ob-lua.el (org-babel-lua-wrapper-method): Sort all tabular
results, recursively, before returning them from Lua to Emacs Lisp.
2024-06-15 14:59:06 +02:00
Rudolf Adamkovič 3ccc1ca6ec
ob-lua: Escape double quote characters in results
* lisp/ob-lua.el (org-babel-lua-wrapper-method): Escape all double
quote characters in Lua before giving them to Org Babel.
* testing/lisp/test-ob-lua.el (test-ob-lua/escaping-quotes): Test
automatic escaping of double quote characters.

Reported-by: Max Nikulin <manikulin@gmail.com>
Link: https://list.orgmode.org/216278dc-075c-47d1-94dc-f5bde8346b3c@gmail.com/
2024-06-15 14:59:06 +02:00
Ihor Radchenko 1387e36135
Update version number for the 9.7.4 release 2024-06-15 13:14:58 +02:00
Ihor Radchenko 55fd660b4e
org-element: Auto-undefer deferred properties that depend on buffer positions
* lisp/org-element.el (org-element--get-node-properties):
(org-element--headline-parse-title):
(org-element--headline-parse-title-raw):
(org-element--headline-parse-title-parse):
(org-element-comment-block-parser):
(org-element-example-block-parser):
(org-element-export-block-parser):
(org-element-latex-environment-parser):
(org-element-src-block-parser):
(org-element-table-parser):
(org-element--parse-generic-emphasis):
(org-element-export-snippet-parser):
(org-element-inline-babel-call-parser):
(org-element-latex-fragment-parser): Auto-undefer node properties that
are calculated based on buffer position of the node.  This will make
the return value of `org-element-at-point' a little more robust once
the buffer is modified.  The :begin/:end, and other positional
properties may not be up-to-date, but at least some other properties
may be "frozen" if they are undeferred early.  Auto-undefer is still
disabled for properties that do not depend on buffer positions and may
benefit from dynamic calculation that takes into account syntax
changes that are influenced by global variables.
2024-06-14 16:22:00 +02:00
Ihor Radchenko 73da6beb50
org-link-plain-re: Improve heuristic regexp for plain link detection
* lisp/ol.el (org-link-make-regexps): Allow trailing ?- at the end of
the plain links.
* etc/ORG-NEWS (Trailing =-= is now allowed in plain links): Announce
the change.

Link: https://orgmode.org/list/87sexh9ddv.fsf@ice9.digital
2024-06-14 16:03:05 +02:00
Ihor Radchenko 9f0a9ec34a
org-lint: New linter for malformed CLOCK: lines
* lisp/org-lint.el (org-lint-clock-syntax): New linter.

Link: https://list.orgmode.org/orgmode/0e2ed754-bc71-4558-9c46-f17d73981fe5@NymanTechnology.com/
2024-06-14 15:35:59 +02:00
Ihor Radchenko 34c99027e0
Merge branch 'bugfix' 2024-06-14 15:31:09 +02:00
Ihor Radchenko fd8ddf2874
org-clock-sum: Gracefully skip invalid CLOCK lines
* lisp/org-clock.el (org-clock-sum): Skip invalid CLOCK
lines (malformed or with times missing).  Display a warning.

This brings back the old behavior with such CLOCK lines being silently
skipped.  Now, we also display a warning.

Reported-by: Robert Nyman <RKNyman@NymanTechnology.com>
Link: https://list.orgmode.org/orgmode/0e2ed754-bc71-4558-9c46-f17d73981fe5@NymanTechnology.com/
2024-06-14 15:29:08 +02:00
Ihor Radchenko f2be2fd073
Merge branch 'bugfix' 2024-06-14 15:05:29 +02:00
Ihor Radchenko 2347eac669
lisp/org.el (org--dnd-rmc): Fix `read-multiple-choice' call
* lisp/org.el (org--dnd-rmc): Add docstring.  Fix the call to
`read-multiple-choice' when extended help ("?") is requested by the
user.

Reported-by: Johann Klähn <org-mode@web.jklaehn.de>
Link: https://orgmode.org/list/87ikyhg9qi.fsf@jklaehn.de
2024-06-14 15:03:49 +02:00
Ihor Radchenko 3e4588c732
Merge branch 'bugfix' 2024-06-14 14:35:04 +02:00
Ihor Radchenko bd8b861ee9
org-num-skip-tags: Avoid using function that is not pre-loaded in autoloads
* lisp/org-num.el (org-num-skip-tags): Make sure that function used
for :safe `defcustom' slot does not require functions that are not
defined in org-loaddefs.el.  This is because `org-num-skip-tags' is
autoloaded and cannot rely upon requires in org-num.el.  Instead, it
may only use pre-loaded functions and other autoloaded Org mode
functions.

Reported-by: Eli Zaretskii <eliz@gnu.org>
Link: https://yhetil.org/emacs-devel/868qzd9hjg.fsf@gnu.org/
2024-06-14 14:25:03 +02:00
Ihor Radchenko 4bb0719374
org-capture-templates: Remove no-longer-supported variants from :type spec
* lisp/org-capture.el (org-capture-templates): Remove "sexp" type from
allowed values of capture targets.  S-exp support has been removed in
f5645675a3.
2024-06-14 13:48:10 +02:00
Ihor Radchenko 1686b6f3ba
org-attach-dir-from-id: Search existing attachments for symlinks
* lisp/org-attach.el (org-attach-dir-from-id): When current buffer
displays a symlinked file, search for existing attachments in the
original file dir.
* etc/ORG-NEWS (=org-attach= now considers symlinked files when
searching pre-existing attach dirs): Announce the change.

Reported-by: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
Link: https://orgmode.org/list/87seyydnf7.fsf@localhost
2024-06-14 13:40:42 +02:00
Ihor Radchenko cbea9fa70f
Merge branch 'bugfix' 2024-06-14 11:47:35 +02:00
Ihor Radchenko 13fdbf73ff
mk: Prevent search local id: db when building manuals
* mk/org-fixup.el (org-make-manual):
(org-make-guide):
(org-make-manuals): Disable local ID db when building Org
documentation.  This makes sure that local IDs on the build machine
can never influence the build process.

Reported-by: Eli Zaretskii <eliz@gnu.org>
Link: https://yhetil.org/emacs-devel/868qzd9hjg.fsf@gnu.org/
2024-06-14 11:40:20 +02:00
Ihor Radchenko 6310bcd5ed
Merge branch 'bugfix' 2024-06-13 18:04:18 +02:00
Ihor Radchenko d7b5c19daa
DnD: Create directory when `org-yank-image-save-method' is a directory
* lisp/org.el (org--dnd-attach-file): Make sure that target directory
is created before copying file when `org-yank-image-save-method' is
set to specific directory (not 'attach).

Reported-by: ISouthRain <isouthrain@qq.com>
Link: https://orgmode.org/list/tencent_AABB2DEBF7ABFBC795348C288E0EBFCFDD0A@qq.com
2024-06-13 18:03:50 +02:00
Ihor Radchenko 8f40da6bf6
Merge branch 'bugfix' 2024-06-13 17:31:05 +02:00
Ihor Radchenko 96113f3b59
org-export--set-variables: Fix variable assignment
* lisp/ox.el (org-export--set-variables): Assume that variables are
listed as (var value) - as a list.  Only use the second element of the
list as the value, following example in `org-export-get-environment'.
(org-export-get-environment): Use `org-export--set-variables'.
* testing/lisp/test-ox.el (test-org-export/bind-keyword): Add new
test.

Reported-by: Suhail Singh <suhailsingh247@gmail.com>
Link: https://orgmode.org/list/87cyonhuq3.fsf@gmail.com
2024-06-13 17:26:44 +02:00