diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el index 6c79794f7..14ef97b9a 100644 --- a/lisp/ob-tangle.el +++ b/lisp/ob-tangle.el @@ -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))