* lisp/ob-tangle.el (org-babel-tangle-comment-format-beg): Mention the
new `org-babel-tangle-uncomment-comments' variable in the
documentation.
(org-babel-tangle-comment-format-end): Mention the new
`org-babel-tangle-uncomment-comments' variable in the documentation.
(org-babel-tangle-uncomment-comments): New customization variable to
inhibit the post-processing of tangle comments.
(org-babel-spec-to-string): Post-processing of tangle comments is
now dependent upon a customization variable.
* lisp/org.el (org-in-commented-heading-p): New function.
* lisp/ob-tangle.el (org-babel-under-commented-heading-p): Remove
function.
(org-babel-tangle-collect-blocks): Use new function.
* lisp/ob-exp.el (org-babel-exp-process-buffer): Use new function.
* testing/lisp/test-org.el (test-org/in-commented-heading-p): New
test.
* lisp/ob-C.el (org-babel-C-execute): Remove common indentation when
trimming.
* lisp/ob-core.el (org-babel-read-result): Remove common indentation
when trimming.
(org-babel-update-block-body): Remove common indentation when
trimming.
* lisp/ob-fortran.el (org-babel-execute:fortran): Remove common
indentation when trimming.
* lisp/ob-tangle.el (org-babel-process-comment-text): Better default
to process tangled comments.
* lisp/ob-C.el, lisp/ob-clojure.e: Require 'cl at compile-time.
* lisp/ob-tangle.el: Do not require 'cl at compile time.
* lisp/org-agenda.el: Declare function `org-columns-remove-overlays´.
* lisp/org.el: Declare functions `org-clocktable-shift´,
`org-clock-update-time-maybe´, `org-clock-remove-overlays´,
`org-babel-tangle-file´, `org-table-blank-field´,
`org-table-insert-row´, `org-add-archive-files´, `org-table-begin´,
`org-table-end´. Move defsubst `org-uniquify´ before its many uses.
* lisp/ox.el: Move defsubst `org-export-get-parent´ before its many
uses.
* org.el (org-babel-load-file): Set `exported-file' correctly,
in case the file as been tangled using a buffer-local value.
* ob-tangle.el (org-babel-tangle-file): Return the list of
tangled files.
Thanks to Sam Flint for reporting this.
* lisp/ob-tangle.el: (org-babel-tangle): don’t move point when called
with single prefix arg
Previously, C-u C-x C-v C-t would move point to the head of the source block.
* lisp/ob-tangle.el (org-babel-under-commented-heading-p): Check if
the point is under a commented heading (including parents).
(org-babel-tangle-collect-blocks): Don't tangle blocks is under a
commented heading (including parents).
* lisp/ob-tangle.el (org-babel-tangle-use-relative-file-links):
Controls the use of relative paths in files and links in tangled
source code.
(org-babel-spec-to-string): Optionally use relative paths in files
and links.
And seems that you miss another 'padline' in function
'org-babel-spec-to-string', line 323. I attached small patch which
removes that line so I can tangle Org document with shell scripts.
* lisp/ob-tangle.el (org-babel-spec-to-string): Remove dangling
'padline' variable.
TINYPATCH
* lisp/ob-tangle.el (org-babel-spec-to-string): Remove padline
handling from here as there is insufficient information on context.
(org-babel-tangle): Moved padline handling here where we can test
for placement in the file.
* lisp/ob-tangle.el (org-babel-tangle): Collect tangle modes, and only
apply them to the file after all tangling has completed, including the
post-tangle-hook.
* doc/org.texi (Top): Documentation for new tangle-mode header argument.
(Specific header arguments): Documentation for new tangle-mode header
argument.
(rownames): Documentation for new tangle-mode header argument.
(tangle-mode): Documentation for new tangle-mode header argument.
* lisp/ob-core.el (org-babel-common-header-args-w-values): Adding the
new :tangle-mode header argument.
(org-babel-read): Read values starting with a "#" character as emacs
lisp.
* lisp/ob-tangle.el (org-babel-tangle): Use the new :tangle-mode header
argument.
* lisp/org-pcomplete.el (pcomplete/org-mode/block-option/src): Use the
new :tangle-mode header argument.
* lisp/ob-eval.el, lisp/ob.el, lisp/org-macro.el, lisp/org-mhe.el:
Require org-macs and org-compat as necessary.
* lisp/ob-tangle.el: Declare function `org-store-link' and
`org-open-link-from-string'.
* lisp/org-compat.el: Extend eval-and-compile clause and add advices
for functions that have different parameter lists in XEmacs. Add
variable definitions that XEmacs lacks .
* lisp/org-macs.el (declare-function): Define macro to use autoload
instead for XEmacs.
* lisp/ox-html.el, lisp/ox-odt.el: XEmacs does not have table.el, so
use 'noerror on the require form.
* lisp/ox-texinfo.el (org-texinfo-table-column-widths): Fix spliced
argument list that XEmacs complains about by adding parenthesis.
This fixes all compilation failures on XEmacs and warnings related to
Org that indicate that XEmacs has compiled things wrongly (for
instance it might have interpreted a function as a variable symbol).
There are still many warnings that probably indicate serious problems.
* lisp/ob-tangle.el (org-babel-tangle-jump-to-org): Use the existing
org-edit-src functionality to jump back to the correct point in the
code block in the original Org-mode buffer.
* org.el (org-babel-load-file): Move `org-babel-load-file'
from ob-tangle.el to here so that it is correctly autoloaded
by Emacs before Org is required.
Thanks to Eric Schulte for feedback about this.
* lisp/ob-tangle.el (org-babel-tangle): Do not change signature, a nil
arg is even documented in the manual.
* lisp/org-src.el: Change declaration of `org-babel-tangle´ to "arg"
for first argument.
* ob-tangle.el (org-babel-tangle): Remove unused attempt of
prompting the user of the tangle file name since :tangle is
always set. Don't prompt for a tangle file name when called
with two universal prefix arg outside of a src block.
Use `org-babel-tangle-single-block'.
(org-babel-tangle-single-block): New function.
(org-babel-tangle-collect-blocks): Use the new function.
Thanks to Rick Frankel who provided a patch for this fix.
The patch fixes this issue (quoting Rick's email):
"When attempting to tangle a single block, `org-babel-tangle'
would use `narrow-to-region', causing any header arguments not
on the "#+BEGIN_SRC" line to be excluded from the tangled file."
* ob-tangle.el (org-babel-tangle): Rename the ONLY-THIS-BLOCK
parameter to ARG. Allow two universal prefix arguments to
tangle by the target file of the block at point.
(org-babel-tangle-collect-blocks): New parameter TANGLE-FILE
to restrict the collection of blocks to those who will be
tangled in TARGET-FILE.
Thanks to Zech for suggesting this.