On 11/08/2022 03:54, Hraban Luyat wrote:
On 8/3/22 11:55 AM, Max Nikulin wrote:

Do you mean to rewrite

      (when bare (if x y bare))

to this?

      (and bare x y)

If that's what you meant, I think it would evaluate differently if bare
= truthy and x = falsy, right? Form 1 evaluates to `bare', form 2
evaluates to x (i.e. NIL). Or did I misunderstand the suggestion?

You are right. I tried to suggest an expression that was wrong.

I am going to make another attempt:

      (if (and bare
               org-babel-tangle-use-relative-file-links
               (string-match org-link-types-re bare)
               (string= (match-string 1 bare) "file"))
          (concat "file:"
                  (file-relative-name (substring bare (match-end 0))
                                      (file-name-directory
                                       (cdr (assq :tangle params)))))
        bare)

I do not think that such code is dramatically clearer, but at least it has 1 conditional form less.



Reply via email to