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: Fri, 12 Aug 2022 20:16:08 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0

On 12/08/2022 09:21, Hraban Luyat wrote:

@Max: what do you think of when-let? That seems more appropriate for
this situation. Thoughts?

At first I thought about compatibility, but this form is available since Emacs-25, so it is not a problem.

Maybe I missed something, but I do not see clear advantage. Anyway it leads to `if' nested inside `when-let'.

+             (bare (and (string-match org-link-bracket-re l)
+                        (match-string 1 l))))
+        (when bare
+          (if (and org-babel-tangle-use-relative-file-links
+                   (string-match org-link-types-re bare)
+                   (string= (match-string 1 bare) "file"))

It looks like (string-prefix-p "file:" bare) but without the complex regexp. I see, such code was used before. By the way, why it is "bare", not e.g. "target"?

+              (concat "file:"
+                      (file-relative-name (substring bare (match-end 0))
+                                          (file-name-directory
+                                           (cdr (assq :tangle params)))))

I do not insist on changes since possible improvements are not really significant.




reply via email to

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