Commit Graph

25914 Commits

Author SHA1 Message Date
Ihor Radchenko 89d13998bd
org-element-fixed-width-parser: Fix when :value is empty
* lisp/org-element.el (org-element-fixed-width-interpreter): Interpret
fixed-width element with :value "" as ":\n", not as empty string.
* testing/lisp/test-org-element.el (test-org-element/fixed-width-interpreter):
Fixed the test.

The previous test, albeit intentionally asserting "" result, breaks
reversibility of parse-interpret sequence.
2023-01-12 12:23:19 +03:00
Bastien 630f86dfc4 Update version number for the 9.6.1 release 2023-01-11 16:00:12 +01:00
Ihor Radchenko a6523f1aa0
org-export-output-file-name: Remove redundant `cond' clause
* lisp/ox.el: Remove `cond' clause equivalent to t.
2023-01-07 15:13:52 +03:00
Ihor Radchenko 5a8a1d4ff9
org-compile-file: Expand "~" in SOURCE
* lisp/org-macs.el (org-compile-file): Expand "~" in the source before
passing it as quoted shell argument.

Reported-by: Alain.Cochard@unistra.fr
Link: https://orgmode.org/list/25528.42190.53674.62381@gargle.gargle.HOWL
2023-01-07 15:12:41 +03:00
Leo Butler 41ebc2e40c
test-ob-octave.el: wrap get-buffer in buffer-live-p
* testing/lisp/test-ob-octave.el (ob-octave/graphics-file):
(ob-octave/graphics-file-session):
(ob-octave/graphics-file-space): Wrap GET-BUFFER in BUFFER-LIVE-P.
This ensures that a killed buffer does not cause an incorrect failure
of a test.

Link: https://orgmode.org/list/87bknh5nva.fsf@localhost
2023-01-06 18:01:37 +03:00
Ihor Radchenko 28a9664844
org-manual.org: Clarify that `org-insert-property-drawer' is not a command
* doc/org-manual.org (Drawers): Emphasize that
`org-insert-property-drawer' is not interactive command, but a
function.

Reported-by: Alain.Cochard@unistra.fr
Link: https://orgmode.org/list/tp3pbi$dk$1@ciao.gmane.io
2023-01-06 16:30:42 +03:00
Ihor Radchenko 93339de71b
org-babel-shell-initialize: Fix `org-babel-prompt-command'
* lisp/ob-shell.el (org-babel-shell-initialize): Do not search shell
name string by `eq' in `org-babel-shell-set-prompt-commands' alist.
Use `assoc' that is comparing by `equal' instead.

Reported-by: Matt <matt@excalamus.com>
Link: https://orgmode.org/list/87h6x8kluc.fsf@localhost
2023-01-05 11:26:40 +03:00
Ihor Radchenko 58aeb1af15
org-persist-unregister: Fix when ASSOCIATED is 'all
* lisp/org-persist.el (org-persist-unregister): Do not try to
normalize 'all ASSOCIATED.  It is not a valid association that should
be handled specially.  Previously, an error was thrown.
2023-01-03 10:58:02 +03:00
Ihor Radchenko ce6f1799cc
org-options-keywords: Add missing keyword
* lisp/org.el: Add missing "EXPORT_FILE_NAME" that is mentioned in
13.2 Export Settings section of the manual.

Reported-by: Alain.Cochard@unistra.fr
Link: https://orgmode.org/list/25521.58663.963178.927459@gargle.gargle.HOWL
2023-01-02 12:07:17 +03:00
Ihor Radchenko 3454021483
Revert "org-babel-read: Obey `org-confirm-babel-evaluate'"
This reverts commit 10e857d428.

* lisp/ob-core.el:
(org-babel-merge-params):
(org-babel-process-params):
(org-babel-read):
* lisp/org-table.el: Add FIXME comments to places where arbitrary code
execution may happen.

The extra query is reverted until we develop a better code execution
safety system for Org.  The commit introduced too many user queries,
making the whole idea of asking users to execute code from Org files
not useful.

Link: https://orgmode.org/list/878rinadlq.fsf@localhost
2023-01-02 10:49:45 +03:00
Ihor Radchenko 1cd39c9e30
org-mode: Fix element cache updates when aligning tables during startup
* lisp/org.el (org-mode): Do not suppress modification hooks when
aligning tables.  Otherwise, cache state may become invalid.

Reported-by: Stefan <org@stefan.failing.systems>
Link: https://orgmode.org/list/87tu1wse45.fsf@localhost
2023-01-02 10:26:52 +03:00
Kyle Meyer 563a4396b6 org-assert-version: Deleting trailing whitespace
Otherwise this fails Emacs's pre-commit check.
2023-01-01 22:23:43 -05:00
Kyle Meyer a43866e1cf Update remaining copyright years
Most copyright years were updated with the port of Emacs's cae528457
in e0815d754.  Update the remaining copyright years for files that
have Free Software Foundation as the copyright holder but aren't
included in the Emacs repo.
2023-01-01 13:13:15 -05:00
Kyle Meyer 58e93869b7 Touch up copyright lines from cae528457
A few files had a copyright date of "2020-2020", and cae528457 (ported
by e0815d754) updated these to "2020, 2023-2020".  Correct these
spots.
2023-01-01 13:12:52 -05:00
Kyle Meyer 2f15b3c528 Merge branch 'km/from-emacs-29' into bugfix 2023-01-01 12:45:33 -05:00
Eli Zaretskii e0815d7545 Backport commit cae528457 from Emacs
; Add 2023 to copyright years.
cae528457cb862dc886a34240c9d4c73035b6659
Eli Zaretskii
Sun Jan 1 05:31:12 2023 -0500
2023-01-01 12:44:47 -05:00
Ihor Radchenko 9cee879b36
org-assert-version: Small refactoring
* lisp/org-macs.el (org-assert-version): Make quoting "'" in the
message more readable.

Thanks to Stefan Monnier <monnier@iro.umontreal.ca> for the
suggestion.
2023-01-01 15:58:19 +03:00
Ihor Radchenko 79e5e42e50
test-ob-octave.el: Remove test clauses causing race condition
* testing/lisp/test-ob-octave.el (ob-octave/graphics-file):
(ob-octave/graphics-file-session):
(ob-octave/graphics-file-space): Do not check the created image file
size.  This tests causes race condition between the test and Octave
writing image to disk.  Also, the correctness of image file is nothing
of Org's business as long as ob-ocatave's Elisp implementation is
concerned.
2023-01-01 15:56:13 +03:00
Kyle Meyer e316377767 Merge branch 'km/from-emacs-29' into bugfix 2022-12-31 18:13:31 -05:00
Stefan Kangas 92a40cf7a1 Backport commit 9292f595a from Emacs
; Fix typos
9292f595a71870eec1ffdfd187b859cc990c2f0b
Stefan Kangas
Sat Dec 31 12:43:32 2022 +0100
2022-12-31 18:11:46 -05:00
Ihor Radchenko 62dc49509c
org-assert-version: Do not display "'" as "’" in the code sample
* lisp/org-macs.el (org-assert-version): Dislpay (straight-use-package
'org) literally in the warning.

Reported-by: Stephen Eglen <sje30@cam.ac.uk>
Link: https://orgmode.org/list/m2edsgq1t8.fsf@cam.ac.uk
2022-12-31 16:10:11 +03:00
Ihor Radchenko 18577a495b
org-persist-register: Fix MISC argument handling
* lisp/org-persist.el (org-persist-register): Document that MISC must
be a plist.
(org-persist--get-collection): Throw an error when MISC is not a
plist.  Fix arglist - MISC is now passed explicitly as a single
object.
(org-persist--storage-version): Bump version to avoid obsolete
malformed containers with improperly included MISC.
2022-12-31 12:39:25 +03:00
Bastien 40e1c6c050 etc/ORG-NEWS: Fix typo 2022-12-30 09:17:19 +01:00
Ihor Radchenko e5c45358ae
test-ob-octave.el: Avoid race condition on slow machines
* testing/lisp/test-ob-octave.el (ob-octave/graphics-file):
(ob-octave/graphics-file-session):
(ob-octave/graphics-file-space): Delay `should' condition waiting for
file contents to be written by octave.  This may be necessary when
octave has not yet written the file contents (on slow machines).
Re-enable tests.

Link: https://orgmode.org/list/87r0wk29dz.fsf@localhost
2022-12-29 12:51:31 +03:00
Ihor Radchenko fc4bbb28f8
org-search-view: Fix searching across inlinetasks
* lisp/org-agenda.el (org-search-view): Consider that
`outline-next-heading' may move to inlinetask.

* testing/examples/agenda-search.org: New test file.

* testing/lisp/test-org-agenda.el (test-org-agenda/org-search-view):
New test.

Reported-by: Alain.Cochard@unistra.fr
Link: https://orgmode.org/list/25514.763.379510.806150@gargle.gargle.HOWL
2022-12-27 13:10:02 +03:00
Ihor Radchenko ecfb55af0a
org-src.el: Apply common faces even when src block language mode is absent
* lisp/org-src.el (org-src-font-lock-fontify-block): Apply
`org-src-block-faces'/`org-block' faces even when no major mode is
available for the src block language.

Reported-by: duskhorn <duskhorn@proton.me>
Link: https://orgmode.org/list/zCjC9UjXEgJk8kuyi8t2K2XzO3fL7pYWynHhoYWAes9eCA1FkomCY9bss4uKZfBg60M4xUisyDqFWKVMOn1r_XzUVE7gr3ci82MEOLjGIMk=@proton.me
2022-12-27 12:47:46 +03:00
Ihor Radchenko de83f548d9
org-persist-write:file: Do not overwrite existing cached file
* lisp/org-persist.el (org-persist-write:file): Do not try to copy on
top of the cached file, when already exists.
2022-12-26 20:07:30 +03:00
Kyle Meyer 8aea340d59 Merge branch 'km/from-emacs-29' into bugfix 2022-12-26 11:00:27 -05:00
Stefan Kangas 14cbbac212 Backport commit 2608e5edc from Emacs
; Fix typos
2608e5edcca5094b61b4ccebcef160cc2bfd7f83
Stefan Kangas
Mon Dec 26 10:42:02 2022 +0100
2022-12-26 10:59:44 -05:00
Ihor Radchenko b11abb409c
org-babel-insert-result: Output strings as is for lists of strings
* lisp/ob-core.el (org-babel-insert-result): Do not use %S format for
lists of strings in :results list output.  This is more consistent
with single string output.

Reported-by: Matt <matt@excalamus.com>
Link: https://orgmode.org/list/1852d9eb52f.c4c534f9581400.7140516675874523594@excalamus.com
2022-12-26 12:24:51 +03:00
Ihor Radchenko 9c79aedec7
org-agenda: Use more machine-friendly date output for csv export
* lisp/org-agenda.el (org-fix-agenda-info): Pad the month and date
numbers with 0, making sure that the date format is always YYYY-MM-DD.

Reported-by: David O'Toole <deeteeoh1138@gmail.com>
Link: https://orgmode.org/list/CAAz1J52e7ha=rtyz=Kn=o-X48XU3oNJYF57xo5hOBnz8_Twdyg@mail.gmail.com
2022-12-26 12:21:13 +03:00
Kyle Meyer 63e073f96e org-persist: Revert space misalignment from recent commit
987fe173a (org-persist: Do better job avoiding security issue
described in `make-temp-name', 2022-12-25) carried along an unrelated
space change.
2022-12-25 11:31:56 -05:00
Ihor Radchenko 718e196830
org-back-to-heading: Fix at inlinetask END
* lisp/org.el (org-back-to-heading): Fix when at inlinetask END.
* testing/lisp/test-org.el (test-org/org-back-to-heading): Add new
test.

Reported-by: Alain.Cochard@unistra.fr
Link: https://orgmode.org/list/25508.20192.899342.932809@gargle.gargle.HOWL
2022-12-25 15:49:28 +03:00
Ihor Radchenko f138810065
org-element: Allow inlinetasks to be commented and archived
* lisp/org-element.el (org-element-inlinetask-parser): Parse
inlinetasks closer to headings.  In particular, recognize COMMENT
keyword and ARCHIVE tag in inlinetasks on parser level.
* testing/lisp/test-org.el (test-org/comment-dwim): Add tests for
inlinetasks and for uncommenting headings.

Reported-by: Alain.Cochard@unistra.fr
Link: https://orgmode.org/list/25508.20192.899342.932809@gargle.gargle.HOWL
2022-12-25 15:32:01 +03:00
hugcis 318807013c
oc-basic.el: Fix wrong type for the editors field when parsing JSON.
* lisp/oc-basic.el (org-cite-basic--parse-json): Make sure
`org-cite-basic--parse-json' produces a string for the editors field.
The function `org-cite-basic--get-author' expects a string for both the
"authors" field and the "editors" field.
The conversion to string was only done for the "authors" field in
`org-cite-basic--parse-json'. This patch fixes the issue by applying the
transformation to both "authors" and "editors".

This points to a more general issue where `org-cite-basic--get-field' is
expected to return nil or a string, but calls
`org-cite-basic--get-entry' that may return an association list.

TINYCHANGE
2022-12-25 14:35:55 +03:00
Ihor Radchenko 7f2f73c414
org-babel-read: Small fix
* lisp/ob-core.el (org-babel-read): Remove redundant `format' call for
code block body.  The body is already a string.  Make the block name
more human readable using %s `format' arg.

Reported-by: Tom Gillespie <tgbugs@gmail.com>
Link: https://orgmode.org/list/CA+G3_PPFHcx6eeKGuvxDcuy3NjSpTnrbye0gHJePtvi2a-5wrg@mail.gmail.com
2022-12-25 13:58:06 +03:00
Ihor Radchenko 987fe173ac
org-persist: Do better job avoiding security issue described in `make-temp-name'
* lisp/org-persist.el: Create `org-persist-directory' early, when we
decide the directory name.  This way, even if third party code gets to
know the directory name in /tmp, it cannot raise file permissions by
creating `org-persist-directory' with loose access rights ahead of us.
Also, create and set `org-persist-directory' before we check if have
have proper access rights to write to it.
(org-persist-write-all): Do better job clearing
`org-persist-directory' if nothing is going to be written inside.
(org-persist-clear-storage-maybe): New function to be called before
exiting Emacs.  It is used to remove the persistent data before
exiting.  Multi-session persistence is not and must not be needed when
calling Emacs with -Q command line argument.  Call the function before
exiting Emacs in `kill-emacs-hook'.

Reported-by: Stefan Monnier <monnier@iro.umontreal.ca>
Link: https://yhetil.org/emacs-devel/jwvwn6kpmir.fsf-monnier+emacs@gnu.org
2022-12-25 12:17:36 +03:00
Ihor Radchenko e2366ac283
* lisp/org-persist.el: Do not litter /tmp when native compiling
Remove the directory created by `make-temp-file' when Emacs is called
with -Q command line argument.  Only use the return value as the
directory to be created when something is actually stored by
org-persist while running Emacs.

Reported-by: William Denton <wtd@pobox.com>
Link: https://orgmode.org/list/alpine.DEB.2.22.394.2212211213480.270543@shell3.miskatonic.org
2022-12-21 21:43:42 +03:00
Tom Gillespie a8c9f11757
Fix missing null check for tangle links during export
* lisp/ob-tangle.el (org-babel-tangle--unbracketed-link): Add the let
bound variable l to the and statement to prevent l from being passed
to `string-match' in the event that it is nil.

When tangling nested noweb blocks during export it is possible for the
results of `org-store-link' to return nil.  This commit ensures that
the value returned for l is only passed to `string-match' when it is
non-nil, avoiding a `wrong-type-argument' (stringp nil) error.

Handling of comments and nesting of babel blocks is known to have
issues.  The bug is from 8a781d35dc
where new code was introduced to obtain the value for bare which was
not present in early code.  I'm guessing that the bug appears now
because `string-match' is called on l (aka link) at a point in time
when it was never previously called and it was thus masked because in
the old version it was impossible to call `string-match' when `link'
was nil because another variable was always nil, masking the issue.
2022-12-21 15:40:27 +03:00
Ihor Radchenko db34a7d837
* lisp/ox-html.el (org-html-link): Fix call to `org-export-get-ordinal'
Pass list of type symbols as third argument following the docstring
spec.

Reported-by: Brian Powell <powellb@hawaii.edu>
Link: https://orgmode.org/list/m2tu1s458q.fsf@hawaii.edu
2022-12-21 15:28:48 +03:00
Ihor Radchenko a29103a786
* testing/lisp/test-ob-octave.el: Disable tests failing on CI only
(ob-octave/graphics-file):
(ob-octave/graphics-file-session):
(ob-octave/graphics-file-space): Disable tests until we figure the
origin of CI failures.  The tests are passing locally.

Link: https://orgmode.org/list/87cz8ifioa.fsf@localhost
2022-12-21 14:53:09 +03:00
Ihor Radchenko 12e10eb0dd
* doc/org-guide.org: Fix typos
(Visibility Cycling): Fix macro.
(Multi-state Workflow): Fix emphasis.
(Timestamps):
(Clocking Work Time):
(The Agenda Dispatcher): Fix heading link.

Reported-by: Cauim de Souza Lima <cauimsouza@gmail.com>
Link: https://orgmode.org/list/CAHFpVgHiZtBQ9U5CzJ1P1jGQVJhTGiP9uVdi9ttcP535urZkUg@mail.gmail.com
2022-12-18 17:41:52 +03:00
Ihor Radchenko 2247998758
ob-core: Fix :results list when result is a table
* lisp/ob-core.el (org-babel-insert-result): Do not treat table lines
in RESULT verbatim.
* testing/lisp/test-ob-shell.el (ob-shell/results-list): Add new test.

Reported-by: Rudolf Adamkovič <salutis@me.com>
Link: https://orgmode.org/list/m2tu1v8gj8.fsf@me.com
2022-12-18 14:18:54 +03:00
Kyle Meyer 47d1299e48 Merge branch 'km/from-emacs-29' into bugfix 2022-12-17 17:03:48 -05:00
Stefan Kangas c8b0a0d1b6 Backport commit a15cd5504 from Emacs
; Don't quote nil in comments
a15cd55044c6bb4d4e9f9aec23b8b5b9cbcb38ac
Stefan Kangas
Thu Dec 15 02:35:00 2022 +0100
2022-12-17 17:01:59 -05:00
Ihor Radchenko 2944a2152d
org-persist: Use temporary index for emacs -Q
* lisp/org-persist.el (org-persist--disable-when-emacs-Q): Rename
`org-persist-disable-when-emacs-Q' to internal variable.  Update the
docstring.
(org-persist-read):
(org-persist-write):
(org-persist-gc): Do not disable persistence.  Persistence is
necessary for remote file caching to work within a single Emacs
session.  Instead, use temporary directory as index for emacs -Q.
2022-12-17 12:39:35 +03:00
Ihor Radchenko aa86ed534f
org-persist-write-all: Do not create index with no containers
* lisp/org-persist.el (org-persist-write-all): Do not create
`org-persist-directory' when index does not contain any data except
index version.

Link: https://orgmode.org/list/875yedw0ib.fsf@localhost
2022-12-17 12:36:51 +03:00
Leo Butler 81f2741bca
prevent error in Octave process, add tests, update test docs
* lisp/ob-octave.el (org-babel-execute:octave):

  -Ensure that the special Octave variable `ans' is bound when
  GFX-FILE is non-nil.  The glue code in
  ORG-BABEL-OCTAVE-WRAPPER-METHOD causes Octave to exit with a
  non-zero exit code when `ans' is not bound.

  -Change format control string to %S from %s.  Ensure the graphics
  filename is quoted.  If it is not, Octave may create a mis-named
  file or fail entirely.

* testing/examples/ob-octave-test.org:

  Update the Graphical tests section:
  -put in the correct headers;
  -add a remark about where to find each test.

* testing/lisp/test-ob-octave.el:

  Add the three tests ob-octave/graphics-file,
  ob-octave/graphics-file-session and ob-octave/graphics-file-space.

  -ob-octave/graphics-file: The first test verifies that the first bug
  identified above is fixed; it also verifies that graphics file
  creation works correctly for scripting.

  -ob-octave/graphics-file-session: The second test verifies graphics
  file creation works correctly for sessions.  The Octave command
  `crash_dumps_octave_core(0)' is included to prevent the creation of
  a core file (`octave-workspace').

  -ob-octave/graphics-file-space: The third test verifies that a
  graphics filename with a space in it is created correctly.

Thanks to Ihor Radchenko for helpful feedback.
Ref: https://list.orgmode.org/8735asbtfe.fsf@localhost/T/#u
2022-12-17 11:20:43 +03:00
Jeremie Juste 662e814bc0
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-14 12:36:38 +03:00
Jeremie Juste fec15dedb9
test-ob-R.el: New function to test for :result output
* test-ob-R.el (ob-session-R-result-output): This test will check if
output is printed to buffer in a session with :results output. This
test is to prevent the bug mentioned in https://list.orgmode.org/877czca7oj.fsf@u-bordeaux.fr/
does not happen again.
2022-12-14 12:36:31 +03:00