* 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.
* 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.
* 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.)
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.
* 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.
* 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.)
* 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.
* 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).
* 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.
* 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.
* 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.
* 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.
* 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.
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.
* 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.
* doc/org-manual.org (Re-aligning and field motion): Update the
command description according to up-to-date docstring.
Reported-by: André A. Gomes <andremegafone@gmail.com>
Link: https://orgmode.org/list/87zgfrvzz1.fsf@localhost
* lisp/org.el (org-display-inline-images): Always refresh cached
images when displaying image overlays. See Emacs bug#59902. This
fixes images not updating when image file is changed on disk.
Reported-by: William Denton <wtd@pobox.com>
Link: https://orgmode.org/list/87wn7287n2.fsf@localhost
* lisp/ox.el (org-export-as): Make sure that narrowing includes top
heading in a subtree when subtree export is requested. This is needed
after 927621910 changed `org-export--get-subtree-options' behavior.
Reported-by: Alejandro Pérez Carballo <apc@umass.edu>
Link: https://orgmode.org/list/m2sfhpffui.fsf@umass.edu
* lisp/org.el (org-inside-LaTeX-fragment-p): Use `org-element-context'
to analyze context at point instead of ad-hoc regexp matching. Do not
return undocumented cons cell. Update docstring dropping all the
previously listed caveats. Add new optional argument ELEMENT to
provide element at point.
(org--math-always-on): Follow new `org-inside-LaTeX-fragment-p' return
value spec. Do no rely on previous undocumented convention.
Reported-by: Justin Silverman <jsilve24@gmail.com>
Link: https://orgmode.org/list/87v8mktt38.fsf@gmail.com
* lisp/org-fold-core.el (org-fold-core-save-visibility): Calculate
folds on runtime, not during macro expansion.
* testing/lisp/test-org.el (test-org/org-ctrl-c-ctrl-c): Add test
ensuring that outline visibility is preserved upon refreshing Org
setup.
Reported-by: Matt Lundin <mdl@imapmail.org>
Link: https://orgmode.org/list/87wn70tlcn.fsf@fastmail.fm
* lisp/org-table.el (orgtbl-to-generic): Disable org-fold checks in
temporary buffer. Folding state is irrelevant there.
Reported-by: Majzoub, Eric <eric.majzoub@umsl.edu>
Link: https://orgmode.org/list/tn0s4e$84u$1@ciao.gmane.io
* 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.
* 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.