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

2022-08-13 Thread Ihor Radchenko
Max Nikulin writes: >>> 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"? >> >> match-end is used later in the code. Thus, string-match is justified. > > The matched string is

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

2022-08-13 Thread Max Nikulin
On 13/08/2022 13:42, Ihor Radchenko wrote: Max Nikulin writes: + (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

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

2022-08-13 Thread Ihor Radchenko
Max Nikulin writes: >> + (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) >> +

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

2022-08-13 Thread Ihor Radchenko
Hraban Luyat writes: >>> @Ihor: I have rebased the patch and attached it. Applied onto main via 8a781d35d. https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=8a781d35dc68f20fa2a5546c98ba3d9b77ee3cda Thanks again for your contribution! -- Ihor Radchenko, Org mode contributor,

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

2022-08-12 Thread Max Nikulin
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

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

2022-08-11 Thread Hraban Luyat
On 8/11/22 12:26 AM, Ihor Radchenko wrote: > Hraban Luyat writes: > >>> Is there any problem with the following? >>> >>> (alist-get :tangle params) >> >> This bit of code was moved, I didn't write it. The original code uses a >> variable `src-tfile' which isn't available here, so I

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

2022-08-11 Thread Max Nikulin
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

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

2022-08-10 Thread Ihor Radchenko
Hraban Luyat writes: >> Is there any problem with the following? >> >>(alist-get :tangle params) > > This bit of code was moved, I didn't write it. The original code uses a > variable `src-tfile' which isn't available here, so I reused the > definition of that variable (which is (cdr

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

2022-08-10 Thread Hraban Luyat
On 8/3/22 11:55 AM, Max Nikulin wrote: >> + (when bare >> +(if (and org-babel-tangle-use-relative-file-links >> + (string-match org-link-types-re bare) >> + (string= (match-string 1 bare) "file")) >> +(concat "file:" >> +

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

2022-08-03 Thread Max Nikulin
On 31/07/2022 06:42, Hraban Luyat wrote: Before: ;; [[file:test.org::*Main][Main:1]] 1 ;; file:/tmp/test.org::inner][inner]]][inner]] After: ;; [[file:test.org::*Main][Main:1]] 1 ;; [[file:test.org::inner][inner]] Certainly the fix will be an improvement. +

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

2022-08-03 Thread Ihor Radchenko
Hraban Luyat writes: > Done, new patch attached. Thanks for the feedback. Thanks! I have applied an earlier conflicting patch recently. Now, your patch does not apply any more. Could you kindly update it? Best, Ihor

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

2022-08-03 Thread Bastien Guerry
Hi Ihor and Hraban, Ihor Radchenko writes: > Bastien, could you please check the FSF records? Yes, I confirm Hraban FSF assignment is all good. I added him on https://orgmode.org/worg/contributors.html in the list of FSF-signed contributors. Thanks! -- Bastien

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

2022-07-30 Thread Hraban Luyat
On 7/30/22 12:56 AM, Ihor Radchenko wrote: > Hraban Luyat writes: > >> This is my first org-mode patch, all comments welcome :). I signed a >> copyright assignment to the FSF 2021-07-12. > > Thanks for the contribution! > > Bastien, could you please check the FSF records? > > The patch looks good

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

2022-07-29 Thread Ihor Radchenko
Hraban Luyat writes: > This is my first org-mode patch, all comments welcome :). I signed a > copyright assignment to the FSF 2021-07-12. Thanks for the contribution! Bastien, could you please check the FSF records? The patch looks good in general. Few minor comments below. > *

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

2022-07-28 Thread Hraban Luyat
* lisp/ob-tangle.el: Refactor the double implementation to a single helper function. This avoids the double link wrapping. * testing/lisp/test-ob-tangle.el: Add unit tests. Babel tangle allows inserting comments at the tangled site which link back to the source in the org file. This linking was