* lisp/ob-core.el (org-babel-current-result-hash): Mark INFO argument
as unused. `org-babel-where-is-src-block-results' does not use INFO
argument even when passed.
* lisp/ob-core.el (org-babel-initiate-session):
(org-babel-switch-to-session):
(org-babel-switch-to-session-with-code): Explain all the arguments in
the docstring.
* lisp/ob-core.el (org-babel-where-is-src-block-result): Do not assume
that parent has contents-end and that we are inside contents, but not
inside secondary object/affiliated keyword.
*
testing/lisp/test-ob.el (test-ob/inline-src_blk-default-results-replace-line-1):
Add tests.
Reported-by: Tom Gillespie <tgbugs@gmail.com>
Link: https://orgmode.org/list/CA+G3_PNt7WqkCzChV+dx1FeSPgTEVkNSE41a3qC5wv3g+jTwrQ@mail.gmail.com
* lisp/ob-core.el (org-babel-where-is-src-block-head): Quote
`match-data'.
(org-babel-insert-result): Ensure two spaces between sentences.
(org-babel-temp-file): Clarify that `temporary-file-directory' refers
to a function.
* lisp/ob-core.el (org-babel-execute-src-block): Do not remove
previous result when :cache is yes, but :results requests
appending/prepending the new result.
* lisp/org-src.el (org-src-preserve-indentation-p): New function
checking whether block should preserve indentation. This function
abstracts away the check for block type, indentation flag, and
customized `org-src-preserve-indentation' value.
(org-src--edit-element):
* lisp/ob-core.el (org-babel--normalize-body):
(org-babel-read-element):
(org-babel-update-block-body):
* lisp/ob-exp.el (org-babel-exp-process-buffer):
* lisp/org-element.el (org-element-example-block-interpreter):
(org-element-src-block-interpreter):
* lisp/org.el (org-fixup-indentation):
(org-indent-region):
* lisp/ox.el (org-export-unravel-code): Use the new function instead
of duplicating code.
* lisp/ob-haskell.el (org-babel-haskell-export-to-lhs): Add FIXME. We
do not have access to the block element here and cannot easily check
the flag.
* lisp/ob-tangle.el (org-babel-tangle-single-block):
* lisp/org-src.el (org-src-font-lock-fontify-block):
* lisp/org.el (org-indent-line): Check block flag in addition to `org-src-preserve-indentation'.
This commit unifies logic deciding whether to preserve block
indentation into a single place to avoid confusion.
* lisp/org-element.el (org-element-begin):
(org-element-end):
(org-element-contents-begin):
(org-element-contents-end):
(org-element-post-affiliated):
(org-element-post-blank): New functions for fast access to frequently
used element properties. The functions are `setf'-able.
Update all the relevant code in Org to use the new functions instead
of genetic property queries.
* lisp/ob-core.el (org-babel-insert-result): Silence
ignored-return-value warnings about calls to side-effect-free
functions in the last clause of `cond` statements whose values are
unused.
Remove unused values in effect context
4f0849a9e6d29e25d23e061bd81bacce9468856d
Mattias Engdegård
Sun Apr 9 16:45:40 2023 +0200
* lisp/ob-core.el (org-babel-insert-result): Comment out unused `cond'
clause. Still leave it there for readability of the logic.
* lisp/org.el (org-agenda-restrict-begin):
(org-agenda-restrict):
(org-agenda-restrict-end): Mark variables from org-agenda.
Also, do not use [^\000] as a poor-man's replacement for
(rx (or any newline)).
* lisp/ob-core.el (org-babel-src-block-regexp):
* lisp/ob-haskell.el (org-babel-haskell-export-to-lhs):
* lisp/org-compat.el (org-hide-block-toggle-all):
* lisp/org-element.el:
* lisp/org-feed.el (org-feed-read-previous-status):
(org-feed-parse-rss-feed):
(org-feed-parse-rss-entry):
* lisp/ox-org.el (org-org-publish-to-org):
* testing/lisp/test-ob-tangle.el:
* lisp/org.el (org-block-regexp):
(org-clock-drawer-re): Use \(.\|\n\) regexp instead of [^\000].
(org-latex-regexps): Do not try to match \000 inside latex fragments -
we now use parser for this purpose.
Reported-by: Tommy Kelly <tommy.kelly@verilab.com>
Link: https://orgmode.org/list/875yfk9vlv.fsf@localhost
* lisp/org-macs.el (org-sxhash-safe): New function to calculate object
hashes. Unlike `sxhash', the new function ensures that
if (= (org-sxhash-safe A) (org-sxhash-safe b)) then (equal A B)
Not just the opposite.
* lisp/ob-core.el (org-babel-temp-stable-file): Use the new function.
Reported-by: Thomas Worthington <thomas.worthington@cosector.com>
Link: https://orgmode.org/list/877cwrcdh2.fsf@localhost
* lisp/ob-core.el (org-babel-temporary-stable-directory): Use
`temporary-file-directory' variable instead of function. The function
returns value depending on the `default-directory' at Org startup time
thus creating unpredictable temporary babel locations that may
sometimes litter current directory.
Reported-by: bhrgunatha <bhrgunatha@gmail.com>
Link: https://orgmode.org/list/93b040e1-6dc6-487f-de89-a4cea9a560ff@gmail.com
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
* 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