* 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.
* 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.
* lisp/oc-csl.el (org-cite-csl--output-format): Use the dedicated
'org-latex' citeproc formatter to export references in LaTeX.
(org-cite-csl-latex-preamble, org-cite-csl--generate-latex-preamble,
org-cite-csl-finalizer): Insert a preamble fragment compatible with
the 'org-latex' citeproc formatter.
(org-cite-csl-latex-label-separator,
org-cite-csl-latex-label-width-per-char): Introduce additional
variables to control bibliography formatting.
* etc/ORG-NEWS: Describe the introduced new options.
* lisp/org-keys.el (or): Add alternative terminal binding for
`org-insert-structure-template'. The default binding may not be
available in some terminals.
* doc/org-manual.org (Using Org on a TTY): List the new binding in the
manual.
Reported-by: Anthony Carrico <acarrico@memebeam.org>
Link: https://orgmode.org/list/d9222967-5747-bf54-8041-4a8453fe81fc@memebeam.org
* lisp/oc-basic.el (org-cite-basic--format-author-year):
(org-cite-basic-export-citation): Display "????" for missing year and
"??" for missing other fields.
Reported-by: Ihor Radchenko <yantar92@posteo.net>
Link: https://orgmode.org/list/871qr6kiuv.fsf@localhost
* lisp/org-persist.el (org-persist--normalize-container): Recognize
new `elisp-data' container. Treat raw strings, keywords, and quoted
expressions as `elisp-data' container options.
(org-persist-read:elisp-data):
(org-persist-load:elisp-data):
(org-persist-write:elisp-data):
(org-persist-gc:elisp-data):
(org-persist-associated-files:elisp-data): New functions.
(org-persist-read): Simplify docstring example using `elisp-data'
container.
Also, update examples in top comment.
* lisp/org-persist.el (org-persist-version): Bump version.
(org-persist-index-file): Use .eld extension by default.
(org-persist--index): Set mode in buffer-local variable line.
* lisp/org-persist.el (org-persist-read): Only return the requested
containers. Add new optional keyword argument :read-related to read
the containers stored together with requested. Update the docstring
accordingly.
(org-persist-load): Update definition according to `org-persist-read'.
* lisp/org.el (org-mode): Explicitly load all the associated
cache variables.
* lisp/org-persist.el (org-persist-read:index): Allow setting where
the elisp container value is taken from: locally, from buffer, or from
a global variable.
* 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
* 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
* 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
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
* 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.
* 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.
* 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.
* 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
* 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
* 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
* 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.
* 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
* 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
* 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
* 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.
* 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.
* 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.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.
* 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
* 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.
* 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.
* lisp/org-persist.el (org-persist-write): Do not write data
associated with gpg-encrypted files. This will avoid data leakage.
(org-persist--storage-version): Bump storage version to invalidate
previously stored, potentially leaked, data.
Reported-by: Clément Pit-Claudel <clement.pitclaudel@live.com>
* lisp/org.el (org-make-tags-matcher): Match
<now>/<today>/<tomorrow>/<+3d>/etc time queries. They are allowed by
"11.3.3 Matching tags and properties" section of the manual.
Fixes regression from e022a0cea.
Reported-by: Carlo Tambuatco <oraclmaster@gmail.com>
Link: https://orgmode.org/list/87bkokgtd7.fsf@kyleam.com
* lisp/ob-core.el (org-babel-result-to-file): When file path in the
result contains attachment dir, reduce the path to relative file name
when generating attachment: link.
* testing/lisp/test-ob.el (test-ob-core/dir-attach): Add test.
Reported-by: Johan Tolö <johan@toloe.se>
Link: https://orgmode.org/list/875yesnia6.fsf@toloe.se
* lisp/ob-core.el (org-babel-execute-src-block): Do not say "result
silenced" after executing the source blocks with `:results none' to
avoid confusion with `:results silent'.
lisp/org.el: (org-narrow-to-subtree, org-toggle-narrow-to-subtree,
org-narrow-to-block, org-narrow-to-element): Mention how to widen in
docstrings of commands that do narrowing.
TINYCHANGE
* lisp/org-element.el (org-element--cache-active-p): Consider cache
disabled when any of the indirect buffers do not have modification
detection. This can be important when one uses
`combine-after-change-calls' inside an indirect buffers disabling
`after-change-functions' temporarily in the indirect buffer.
Reported-by: Feng Shu <tumashu@163.com>
Link: https://orgmode.org/list/87359z8ssb.fsf@163.com
* lisp/org-fold-core.el (org-fold-core-cycle-over-indirect-buffers):
Fix logic detecting foreign `org-fold-core--indirect-buffers'.
`current-buffer' is not always at `car'. Before this change, capture
buffers could be missed when cycling over indirect buffers causing
subtle bugs.
Reported-by: Alexandros Prekates <aprekates@posteo.net>
Link: https://orgmode.org/list/20221128122841.2246aa08@enous
* lisp/org-clock.el (org-clock-clocktable-language-setup): Use Rubriek
for "heading". It is more accurate as "Hoofding" refers to newspaper
headline. Add the missing translation for "Clock summary at".
TINYCHANGE
Link: https://orgmode.org/list/4057b0bb88604e0f1ac4d18e11bf60f5@posteo.net
* lisp/ob-comint.el (org-babel-comint-with-output): Do not rely on
output filter when detecting prompt lines. Search for
`comint-prompt-regexp' in the full output after applying the filter.
This is needed when the filter is supplied with partial prompts.
Reported-by: Frédéric Santos <frederic.santos@u-bordeaux.fr>
Link: https://orgmode.org/list/877czca7oj.fsf@u-bordeaux.fr
* lisp/org-element.el (org-element--cache-verify-element):
(org-element-at-point-no-context): Use
`org-element-with-disabled-cache' instead of let-binding
`org-element-use-cache' variable. The former is more reliable.
* lisp/ox-md.el (org-md-toplevel-hlevel): Change the type from natnum
to integer, which is less accurate but compatible with all Emacs
versions that Org supports.
This is a follow-up to the recent port of 4b2f5425d.
* lisp/org-clock.el (org-x11idle-exists-p): Don't try to
invoke "command x11idle" on MS-Windows and MS-DOS. This fixes a
hang during byte-compilation of Org.
Fix compilation of Org 9.6 on MS-Windows
8b3baadf671b7b3d5058808c4655eca8bd46015e
Eli Zaretskii
Thu Dec 1 14:40:47 2022 +0200
* lisp/ob-clojure.el
(ob-clojure-babashka-command, ob-clojure-nbb-command):
Account for the possibility of nil (commands absent).
* lisp/org.el (org-safe-remote-resources):
* lisp/ox-md.el (org-md-toplevel-hlevel):
Fix incorrect or invalid types.
Fix types in various defcustom declarations
4b2f5425d7af1a6f992ad8ce0a4452a2e778815a
Mattias Engdegård
Thu Dec 1 13:03:19 2022 +0100
[km] The natnum change will be adjusted in an upcoming commit because
natnum not available until Emacs 28.