Re: noweb-start and noweb-end header args

2024-03-07 Thread Amy Grinn
Ihor Radchenko writes: > Amy Grinn writes: > >> Here is a simple way to implement this feature. > > Since you are adding a new feature, it should have (1) test coverage; > (2) be documented in the manual; (3) be announced in etc/ORG-NEWS. Thank you for the tips, will do!

Re: noweb-start and noweb-end header args

2024-03-07 Thread Ihor Radchenko
Amy Grinn writes: > I kinda disagree with your reasoning but I agree with your conclusion. > I think it would be strange for third party or user configuration to > parse the value of a noweb header argument directly. Org provides a > lublic api for this which should be backwards compatible: > >

Re: noweb-start and noweb-end header args

2024-03-07 Thread Amy Grinn
Ihor Radchenko writes: > :noweb yes <<< >>> is actually backwards-incompatible. Consider > third-party code that makes assumptions about possible values of > :noweb > header argument. If third-party code does a check like > (equal noweb-value "yes"), the new syntax can break such code. I kinda

Re: noweb-start and noweb-end header args

2024-03-07 Thread Ihor Radchenko
Amy Grinn writes: > Here is a simple way to implement this feature. > ... > -(defun org-babel-noweb-wrap ( regexp) > +(defun org-babel-noweb-wrap ( regexp info) >"Return regexp matching a Noweb reference. > > Match any reference, or only those matching REGEXP, if non-nil. > > When

Re: noweb-start and noweb-end header args

2024-03-07 Thread Ihor Radchenko
Amy Grinn writes: > To expand on this, some major modes can fundamentally conflict with the > default noweb syntax. Here is a valid shell script *and* a valid noweb > reference to a block named EOF: > > cat <> file.txt > Hello > EOF > > I hope this helps explain why the wrap-start and wrap-end

Re: noweb-start and noweb-end header args

2024-03-07 Thread Ihor Radchenko
Amy Grinn writes: >> Org mode does not _currently_ modify the code. But that's actually wrong >> - things like escaped ,* or indentation sometimes also stay on the way >> and produce incorrect fontification. So, rewriting the fontification of >> src blocks to cleanup the code before

Re: noweb-start and noweb-end header args

2024-03-06 Thread Amy Grinn
Amy Grinn writes: > Ihor Radchenko writes: > >> Amy Grinn writes: >> >>> I would like to add support for setting 'org-babel-noweb-wrap-start and >>> 'org-babel-noweb-wrap-end for each src block individually >> >> May you please explain the use case when changing the default values >> is

Re: noweb-start and noweb-end header args

2024-03-06 Thread Amy Grinn
Ihor Radchenko writes: > Amy Grinn writes: > >> How much does org mode modify the fontification for an indirect buffer? >> Without having looked into it, I assume not much or at all. >> ... I think >> that approach could be more complex, especially when dealing with a >> theoretically infinite

Re: noweb-start and noweb-end header args

2024-03-06 Thread Ihor Radchenko
Amy Grinn writes: >> This sounds like XY problem then. >> If the real problem you want to solve is fontification, we may instead >> adjust Org mode fontification of source blocks to exclude noweb >> references. > > I see a problem with multiple possible solutions, some more involved > than

Re: noweb-start and noweb-end header args

2024-03-06 Thread Amy Grinn
Ihor Radchenko writes: > Amy Grinn writes: > #+name: firewall #+begin_src sh :noweb yes :noweb-start <<< :noweb-end >>> >>> >>> May you please explain the use case when changing the default values >>> is useful? >> >> Of course! Changing the default values can be useful to prevent

Re: noweb-start and noweb-end header args

2024-03-06 Thread Ihor Radchenko
Amy Grinn writes: >>> #+name: firewall >>> #+begin_src sh :noweb yes :noweb-start <<< :noweb-end >>> >> >> May you please explain the use case when changing the default values >> is useful? > > Of course! Changing the default values can be useful to prevent syntax > highlighting errors in a

Re: noweb-start and noweb-end header args

2024-03-06 Thread Amy Grinn
Ihor Radchenko writes: > Amy Grinn writes: > >> I would like to add support for setting 'org-babel-noweb-wrap-start and >> 'org-babel-noweb-wrap-end for each src block individually using the >> header args :noweb-start and :noweb-end: >> ... >> #+name: fi

Re: noweb-start and noweb-end header args

2024-03-06 Thread Ihor Radchenko
Amy Grinn writes: > I would like to add support for setting 'org-babel-noweb-wrap-start and > 'org-babel-noweb-wrap-end for each src block individually using the > header args :noweb-start and :noweb-end: > ... > #+name: firewall > #+begin_src sh :noweb yes :noweb-start <&

Re: noweb-start and noweb-end header args

2024-03-05 Thread termux
Amy Grinn writes: > I would like to add support for setting 'org-babel-noweb-wrap-start and > 'org-babel-noweb-wrap-end for each src block individually using the > header args :noweb-start and :noweb-end: Here's another possible syntax we could use: :noweb [wrap-start] [wrap-end

noweb-start and noweb-end header args

2024-03-05 Thread Amy Grinn
I would like to add support for setting 'org-babel-noweb-wrap-start and 'org-babel-noweb-wrap-end for each src block individually using the header args :noweb-start and :noweb-end: #+name: firewall-safe-mode #+begin_src sh echo "Firewall is now in safe mode." #+end_src #+name