Commit Graph

19964 Commits

Author SHA1 Message Date
Nathan Dwarshuis 1b4fb607bd org-element.el: Make affiliated keyword interpreter faster
* lisp/org-element.el (org-element--interpret-affiliated-keywords):
Optimize performance by bypassing unnecessary types and reducing
loop complexity. Added new constant
`org-element-elements-no-affiliated` which stores the types to
be bypassed.

This function was doing redundant work on several levels which
dramatically reduced performance of interpreting element nodes
relative to object nodes.

First, all types were interpreted regardless of if they could
possibly contain affiliated keywords. Skipping these types
dramatically speeds up typical use cases since many of these
skipped types are common (headline, item, etc).

Second, the loop was much more complex than needed. The loop included
:standard-properties which should not be necessary here. It also
duplicated some work between calls to `org-element--properties-mapc`
and `mapconcat` (the code was moved entirely under the former). The
result should be faster and more readable.

TINYCHANGE
2024-11-29 17:05:54 -05:00
Karthik Chikmagalur 9cce40c94f
org-link: Customizable preview API for arbitrary link types
Add a customizable preview API for arbitrary link types.  Make
inline image previews a part of the more universal org-link
preview feature.  Each link type can now be previewed differently
based on a new link parameter.

* lisp/ol.el (org-link-parameters, org-link-preview-batch-size,
org-link-preview-delay, org-link-preview--timer,
org-link-preview--queue, org-link-preview-overlays,
org-link-preview--get-overlays, org-link-preview--remove-overlay,
org-link-preview, org-link-preview-region,
org-link-preview--process-queue, org-link-preview-clear,
org-link-preview-file, org-display-remote-inline-images,
org-image-align, org--create-inline-image,
org-display-inline-image--width, org-image--align): Add new
commands `org-link-preview', `org-link-preview-region' and
`org-link-preview-clear' for creating link previews for any kind
of link.  Add new org-link parameter `:preview' for specifying how
a link type should be previewed.  This link parameter is a
function called asynchronously to place previes.  File links and
attachments are previewed using inline image previews as before.
Move image handling utilities from lisp/org.el to lisp/ol.el.

* testing/lisp/test-org-fold.el: Use `org-link-preview'.

* lisp/org.el (org-toggle-inline-images,
org-toggle-inline-images-command, org-display-inline-images,
org--inline-image-overlays, org-inline-image-overlays,
org-redisplay-inline-images, org-image-align,
org-display-inline-remove-overlay, org-remove-inline-images,
org-startup-with-inline-images, org-startup-with-link-previews,
org-startup-options): Obsolete and move
`org-toggle-inline-images', `org-display-inline-images' and
`org-redisplay-inline-images' to org-compat.  These are obsoleted
by `org-link-preview' and `org-link-preview-region'.  Remove
`org-toggle-inline-images-command'.  Move the other internal
functions to org-link.  Rename `org-startup-with-inline-images' to
`org-startup-with-link-previews'.  Add new STARTUP options for
link previews to `org-startup-options': "linkpreviews" and
"nolinkpreviews".

* lisp/org-plot.el (org-plot/redisplay-img-in-buffer): Modify to
use `org-link-preview'.

* lisp/org-keys.el: Bind `C-c C-x C-v' to new command
`org-link-preview', which has the same prefix arg behaviors as
`org-latex-preview'.  In addition to these, it supports numeric
prefix args 1 and 11 to preview links with descriptions at
point/region (with 1) and across the buffer (with 11).

* lisp/org-cycle.el (org-cycle-display-inline-images,
org-cycle-display-link-previews, org-cycle-inline-images-display,
org-cycle-inline-link-previews): Use `org-link-preview' and
`org-link-preview-region'.  Rename inline-images functions and user
options to their link-previews equivalents:

- `org-cycle-display-inline-images' to `org-cycle-display-link-previews'
- `org-cycle-inline-images-display' to `org-cycle-inline-link-previews'

* lisp/org-compat.el (org-display-inline-remove-overlay,
org--inline-image-overlays, org-remove-inline-images,
org-inline-image-overlays, org-display-inline-images,
org-toggle-inline-images):

* lisp/org-attach.el (org-attach-preview-file): Add new `:preview'
link parameter for links of type "attachment", set to the new
function `org-attach-preview-file'.
2024-11-27 19:34:26 +01:00
Ihor Radchenko 4ff4828944
org-footnote--collect-references: Fix infinite recursion
* lisp/org-footnote.el (org-footnote--collect-references): Fix
infinite recursion when nested references form a closed loop.
* testing/lisp/test-org-footnote.el (test-org-footnote/sort): New
test.

Reported-by: Avraham Pinkas <ampinkas@gmail.com>
Link: https://orgmode.org/list/CAHEwkt8vnYGr1ZN-De9ec4bqBk_7yHARFAsZmY81u1GimSritA@mail.gmail.com
2024-11-23 20:44:07 +01:00
Ihor Radchenko 34a354f0fd
ox-odt: Fix exporting from buffers with non-standard encoding
* lisp/ox-odt.el (org-odt--export-wrap): Enforce 'utf-8 coding system
when writing to odt file, as declared in the template.

Reported-by: Amy Grinn <grinn.amy@gmail.com>
Link: https://orgmode.org/list/87ed3fvu7p.fsf@pop-os.mail-host-address-is-not-set
2024-11-23 20:09:00 +01:00
Stefan Monnier 984c0c58bb
org-src-get-lang-mode: Honor `major-mode-remap-alist'
* lisp/org-src.el (org-src-get-lang-mode): When `major-mode-remap' is
available, use it to honor `major-mode-remap-alist'.
* lisp/ox-html.el (org-html-fontify-code):
* lisp/ox-odt.el (org-odt-do-format-code): Use `org-src-get-lang-mode'.
2024-11-23 18:05:45 +01:00
Ihor Radchenko 4381f52463
Merge branch 'bugfix' 2024-11-22 17:46:34 +01:00
Ihor Radchenko b004e99613
org-table: Fix text input becoming invisible in some cases
* lisp/org-table.el (org-table--separator-space-pre): Make the
separator space non-sticky.  Otherwise, typing text into shrunk table
made the text invisible.
2024-11-22 17:40:39 +01:00
Ihor Radchenko 87863b9ec4
org-fold-core: Fix bad interaction between fold overlays and isearch
* lisp/org-fold-core.el (org-fold-core-region):
(org-fold-core--isearch-show-temporary): Clear/restore folding
property in addition to 'invisible property when revealing folds
temporarily for the purposes of isearch.  This is needed because fold
status is determined from that property, not just from 'invisible.
The old code sometimes treated temporarily displayed overlays as
folded, breaking `org-cycle'.
2024-11-22 17:37:49 +01:00
Jack Kamm 3ff21c7138 Add options to skip extra processing in org-babel-comint-with-output
This patch adds options to org-babel-comint-with-output to skip prompt
removal.  Allowing individual languages to handle this cleanup can be
more robust than relying on the generic ob-comint implementation.
This allows ob-python to switch back to using
`org-babel-comint-with-output' rather than its own bespoke
reimplementation, reducing code duplication.  Furthermore, this adds a
new implementation of ob-R non-async session output evaluation, that
is similar to the ob-python approach in that it avoids leaking
prompts, rather than relying on the cleanup from
`org-babel-comint-with-output'.  A test is added to test-ob-R.el to
demonstrate the improved robustness of the new approach; previously,
this test would fail due to a false positive prompt, but now passes.

* lisp/ob-comint.el (org-babel-comint--remove-prompts-p): New helper
function to parse the prompt-handling argument in
`org-babel-comint-with-output' and `org-babel-comint-async-register'.
(org-babel-comint-with-output): Add a new argument
to prevent extra processing for prompt cleanup.  Also, search for the
end-of-execution sentinel within the collected output rather than the
comint buffer, which doesn't depend on the position of point during
evaluation.
(org-babel-comint-async-register): Move parsing of prompt-handling
argument to `org-babel-comint--remove-prompts-p'.
* lisp/ob-python.el: Require subr-x for Emacs 27 compatibility.
(org-babel-python-send-string): Switch to using
`org-babel-comint-with-output', rather than bespoke reimplementation.
* lisp/ob-R.el: Require subr-x for Emacs 27 compatibility.
(ess-send-string): Declare external function.
(org-babel-R-evaluate-session): New implementation of output
evaluation that avoids leaking prompts, by writing the code block to a
tmp file and then sourcing it.
* testing/lisp/test-ob-R.el (test-ob-r/session-output-with->-bol): New
test for robustness against false positive prompts at the beginning of
a line.
2024-11-12 19:54:28 -08:00
Xi Lu 0624f57df3
org-mouse-context-menu: Fix `grep' command to handle filenames starting with '-'
* lisp/org-mouse.el (org-mouse-context-menu): Fix `grep' command to
handle filenames starting with '-' by adjusting wildcard usage to
prevent misinterpretation as options.
2024-11-09 15:33:38 +01:00
Ihor Radchenko ba9734aedc
Update version number for the 9.7.16 release 2024-11-09 15:02:38 +01:00
Ihor Radchenko 7c2d960e2b
Merge branch 'bugfix' 2024-11-09 15:01:40 +01:00
Ihor Radchenko b34f8bc1f4
org-open-at-mouse: Fix Emacs<30
* lisp/org.el (org-open-at-mouse): Load warnings.el - it is not
autoloaded in older Emacs.
2024-11-09 14:49:33 +01:00
Jack Kamm 09e7bb0604 Merge branch 'bugfix' 2024-11-01 17:14:48 -07:00
Jack Kamm 23a3c82532 Disable async prompt removal in ob-R,python
* lisp/ob-comint.el (org-babel-comint-async-remove-prompts-p): New
variable to disable prompt removal in async output.
(org-babel-comint-async-filter): Check
`org-babel-comint-async-remove-prompts-p' before calling
`org-babel-comint--prompt-filter'.
(org-babel-comint-async-register): Added argument for whether prompts
should be removed from async output.
* lisp/ob-python.el (org-babel-python-async-evaluate-session): Set
option to inhibit prompt removal when registering async evaluators.
* lisp/ob-R.el (ob-session-async-org-babel-R-evaluate-session): Set
option to inhibit prompt removal when registering async evaluators.
* testing/lisp/test-ob-R.el (test-ob-R/async-prompt-filter): Test for
over-aggressive prompt removal.
2024-11-01 17:05:45 -07:00
Ihor Radchenko a1df10f679
Update version number for the 9.7.15 release 2024-11-01 08:25:56 +01:00
Ihor Radchenko 8895be91ea
lisp/org-macs.el (require): Load subr-x for `when-let*' 2024-11-01 08:25:55 +01:00
Ihor Radchenko 246c7d5882
org-open-at-mouse: Suppress warning in Emacs <30
* lisp/org.el (org-open-at-mouse): Add variable declaration to silence
warnings in older Emacs.
2024-11-01 08:25:54 +01:00
Sean Whitton ac73e594c9 Replace use of if-let and when-let, obsolete in Emacs 31.0.50
* lisp/ob-R.el (org-babel-R-associate-session):
* lisp/ob-clojure.el (ob-clojure-nbb-command, ob-clojure-cli-command):
* lisp/ob-core.el (org-babel-execute-src-block):
* lisp/ob-exp.el (org-babel-exp-code):
* lisp/ob-julia.el (org-babel-julia-associate-session):
* lisp/ob-python.el
(org-babel-python--python-util-comint-end-of-output-p):
* lisp/ol.el (org-insert-link):
* lisp/org-attach.el (org-attach):
* lisp/org-clock.el (org-clock-select-task):
* lisp/org-compat.el (fboundp):
* lisp/org-element-ast.el (org-element-property-raw)
(org-element-put-property, org-element-copy):
* lisp/org-element.el (org-element-timestamp-interpreter)
(org-element--cache-key):
* lisp/org-goto.el (org-goto-location):
* lisp/org-lint.el (org-lint-suspicious-language-in-src-block)
(org-lint-export-option-keywords):
* lisp/org-macs.el (org-mks):
* lisp/org-persist.el: (org-persist-write:elisp):
* lisp/org-table.el (org-table-fedit-finish):
* lisp/org.el (org-entry-get-with-inheritance):
* lisp/ox-html.el (org-html--reference, org-html--build-mathjax-config)
(org-html-example-block):
* lisp/ox-latex.el (org-latex-table-row):
* lisp/ox.el (org-export--prune-tree)
(org-export--blindly-expand-include):
* testing/lisp/test-duplicates-detector.el
(test-duplicates-detector--find-duplicates):
* testing/lisp/test-ob-haskell-ghci.el
(test-ob-haskell-ghci-checking-buffers):
* testing/lisp/test-ob-python.el
(test-ob-python/async-local-python-shell):
* testing/lisp/test-ob-shell.el (test-ob-shell/bash-uses-assoc-arrays)
(test-ob-shell/bash-uses-assoc-arrays-with-lists)
(test-ob-shell/remote-with-stdin-or-cmdline):
Replace use of if-let and when-let, obsolete in Emacs 31.0.50.

(cherry picked from commit bc7033f2d1)
2024-10-27 10:34:05 +08:00
Ihor Radchenko 1c98731d50
Merge branch 'bugfix' 2024-10-26 19:33:19 +02:00
Ihor Radchenko 377741dc5e
org-element-parse-buffer: Emphasize that current major mode should be org-mode
* lisp/org-element.el (org-element-parse-buffer): Update the docstring
making it more explicit that the function assumes buffer being in Org
mode.

Reported-by: Antonio Romano <n58r@pm.me>
Link: https://list.orgmode.org/orgmode/1b2b8c2791e628f6a41ef533e49a5ac9e3dee8a4.camel@pm.me/
2024-10-26 19:32:49 +02:00
Ihor Radchenko cff9c45afb
ox-texinfo: Fix definitions containing Org markup
* lisp/ox-texinfo.el (org-texinfo--match-definition): Consider :tag
being an anonymous node with multiple markup nodes.  Convert it to
plain Texinfo beforehand, so that it is available as a plain text.
Add new optional argument INFO to be able to run Org AST for :tag ->
Texinfo text conversion.
(org-texinfo--separate-definitions): Pass INFO to
`org-texinfo--match-definition'.
* testing/lisp/test-ox-texinfo.el (test-ox-texinfo/definition): New
test case.

Reported-by: 8dcc <8dcc.git@gmail.com>
Link: https://orgmode.org/list/87wmi09tdx.fsf@gmail.com
2024-10-26 10:36:59 +02:00
Ihor Radchenko 49e0c4a74a
Update version number for the 9.7.14 release 2024-10-25 06:57:56 +02:00
Sean Whitton bc7033f2d1 Replace use of if-let and when-let, obsolete in Emacs 31.0.50
* lisp/ob-R.el (org-babel-R-associate-session):
* lisp/ob-clojure.el (ob-clojure-nbb-command, ob-clojure-cli-command):
* lisp/ob-core.el (org-babel-execute-src-block):
* lisp/ob-exp.el (org-babel-exp-code):
* lisp/ob-julia.el (org-babel-julia-associate-session):
* lisp/ob-python.el
(org-babel-python--python-util-comint-end-of-output-p):
* lisp/ol.el (org-insert-link):
* lisp/org-attach.el (org-attach):
* lisp/org-clock.el (org-clock-select-task):
* lisp/org-compat.el (fboundp):
* lisp/org-element-ast.el (org-element-property-raw)
(org-element-put-property, org-element-copy):
* lisp/org-element.el (org-element-timestamp-interpreter)
(org-element--cache-key):
* lisp/org-goto.el (org-goto-location):
* lisp/org-lint.el (org-lint-suspicious-language-in-src-block)
(org-lint-export-option-keywords):
* lisp/org-macs.el (org-mks):
* lisp/org-persist.el: (org-persist-write:elisp):
* lisp/org-table.el (org-table-fedit-finish, orgtbl--skip)
(orgtbl--skipcols):
* lisp/org.el (org-entry-get-with-inheritance):
* lisp/ox-beamer.el (org-beamer--format-frame):
* lisp/ox-html.el (org-html--reference, org-html--build-mathjax-config)
(org-html-example-block):
* lisp/ox-latex.el (org-latex-table-row):
* lisp/ox.el (org-export--prune-tree)
(org-export--blindly-expand-include):
* testing/lisp/test-duplicates-detector.el
(test-duplicates-detector--find-duplicates):
* testing/lisp/test-ob-haskell-ghci.el
(test-ob-haskell-ghci-checking-buffers):
* testing/lisp/test-ob-python.el
(test-ob-python/async-local-python-shell):
* testing/lisp/test-ob-shell.el (test-ob-shell/bash-uses-assoc-arrays)
(test-ob-shell/bash-uses-assoc-arrays-with-lists)
(test-ob-shell/remote-with-stdin-or-cmdline):
Replace use of if-let and when-let, obsolete in Emacs 31.0.50.
2024-10-24 17:04:40 +08:00
Benjamin McMillan 3a6b14806e
lisp/org.el (org-end-of-meta-data): Improve docstring
* lisp/org.el (org-end-of-meta-data): Clarify that a call of
`org-end-of-metadata' with non-nil argument FULL will skip blank lines
in addition to other meta-data.

Link: https://list.orgmode.org/orgmode/CALo8A5VtbtB0P6RkHuShyFV4qBAMTeujVVpjsH_gY1sY4FwNDQ@mail.gmail.com/

TINYCHANGE
2024-10-22 19:23:40 +02:00
Ihor Radchenko 3aba4f191b
Merge branch 'bugfix' 2024-10-20 13:41:04 +02:00
Ihor Radchenko dfd6cc51f5
org-open-at-mouse: Fix regression when opening links outside Org mode
* lisp/org.el (org-open-at-mouse): Suppress parser warning when
attempting to open fontified Org links outside Org mode (for example,
in agenda buffers).  This is not a real fix - parser may still fail in
buffers where the surrounding link contents makes parser use
Org-specific local variables; but we at least recover from
deterioration of the behaviour when opening links worked _most of the
time_ without issues.

Reported-by: Nikolay Kudryavtsev <nikolay.kudryavtsev@gmail.com>
Link: https://orgmode.org/list/a864b26f-433e-49a8-8d58-74c9210e0fbd@gmail.com
2024-10-20 13:36:17 +02:00
Ihor Radchenko 39264d3d41
ox-texinfo: Fix escaping commas inside commands with multiple arguments
* lisp/ox-texinfo.el (org-texinfo--sanitize-content): Sanitize commas
everywhere to make sure that we do not end up with text commas being
interpreted as argument separator in @command{arg1, arg2, ...}.  This
approach will produce @comma{} even when it is not necessary, but it
is the safest approach.
(org-texinfo-plain-text): Update the comment.
* testing/lisp/test-ox-texinfo.el (test-ox-texinfo/escape-special-characters):
New test.

Reported-by: 8dcc <8dcc.git@gmail.com>
Link: https://orgmode.org/list/87set58skp.fsf@gmail.com
2024-10-19 10:29:13 +02:00
Nick Dokos 8b4b89b14b
org-babel-header-arg-expand: more stringent check for appropriate context
The check for appropriate context in `org-babel-header-arg-expand' was
inadequate: a colon was deemed appropriate anywhere in the source
block, not just in the header.

* lisp/ob-core.el (org-babel-header-arg-expand): The function now uses
`org-babel-in-src-block-header-p' to check for appropriate context.
(org-babel-in-src-block-header-p): New function.

Reported-by: use @Addlai on Emacs SE.
Link: https://list.orgmode.org/orgmode/87zfnrb2nu.fsf@pierrot.dokosmarshall.org/
2024-10-18 19:37:31 +02:00
Anoop G R 23eb697df6
ob-clojure.el: Fix comments getting deleted on tangling of clojure source blocks
* lisp/ob-clojure.el (org-babel-expand-body:clojure): Leave the
comments intact if the code block does not have :var.

Reported-by: "Anoop G R" <anoopemacs@gmail.com>
Link: https://list.orgmode.org/874j5azk2p.fsf@localhost/T/#t

TINYCHANGE
2024-10-18 19:18:36 +02:00
Ihor Radchenko 8566bc8b45
Update version number for the 9.7.13 release 2024-10-18 09:17:25 +02:00
Sacha Chua 566c341155
org-refile: calculate file part of the outline path once per file
* lisp/org-refile.el (org-refile-get-targets): Calculate the file part
of the outline path once per file, improving the performance when
org-refile-use-outline-path is set to 'title.
2024-10-15 20:48:10 +02:00
Ihor Radchenko da0f6eff75
ox-texinfo: Fix edge case with - Variable: nil:: definition
* lisp/ox-texinfo.el (org-texinfo--split-definition): Do not store
definition options as :attr_texinfo read by
`org-export-read-attribute'.  `org-export-read-attribute' is incapable
of reading literal nil.  Instead, store the options literally, as is,
in a special non-standard syntax node property.
(org-texinfo-special-block): Make use of syntax node property used by
`org-texinfo--split-definition', when present.
* testing/lisp/test-ox-texinfo.el (test-ox-texinfo/definition): New
test.

Reported-by: 8dcc <8dcc.git@gmail.com>
Link: https://orgmode.org/list/87plo98a8g.fsf@gmail.com
2024-10-14 20:39:47 +02:00
Ihor Radchenko 90945e16aa
Fix bad org-src interaction with org-persist
* lisp/org-macs.el (org-unique-local-variables): Do not copy over
`buffer-file-name'.  This may interact badly with `org-persist' and
`org-element' - `org-persist' assumes that all the buffers with a
given `buffer-file-name' are the same, which may not be true when
copying over variables into a temporary edit buffer (org-src).
* lisp/org-persist.el (org-persist-write:elisp): Add FIXME.

Reported-by: Akash Pal <akashpaul21@gmail.com>
Link: https://list.orgmode.org/orgmode/CA+6WspJ8J+iBzL+CQr5JTZUE5hhhHBrUunLw2naKpxwpv1DNqA@mail.gmail.com/
2024-10-13 12:17:28 +02:00
Ihor Radchenko b6dbf88810
org-footnote-new: Do not throw an error at bol for inline/anonymous footnotes
* lisp/org-footnote.el (org-footnote--allow-reference-p): New optional
argument indicating that the footnote reference is going to be
anonymous/inline.  It is then allowed to be at bol.
(org-footnote-new): Check whether a footnote reference can be inserted
in place taking into account the footnote type.
* testing/lisp/test-org-footnote.el (test-org-footnote/new): New test
cases.

Reported-by: Suhail Singh <suhailsingh247@gmail.com>
Link: https://orgmode.org/list/877carzufa.fsf@gmail.com
2024-10-13 11:03:32 +02:00
Visuwesh b6a72e134d
Add repeat-mode keymap for navigation commands
* lisp/org-keys.el (org-up-heading): Add new alias for
`outline-up-heading'.
(org-mode-map): Remap `outline-up-heading' to the new alias.
(org-navigation-repeat-map, org-link-navigation-repeat-map)
(org-block-navigation-repeat-map): Add new repeat-maps to make
navigation easier.
* doc/org-manual.org (Repeating commands): Document the new feature in the manual.
* etc/ORG-NEWS (Some navigation commands can now be repeated): Announce it.
2024-10-12 19:39:56 +02:00
Ihor Radchenko 11cf3b6daf
Merge branch 'bugfix' 2024-10-12 14:55:14 +02:00
Ihor Radchenko 3117185dba
org-texinfo-supports-math-p: Fix incompatibility with Emacs 27
* lisp/ox-texinfo.el (org-texinfo-supports-math-p): Avoid using
`file-name-with-extension', which is not yet available in Emacs 27.
2024-10-12 14:50:52 +02:00
Ihor Radchenko a8da21874d
Merge branch 'bugfix' 2024-10-12 12:53:19 +02:00
Ihor Radchenko 96f695034c
org-get-export-keywords: Fix completing export attributes
* lisp/org.el (org-get-export-keywords): Complete export attributes
like #+attr_<backend>:.

Reported-by: Pedro Andres Aranda Gutierrez <paaguti@gmail.com>
Link: https://orgmode.org/list/CAO48Bk-NB9HyavB7tCbq3hQZW=CboHx5qC_-s=kF_v2uihC2Rg@mail.gmail.com
2024-10-12 12:51:26 +02:00
Ihor Radchenko 76cd7e995a
Merge branch 'bugfix' 2024-10-12 10:49:43 +02:00
Ihor Radchenko 19d462e7a7
org-comment-or-uncomment-region: Fix comment boundaries inside src blocks
* lisp/org.el (org-comment-or-uncomment-region): When calculating
region boundaries inside src edit buffer, do not assume that region
length does not change - it may, when the indentation inside src edit
buffer is different from the Org buffer.

Reported-by: Stephanus Comnenus <linjt267@gmail.com>
Link: https://orgmode.org/list/CAHqtn=fWq6E5_pm72AB9vFxwjS0a8ma=UvVjMrgeivE9pa13ZQ@mail.gmail.com

TINYCHANGE
2024-10-12 10:47:11 +02:00
Anand Deopurkar e2823be9da
org-colview: Fix ignoring org-agenda-columns-add-appointments-to-effort-sum
* org-colview.el (org-columns--collect-values): Accept an additional
optional argument AGENDA-MARKER.
(org-agenda-columns): Pass the position of the current agenda line to
org-columns--collect-values through AGENDA-MARKER.  Use it to read the
'duration' property

Fixes the bug below.

Reported-by: Stanislav Vlasov
Link:
https://lists.gnu.org/archive/html/emacs-orgmode/2020-08/msg00090.html

also see the fix
Reported-by: Mamoru Miura
Link: https://lists.gnu.org/archive/html/emacs-orgmode/2022-07/msg00558.html

Previously, `org-agenda-columns' called `org-columns--collect-values' from
the buffer from which the agenda line originates. As a result,
`org-columns--collect-values' did not have access to the agenda line.
Mamoru Miura's solution recomputes the agenda-line.  My current patch
adds an optional argument to `org-columns--collect-values' which can be
used to pass the position of the agenda line.

TINYCHANGE
2024-10-12 09:31:44 +02:00
Ihor Radchenko aead1f13ab
Merge branch 'bugfix' 2024-10-10 19:42:03 +02:00
Nick Dokos b457dbfe5a
org-babel: Avoid changing user options by not sharing list structure
* lisp/ob-core.el (org-babel-get-src-block-info): Use `copy-tree'
when using `org-babel-default-header-args*' variables to prepare the
`info' variable used in src block evaluation. The `info' variable gets
modified, and the modifications were affecting the values of the user
variables. In particular, the `:file' setting was modified in the presence
of a `:output-dir' setting, concatenating more and more copies of the directory
every time the block was evaluated.

Reported-by: @lyndhurst on SE Emacs
Link: https://emacs.stackexchange.com/questions/82261/
2024-10-10 19:38:24 +02:00
Ihor Radchenko f14ed5791f
Merge branch 'bugfix' 2024-10-07 20:41:47 +02:00
Ihor Radchenko eb6d70f817
org-persist: Fix cached data being modified by reference
* lisp/org-persist.el (org-persist--write-cache):
* lisp/org-persist.el (org-persist-read):
(org-persist-write): Remove `org-persist--write-cache'.  The values,
after reading, might sometimes be modified in place.  The
modifications, when done inside some kind of deeply nested structure,
will propagate to the cache, polluting what was originally written in
the persist file.

This was a difficult bug to spot - the modification hapenned when an
Org buffer was saved to a different file (C-x C-w), modified, leading
to `org-element--cache' modification, and then closed.  This
modification propagated to `org-persist--write-cache', leading to
incorrect cache value being assigned to the original buffer (before
C-x C-w).

Reported-by: Gregor Zattler <telegraph@gmx.net>
2024-10-07 20:35:12 +02:00
Ihor Radchenko d33940f6e2
Fix typo in 1a51e21979
* lisp/ox.el (org-export-dictionary): Fix language id.  Should be
"de".

TINYCHANGE
2024-10-07 19:54:39 +02:00
Philip Kaludercic 1a51e21979
* lisp/org/ox.el (org-export-dictionary): Update German entries 2024-10-06 14:42:32 +02:00
Ihor Radchenko 28c83e678f
Update version number for the 9.7.12 release 2024-10-06 09:30:35 +02:00