* lisp/ob-tangle.el (org-babel-tangle-single-block,
org-babel-tangle-comment-links): Suppress org-id-link-to-org-use-id
during tangling. The links used during tangle process are transient
and do not really need to use ID. Using ID may create unexpected
edits in the tangled Org buffer when org-id-link-to-org-use-id is set
to t. Fixes [1].
[1] https://orgmode.org/list/9eb31da73b12fcaf6820484834cc8cd3@libre.brussels/T/#t
* lisp/ob-tangle.el (org-babel-tangle): Fix stringp error which happens
when confirming successful tangle when `org-babel-tangle' is called from
an org-src edit buffer.
TINYCHANGE
* lisp/ob-tangle.el (org-babel-effective-tangled-filename): Check for
the "no" parameter in this function to avoid erroneous tangling of a
single block (e.g. with C-u C-c C-v t) even with the parameter
:tangle no
TINYCHANGE
lisp/ob-tangle.el (org-babel-tangle-single-block): Fix the result when
`only-this-block' is `t' to match what is expected by
`org-babel-tangle'.
(org-babel-effective-tangled-filename): Extract the
computation of filename of tangled src block.
(org-babel-tangle-collect-blocks): Use `org-babel-effective-tangled-filename'.
* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): Group
collected blocks by tangled file name.
(org-babel-tangle): Avoid quadratic behavior in number of blocks and
set modes before writing to file.
* testing/lisp/test-ob-tangle.el (ob-tangle/block-order): Update test.
* lisp/ob-tangle.el (orb-babel-tangle-single-block): Regularize
behavior when removing coderefs during tangling. This fixes an issue
where trailing whitespace would be retained when coderefs were removed
for tangling.
* lisp/ob-comint.el (org-babel-comint-in-buffer)
(org-babel-comint-with-output): Use `declare`.
* lisp/ob-core.el (org-babel-map-src-blocks): Use `declare`.
(org-babel-result-cond): Simplify edebug spec.
* lisp/org-clock.el (org-with-clock-position, org-with-clock):
* lisp/org-agenda.el (org-agenda-with-point-at-orig-entry):
* lisp/ob-tangle.el (org-babel-with-temp-filebuffer): Use `declare`.
Use `declare` instead of `def-edebug-spec` in most places
f8dbefbaa59bb17dd4a2dfa4d9ff560c46785792
Stefan Monnier
Fri Feb 12 16:08:01 2021 -0500
* 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-tangle.el (org-babel-tangle-single-block): Fix regression
from v9.0.2 that resulted in org-babel-tangle-use-relative-file-links
being ignored.
* testing/lisp/test-ob-tangle.el
(ob-tangle/comment-links-relative-file): Add test.
As of 7b148e2d0 (ob-tangle: Respect buffer local variables,
2016-12-10), the condition in org-babel-tangle-single-block that
checks whether to return a file link with a relative target always
returns nil because the full org-link-types-re match, including the
final colon, is compared with "file" (no colon). Also, were this
condition to succeed, "file:" would be used as the file name.
Adjust the condition and fix the extracted file name.
Reported-by: Jeremias Gonzalez <jgonzalez49@ucmerced.edu>
https://orgmode.org/list/6fb12326-52d3-7177-eff5-62603261b388@ucmerced.edu
* lisp/org.el (org-babel-load-file): Load both "emacs-lisp"
and "elisp" source blocks.
* lisp/ob-tangle.el (org-babel-tangle-file)
(org-babel-tangle, org-babel-tangle-collect-blocks): Use a
regular expression to match the language(s) to tangle.
Thanks to Troy Hinckley for reporting this.
* lisp/ob-core.el (org-babel-expand-noweb-references):
* lisp/ob-tangle.el (org-babel-tangle): Use `org-src-get-lang-mode' so
as to use proper major mode.
Reported-by: immanuel <immanuel.litzroth@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2019-08/msg00272.html>
* lisp/ob-tangle.el (org-babel-tangle-comment-links): %start-line
reports the line number, not the buffer position at the beginning of
line.
Reported-by: immanuel <immanuel.litzroth@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2019-08/msg00267.html>
Assume that there is file A and symlink B that points to file A. If
there is an open buffer that points to A and we
call (org-babel-tangle-file "B"), then this function kills the buffer
since get-file-buffer does not follow symlinks.
* lisp/ob-tangle.el (org-babel-detangle):
(org-babel-tangle-jump-to-org): Use `org-link-bracket-re'.
* lisp/ol.el (org-link-analytic-bracket-re): Remove variable.
(org-link-make-regexps): Do not set it.
(org-link-display-format): Use `org-link-bracket-re'
(org-link-trim-scheme): New function.
(org-store-link): Remove code duplication.
* lisp/ob-tangle.el (org-babel-tangle-collect-blocks): Preserver order
of code blocks from the source document.
* testing/lisp/test-ob-tangle.el (ob-tangle/block-order): New test.
Reported-by: Kaushal Modi <kaushal.modi@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-10/msg00062.html>
* lisp/ob-tangle.el (org-babel-tangle-jump-to-org): Preserve position
in source block only if it doesn't put point outside of the block.
Reported-by: Frederick Giasson <fred@curbside.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-06/msg00008.html>
* lisp/ob-tangle.el (org-babel-tangle-single-block): Prevent double unescaping
of source block by removing unnecessary call to `org-unescape-code-in-string'.
* testing/lisp/test-ob-tangle.el (ob-tangle/nested-block) New function.
* lisp/ob-tangle.el (org-babel-tangle-publish): Port to new copy-file
behavior.
Adjust ob-tangle to new copy-file behavior
74b8615fcceba7b92c4938e1bcc92015f10ae899
Paul Eggert
Sun Sep 10 22:31:23 2017 -0700
* lisp/ob-tangle.el (org-babel-tangle-single-block):
`org-babel-expand-noweb-references' specifically needs to be run in
the Org document so as to resolve references.
* testing/lisp/test-ob-tangle.el (ob-tangle/continued-code-blocks-w-noweb-ref):
Make sure a failing test doesn't leave a file behind it.
* lisp/ob-tangle.el (org-babel-spec-to-string): Move some processing...
(org-babel-tangle-single-block): ... there. This function is called
with the Org buffer as its original buffer whereas the previous one is
not.
This is a follow-up to 026fb75, which was reverted.
Reported-by: David Dynerman <emperordali@block-party.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/110670>
* lisp/ob-tangle.el (org-babel-tangle): Make sure buffer local
variables from Org document are taken into consideration in tangled
document.
Reported-by: David Dynerman <emperordali@block-party.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/110577>
* lisp/ob-tangle.el (org-babel-tangle-jump-to-org): Fix the jump from a
tangled part to the respective org in the case when an org-id defines
the linking.
The recent (buggy) behavior was to find the file which has the org-id as
filename.