Commit graph

26189 commits

Author SHA1 Message Date
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 a58ab90395
lisp/ox-latex.el: Add export option for `org-latex-listings-src-omit-language'
* lisp/ox-latex.el (latex):
(org-latex-src-block--listings): Use a proper export option, not just
a `defcustom'.
2022-12-18 16:14:14 +03:00
Pedro A. Aranda Gutierrez 322b2fd226
lisp/ox-latex.el: Add `org-latex-listings-src-omit-language'
* lisp/ox-latex.el (org-latex-listings-src-omit-language): New
customization that controls whether language= should be included in
the parameters of the lstlisting environmet generated by a src block.

(org-latex-src-block--listings): Do not add language parameter when
`org-latex-listings-src-omit-language' is non-nil.

* etc/ORG-NEWS (New =org-latex-listings-src-omit-language= variable
for LaTeX export): Document the new defcustom.
2022-12-18 16:10:40 +03:00
Pedro A. Aranda Gutierrez 0c467b6b89
lisp/ox-latex.el: Don't emit empty label=, caption=
* lisp/ox-latex.el (org-latex-src-block--listings): Don't emit label=
when label is empty.  Don't emit caption= and captionpos= when caption
is empty.

This is safe to do as long as we do not set "lstlisting" parameters
globally.  See the discussion in
https://orgmode.org/list/87h6xyqqod.fsf@localhost.
2022-12-18 16:10:39 +03:00
Ihor Radchenko dd4e06ddc3
org-manual: Document third-party package compatibility
* doc/org-manual.org (Installation): Document that we only guarantee
compatibility with the latest stable versions of third-party packages.

Link: https://orgmode.org/list/86iljd3x90.fsf@gmail.com
2022-12-18 15:43:40 +03:00
Ihor Radchenko 18fec7623c
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:32:50 +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 d93df21835 Merge branch 'bugfix' 2022-12-17 17:05:23 -05: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 751de02127
org-agenda-dim-blocked-tasks: Prioritize face over other overlays
* lisp/org-agenda.el (org-agenda-dim-blocked-tasks): Use high overlays
priority when adding dimmed face.  Otherwise, contained overlays, like
created by `org-agenda-fontify-priorities', will take
priority (default Emacs behavior).

Reported-by: Mark Kerr <mkerr23@gmail.com>
Link: https://orgmode.org/list/CAM9qJ5+C3nvbNaJyq6ofRgPsuAMcaBD=2UN-n96Kb68NBbX3Dg@mail.gmail.com
2022-12-17 12:53:12 +03:00
Ihor Radchenko afe5f3f692
org-persist-gc: Fix edge case
* lisp/org-persist.el (org-persist-gc): Do not err when
`org-persist-directory' is absent.
2022-12-17 12:45:46 +03:00
Ihor Radchenko d52a775369
Merge branch 'bugfix'
Note the resolved conflict.
2022-12-17 12:45:14 +03: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 01c0ebee2f
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:22:55 +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
Timothy 555dacfa8b
org-persist: Merge index with index file content
* lisp/org-persist.el (org-persist-write, org-persist-load,
org-persist-write:index, org-persist-load:index): Check if the index
file has been externally updated since loading, and if so try to perform
basic merging of the current index file contents and the loaded index
before performing GC or overwriting the index file.
(org-persist--index-age, org-persist--merge-index-with-disk,
org-persist--merge-index): New variable and functions to keep track of
index age and perform merging.
2022-12-14 23:03:04 +08:00
Ihor Radchenko cea5af5cce
Merge branch 'bugfix'
Merge back cherry-picked important bugfix commits from main.
2022-12-14 12:43:26 +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
Timothy 402d2421d9
org-persist: Do not re-download url files on write
* lisp/org-persist.el (org-persist-write:url): Since the url write
function is called as part of `org-persist-write-all', it is worth
adding a check to avoid re-downloading the file if a file already exists
in the expected location.
2022-12-14 12:35:12 +03:00
Timothy 6a126e40a7
org-persist: Ensure index instantiated before read
* lisp/org-persist.el (org-persist-read): If the index is empty at the
start of `org-persist-read', load it before continuing.
2022-12-14 12:33:39 +03:00
Timothy 88329143c8
org: Use buffer-base-buffer in safe resource fns
* lisp/org.el (org--confirm-resource-safe, org--safe-remote-resource-p):
Replace instances of buffer-file-name
with (buffer-file-name (buffer-base-buffer)) so these functions work in
indirect buffers.
2022-12-14 12:33:15 +03:00
Timothy 0db972ad63
ox: Handle failure to localize link
* lisp/ox.el (org-export-link-localise): When no local copy of the link
resource could be fetched, produce a warning message and do nothing
instead of setting the link :path to nil.
2022-12-14 12:31:56 +03:00
Ihor Radchenko 794d502da0
org-time-stamp-custom-formats: Document that variable affects export
* lisp/org.el (org-time-stamp-custom-formats): Mention that the value
affect export; not only the display.
2022-12-14 11:35:10 +03:00
Ihor Radchenko edd000f3b6
org-open-at-point: Link to `org-file-apps' in the docstring
* lisp/org.el: Mention how file links are opened.

Reported-by: David Masterson <dsmasterson@gmail.com>
Link: https://orgmode.org/list/SJ0PR03MB54555477E276E6A3CADBA4B8A2E39@SJ0PR03MB5455.namprd03.prod.outlook.com
2022-12-14 11:08:43 +03:00
Ihor Radchenko f49ee9200c
Merge branch 'bugfix' 2022-12-13 14:14:57 +03:00
Ihor Radchenko 47bcdce19b
doc/org-manual.org: Document `org-hide-drawer-startup'
* doc/org-manual.org (Summary of In-Buffer Settings): Document the new
setting.
2022-12-13 14:13:01 +03:00
Ihor Radchenko 4323a19b15
org-hide-drawer-startup: Add missing variable alias
* lisp/org.el (org-hide-drawer-startup): Make alias to
`org-cycle-hide-drawer-startup'.

Reported-by: Kévin Le Gouguec <kevin.legouguec@gmail.com>
Link: https://orgmode.org/list/877cyvzrcu.fsf@gmail.com
2022-12-13 14:12:18 +03:00
Ihor Radchenko 71a5f75bbb
Merge branch 'bugfix' 2022-12-13 11:50:50 +03:00
Ihor Radchenko 02909fe371
lisp/test-ox.el: Add tests for `org-export-get-ordinal'
* testing/lisp/test-ox.el (test-org-export/get-ordinal): New test.
2022-12-13 11:49:42 +03:00
Ihor Radchenko 7048876f6f
org-export-get-ordinal: Do not ignore ELEMENT type when TYPES is given
* lisp/ox.el (org-export-get-ordinal): Append ELEMENT type to TYPES,
when TYPES is non-nil.
2022-12-13 11:49:42 +03:00
Ihor Radchenko bdb4c4c66e
org-export-get-ordinal: Fix breakage in 0551eba40
* lisp/ox.el (org-export-get-ordinal): Do not return first cached
number.  Search the actual requested element.  Do not disregard TYPES
argument in the cache.

Reported-by: Kaushal Modi <kaushal.modi@gmail.com>
Link: https://orgmode.org/list/CAFyQvY342ee8OgWVQdv=z3V1_3rgLttb2S0v27JLjF0KiMH0qA@mail.gmail.com
2022-12-13 11:49:41 +03:00
Ihor Radchenko 45dc19516a
org-inlinetask-min-level: Fix confusing sentence in the docstring
* lisp/org-inlinetask.el (org-inlinetask-min-level): Update
confusingly written sentence.

Reported-by: Alain.Cochard@unistra.fr
Link: https://orgmode.org/list/25495.8102.609172.522785@gargle.gargle.HOWL
2022-12-13 10:31:58 +03:00
Ihor Radchenko 7f7fb256c6
org-latex-listings-options: Update docstring
* lisp/ox-latex.el (org-latex-listings-options): \lstset is no longer
used.  Clarify that options are now supplied directly to the
environment.
2022-12-12 15:33:52 +03:00
Rudolf Adamkovič d440b242b3
org-clock-clocktable-language-setup: Add Slovak translation
* lisp/org-clock.el (org-clock-clocktable-language-setup): Add
translation.
2022-12-12 15:33:51 +03:00
Kyle Meyer 2a529ee57b org-element: Autoload org-element-use-cache
* lisp/org-element.el (org-element-use-cache): Autoload to silence
byte compiler warning in Emacs repo.

On Emacs's emacs-29 branch, compiling lisp/org/org-loaddefs.el gives
the following warning that stems from an autoloaded defsubst,
org-element-at-point-no-context (new to Org 9.6):

  In org-element-at-point-no-context:
  org/org-loaddefs.el:846:61: Warning: Unused lexical variable
  `org-element-use-cache'

That doesn't show up in the Org repo because mk/org-fixup.el generates
org-loaddefs.el via autoload.el's generate-file-autoloads, which adds
"no-byte-compile: t" to its output file.  However, in Emacs 29,
autoload.el is now deprecated, and the Emacs build uses
loaddefs-gen.el's loaddefs-generate--emacs-batch, which does include
no-byte-compile.
2022-12-11 15:13:31 -05:00
Kyle Meyer e42beabb48 Merge branch 'bugfix' 2022-12-11 13:58:06 -05:00
Timothy 92ac00051a
org-persist: Fix omitted argument
* lisp/org-persist.el (org-persist-associated-files:file): Add the
"container" argument used but omitted from the function declaration of
`org-persist-associated-files:file' in 534633d508.
2022-12-12 01:13:23 +08:00
Ihor Radchenko a12d15df98
org-display-inline-remove-overlay: Do better job clearing images from cache
* lisp/org.el (org-display-inline-remove-overlay): Force remove
overlay images from Emacs image cache when un-displaying inline image
overlays.  This change should: (1) slightly improve Emacs memory usage
when the number of inline images is large; (2) Clear images from cache
every time Emacs removes the overlay for any
reason.  (`org-display-inline-remove-overlay' is used in
overlay 'modification-hooks.)
2022-12-11 12:18:22 +03:00
Kyle Meyer 8880cca3d6
ob-core: Revert space misalignment from recent commit
cc5427b7e (org-babel-result-to-file: Fix results file inside
attachment dir, 2022-12-07) carried along an unrelated white space
change upstream of the main change.
2022-12-11 12:18:21 +03:00
Kyle Meyer 4c90e0b613
org-table: Require org-fold-core
* lisp/org-table.el: Explicitly load org-fold-core.

'make single' warns that org-fold-core-ignore-modifications in
org-table.el (introduced a few commits back) is not known to be
defined, and the Emacs repo would show the same warning.
2022-12-11 12:18:21 +03:00
Ihor Radchenko 41a8666c09
org-display-inline-remove-overlay: Do better job clearing images from cache
* lisp/org.el (org-display-inline-remove-overlay): Force remove
overlay images from Emacs image cache when un-displaying inline image
overlays.  This change should: (1) slightly improve Emacs memory usage
when the number of inline images is large; (2) Clear images from cache
every time Emacs removes the overlay for any
reason.  (`org-display-inline-remove-overlay' is used in
overlay 'modification-hooks.)
2022-12-11 12:16:26 +03:00
Timothy 1a9d0850b6
org-persist: Do not re-download url files on write
* lisp/org-persist.el (org-persist-write:url): Since the url write
function is called as part of `org-persist-write-all', it is worth
adding a check to avoid re-downloading the file if a file already exists
in the expected location.
2022-12-11 15:47:33 +08:00
Timothy 534633d508
org-persist: Use associated file functions for GC
* lisp/org-persist.el (org-persist-gc, org-persist--remove-from-index,
org-persist-gc:file, org-persist-gc:url, org-persist-gc:version,
org-persist-gc:url, org-persist-associated-files:generic,
org-persist-associated-files:url, org-persist-associated-files:elisp,
org-persist-associated-files:index,
org-persist-associated-files:version,
org-persist-associated-files:file): Use associated files for GC, and
move the associated files functions into the public
namespace (i.e. remove the double dash).
2022-12-11 15:47:33 +08:00
Timothy 8b8a65ed02
org-persist: Introduce "associated files" for GC
* lisp/org-persist.el (org-persist-gc, org-persist--associated-files,
org-persist--associated-files:url): The url container stores downloaded
files separately within `org-persist-directory', which means that
`org-persist-gc' picks them up as "orphan files" and deletes them every
time it is called.  To avoid this collateral damage, a new family of
collection-specific functions is introduced,
"org-persist--associated-files:COLLECTION".  This allows collections to
tell GC about associated files that should be left alone, and is used
for url collections to preserve downloaded files.
2022-12-11 15:47:33 +08:00
Timothy c91226354a
org-persist: Fix attempted mapc-ing of macro
* lisp/org-persist.el (org-persist--gc-persist-file): Redefine
`org-persist--gc-persist-file' as a function so it can be mapc'd in
`org-persist-gc'.
2022-12-11 15:47:33 +08:00
Timothy 47654f844d
org-persist: Fix number of remote files kept
* lisp/org-persist.el (org-persist-gc): The `org-persist-remote-files'
documentation states that when set to a number (n) it will keep that
many files.  However, since a <= comparison is used with setting the
expired status of the files every remote file from n-th file onwards
/inclusive/ is marked as expired, and so only n-1 files were actually
kept.  With a less-than operator, the behaviour will actually match the
docstring.
2022-12-11 15:47:33 +08:00
Timothy e663b90fe5
org-persist: Fix unconditional gc of urls
* lisp/org-persist.el (org-persist-gc): The :file association of URL
containers lead to `file-exists-p' being called on them, which always
returns nil, causing URL containers to always be garbage collected.
Since the :file entry doesn't really represent a filesystem object, we
now check if the container is url and if so prevent the :file
association from being used in gc checks.
2022-12-11 15:47:33 +08:00