* lisp/org.el (org-in-archived-heading-p): New function.
* lisp/ob-exp.el (org-babel-exp-process-buffer):
* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): Use
`org-in-archived-heading-p' to skip archived headings when tangling
and exporting.
* testing/lisp/test-org.el (test-org/in-archived-heading-p): Add
test for `org-in-archived-heading-p'.
Reported-by: flare <gabrielxaviersmith@gmail.com>
See https://orgmode.org/list/877dt9ey2c.fsf@gmail.com/
* lisp/ob-python.el (py-send-string-no-output): Remove external function.
(py-shell-send-string): Add external function.
(org-babel-python--eval-ast): Remove blank lines.
(org-babel-python--send-string): New function to send string to Python
process and return output.
(org-babel-python-evaluate-session): Call
org-babel-python--send-string to evaluate code.
New function to send code to Python session. It has the following
desirable properties:
- Wait for evaluation to finish before returning.
- Input can have arbitrary spaces/newlines.
- Avoid echoing input to the session.
- Echo all output to the session.
- Output is also captured and returned separately.
- Avoid adding extra prompts to the session.
- Work well with both Python and IPython repls.
The implementation borrows from `python-shell-send-string-no-output'
and `org-babel-comint-with-output'. This commit is related to
632ceabb1, which tried to implement the same thing, but also
introduced bugs, and had to be partially reverted in b5709ddc9.
* lisp/ob-python.el (org-babel-python-initiate-session-by-key): Remove
workaround for emacs<24.1. Sleep after starting Python, to prevent
startup messages leaking into output results.
* testing/lisp/test-ob-python.el (test-ob-python/session-multiline):
Remove workaround for startup message leaking into results.
* lisp/ob-shell.el (org-babel-execute:shell)
(org-babel-sh-evaluate): Use the exit code as the value and,
consequently, as the result when no :results header is set.
See this thread:
https://orgmode.org/list/CA+A2iZaziAfMeGpBqL6qGrzrWEVvLvC0DUw++T4gCF3NGuW-DQ@mail.gmail.com/
And Tim's useful summary here:
https://orgmode.org/list/87sgiszqc1.fsf@gmail.com/
This commit resolves the issue by deciding not to make an exception
for ob-shell.el:
- the "value" of executing a shell/bash script is the exit code
- when no :results header is set, use the value as the result
- use :results output to use the stdout
* lisp/ob-core.el (org-babel--expand-body): New function.
(org-babel-check-confirm-evaluate):
(org-babel-execute-src-block): Use org-babel--expand-body.
As of 727c6d7fe (lisp/ob-core.el: org-babel-check-confirm-evaluate
strip coderefs, 2020-09-04), org-babel-check-confirm-evaluate and
org-babel-execute-src-block use the same logic to expand the body and
strip coderefs. Move that code to a helper function.
This patch is functionally equivalent to the patch originally proposed
by Tom Gillespie at
https://orgmode.org/list/CA+G3_PNi3uMvBiWgBdKuC3C6VJt1T1j-RKH43LRqYbr+4NS8ZA@mail.gmail.com
* lisp/ob-core.el (org-babel-check-confirm-evaluate): strip coderefs
before passing the body of the block to org-confirm-babel-evaluate
using the same let block as is used in org-babel-execute-src-block.
* lisp/org.el (org-read-date-display-live): Document that live
display is only available when `org-read-date-popup-calendar' is
non-nil.
See <https://orgmod.org/list/20200630180259.zj3krk57x5iqmbsj@orion>
Reported-by: Edmund Christian Herenz <eherenz@eso.org>
* lisp/ob-core.el (org-babel-result-to-file): Use
`buffer-base-buffer' so that `buffer-file-name' returns correct
results in indirect buffers too.
See <https://orgmode.org/list/87eeos3w7v.fsf@localhost>
TINYCHANGE
* doc/org-manual.org (JavaScript supported display of web pages):
Small rephrasing.
(Exporting to minimal HTML): New section.
Reported-by: Paramjit Singh <paramjitrohits@gmail.com>
* lisp/org-capture.el (org-capture-finalize): Update
`org-capture-plist' with local-value before finalizing.
We use the global-variable `org-capture-plist' to populate the
local-variable `org-capture-current-plist' on the init of the
`org-capture' buffer. However, we do not do the opposite (i.e. update
the global-variable with the local-variable) on
`org-capture-finalize'.
This is fine for the majority of `org-capture-finalize', since we’re
using the LOCAL arg of `org-capture-get' to read
`org-capture-current-plist' instead of `org-capture-list', but this
trick does not work for `org-capture-after-finalize', since the hook
is run after the `org-capture-buffer' has been closed.
This causes problem with `:kill-buffer t', and it limits what can be
done with cleanup functions in `org-capture-after-finalize'.
See <https://orgmode.org/list/87h7tv9pkm.fsf@hidden/> for details.
* lisp/org.el (org-make-tags-matcher): Add a parameter to make it
optional to include non-buffer tags.
(org-match-sparse-tree): Use the new parameter.
TINYCHANGE
* lisp/ox-odt.el (org-odt--translate-latex-fragments):
* lisp/ox-html.el (org-html--format-image): Use
`org-preview-latex-image-directory' instead of hardcoding the
directory name.
See <https://orgmode.org/list/87a70v9jan.fsf@ucl.ac.uk>
Reported-by: Eric S Fraga <e.fraga@ucl.ac.uk>
* lisp/org-goto.el (org-goto-location): Call make-indirect-buffer with
a non-nil CLONE to preserve the base buffer's state, avoiding a more
expensive call to org-mode.
Reported-by: Vladimir Nikishkin <lockywolf@gmail.com>
Suggested-by: Ihor Radchenko <yantar92@gmail.com>