Lei Zhe <lzhe...@gmail.com> writes:

> This patch is the first step in resolving the feature for tangling
> source blocks to multiple targets.
> I would appreciate any feedback.

Thanks for the patch!

> -     (let* ((info (org-babel-get-src-block-info 'no-eval))
> -            (src-lang (nth 0 info))
> -            (src-tfile (cdr (assq :tangle (nth 2 info)))))
> -       (unless (or (string= src-tfile "no")
> -                      ;; src block without lang
> -                      (and (not src-lang) (string= src-tfile "yes"))
> -                   (and tangle-file (not (equal tangle-file src-tfile)))
> -                      ;; lang-re but either no lang or lang doesn't match
> -                   (and lang-re
> -                           (or (not src-lang)
> -                               (not (string-match-p lang-re src-lang)))))

You are dropping this logic completely in the patch. Without this part,
:tangle no may not work.

>        (cref-regexp (org-src-coderef-regexp coderef))
> -      (link (org-babel-tangle--unbracketed-link params))
> +      (link (ignore-errors (org-babel-tangle--unbracketed-link params)))

Why this change? It seems unrelated to the new introduced feature.

> -    (if only-this-block
> -        (let* ((file-name (org-babel-effective-tangled-filename
> -                           file src-lang src-tfile)))
> -          (list (cons file-name (list (cons src-lang result)))))
> -      result)))
> +    (let* ((file-names (org-babel-tangle--concat-targets file info)))
> +      (mapcar (lambda (file-name)
> +                (cons file-name (list (cons src-lang result))))
> +              file-names))))

With this change, ONLY-THIS-BLOCK = nil is ignored. This will cause problems.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to