Sorry, I'm still investigating the best way to finish this patch.

> > I still think that returning bare only is the simplest and safest
> > solution for now if :tangle has multiple targets in
> > `org-babel-tangle--unbracketed-link', then we
> > can leave everything else unchanged.
>
> Do I understand correctly that your suggestion is to deprecate
> org-babel-tangle-use-relative-file-links?

No, my proposal is to return the relative path only if :tangle has one
single target; Otherwise, return the absolute path.

llcc

On Sat, Oct 11, 2025 at 10:09 PM Ihor Radchenko <[email protected]> wrote:
>
> Lei Zhe <[email protected]> writes:
>
> > Sorry for the late response. Thanks for the explanation.
>
> Now, sorry for my late response...
>
> >>> 4. For each loop iteration, build separate RESULT list -> RESULTS
>
> > Wasn't this discussed before? If we change the result to a nested
> > list, the difference will be a breaking change.
>
> Note that my suggestion was
>
> >> 4. For each loop iteration, build separate RESULT list -> RESULTS
> >> 5. Return (if only-this-block results (car results))
>
> In your patch, with ONLY-THIS-BLOCK, we already change return value to
> nested list. And if ONLY-THIS-BLOCK is nil, I suggest (car results),
> preserving the previous behavior. So, my suggestion is not introducing
> any more breakage compared to your patch.
>
> > I still think that returning bare only is the simplest and safest
> > solution for now if :tangle has multiple targets in
> > `org-babel-tangle--unbracketed-link', then we
> > can leave everything else unchanged.
>
> Do I understand correctly that your suggestion is to deprecate
> org-babel-tangle-use-relative-file-links?
>
> > +        (dolist (block (org-babel-tangle-single-block counter t))
> > +          (let ((src-file (car block))
> > +                (src-lang (caadr block)))
> > +            (unless (or (not src-file)
> > +                        ;; src block without lang
> > +                        (and (not src-lang) src-file)
> > +                        (and tangle-file (not (equal tangle-file 
> > src-file)))
> > +                        ;; 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)))))
> > +              (setq blocks
>
> Note that you reset BLOCKS on every dolist iteration. That looks not right.
> > ...
> >      ;; Ensure blocks are in the correct order.
> >      (mapcar (lambda (b) (cons (car b) (nreverse (cdr b))))
> > -         (nreverse blocks))))
> > +             (nreverse blocks))))
>
> --
> 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