mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-07-15 12:16:27 +00:00
babel: `org-babel-tangle-w-comments' controls comment insertion in tangled code
* contrib/babel/lisp/org-babel-tangle.el (org-babel-spec-to-string): The insertion of automatically generated comments into tangled code is now customizable through the `org-babel-tangle-w-comments' variable.
This commit is contained in:
parent
5349014e82
commit
ff58dacc7c
|
@ -40,6 +40,11 @@ to use when writing out the language to file, and an optional
|
||||||
fourth element is a flag which when true indicates that the
|
fourth element is a flag which when true indicates that the
|
||||||
language does not support comments.")
|
language does not support comments.")
|
||||||
|
|
||||||
|
(defvar org-babel-tangle-w-comments nil
|
||||||
|
"Control the insertion of comments into tangled code. Non-nil
|
||||||
|
value will result in the insertion of comments for those
|
||||||
|
languages with comment support.")
|
||||||
|
|
||||||
(defun org-babel-load-file (file)
|
(defun org-babel-load-file (file)
|
||||||
"Load the contents of the Emacs Lisp source code blocks in the
|
"Load the contents of the Emacs Lisp source code blocks in the
|
||||||
org-mode formatted FILE. This function will first export the
|
org-mode formatted FILE. This function will first export the
|
||||||
|
@ -218,7 +223,8 @@ form
|
||||||
|
|
||||||
(link source-name params body)"
|
(link source-name params body)"
|
||||||
(flet ((insert-comment (text)
|
(flet ((insert-comment (text)
|
||||||
(when commentable
|
(when (and commentable
|
||||||
|
org-babel-tangle-w-comments)
|
||||||
(insert "\n")
|
(insert "\n")
|
||||||
(comment-region (point) (progn (insert text) (point)))
|
(comment-region (point) (progn (insert text) (point)))
|
||||||
(end-of-line nil)
|
(end-of-line nil)
|
||||||
|
|
Loading…
Reference in a new issue