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

> Then, for the returned value `result' of org-babel-tangle-single-block:
> The original function returns (file-name1 ... link1 ...).
> The proposed function returns ((file-name1 ... link1 ...)).
>
>  If we change the function behavior, the difference must be a breaking change.

It looks like we have to change the return value one way or another.
Either how I suggested or using your suggestion with multiple
links/file-names specified in the return value.
(of course, if you have better, less breaking, ideas, please share them)

We can minimize breakage with the return value I am suggesting as the following:

1. Introduce a new optional parameter ALLOW-MULTIPLE for 
`org-babel-tangle-single-block'
2. When ALLOW-MULTIPLE is non-nil, return as I suggested
3. When ALLOW-MULTIPLE is nil and :tangle specifies single target, use the 
previous return value convention
4. When ALLOW-MULTIPLE is nil and :tangle specifies multiple targets,
   still use previous return value convention by returning the first
   target only and displaying a warning

Then, all the users of `org-babel-tangle-single-block' will pass non-nil
ALLOW-MULTIPLE argument. External users will naturally pass nil, keeping
the old convention and not breaking anything. External users used on new
Org files that make use of the multiple tangle targets feature will get
a runtime warning.

Does it make sense?

-- 
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