emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] ob-tangle.el: fix ‘:comments noweb’ double linking


From: Max Nikulin
Subject: Re: [PATCH] ob-tangle.el: fix ‘:comments noweb’ double linking
Date: Thu, 11 Aug 2022 22:00:15 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0

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

[Prev in Thread] Current Thread [Next in Thread]