1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-12-28 10:56:57 +00:00

ob-tangle.el (org-babel-tangle-collect-blocks): Don't collect blocks in commented out headings

* ob-tangle.el (org-babel-tangle-collect-blocks): Don't
collect blocks in commented out headings.

Thansk to the various people who requested this.
This commit is contained in:
Bastien Guerry 2013-02-28 10:25:21 +01:00
parent fb920a38ad
commit 8e0b4529f7

View File

@ -373,12 +373,13 @@ code blocks by language."
(or (nth 4 (org-heading-components))
"(dummy for heading without text)")
(error (buffer-file-name)))))
(let* ((start-line (save-restriction (widen)
(+ 1 (line-number-at-pos (point)))))
(let* ((start-line
(save-restriction (widen) (+ 1 (line-number-at-pos (point)))))
(file (buffer-file-name))
(info (org-babel-get-src-block-info 'light))
(src-lang (nth 0 info)))
(unless (string= (cdr (assoc :tangle (nth 2 info))) "no")
(unless (or (string-match (concat "^" org-comment-string) current-heading)
(string= (cdr (assoc :tangle (nth 2 info))) "no"))
(unless (and language (not (string= language src-lang)))
(let* ((info (org-babel-get-src-block-info))
(params (nth 2 info))