Re: [PATCH] Fix noweb tangle recursive expansion issue

2025-09-20 Thread dominic meiser
Thanks Arne and Christian, Your suggestion of using =:noweb no-export= does work. For my use case (a literate c program where I don't use eval) it is a complete solution. If I understand the code in ob-core.el correctly there is still an underlying issue. Basically, =org-babel-expand-

Re: [PATCH] Fix noweb tangle recursive expansion issue

2025-09-20 Thread Christian Moe
"Dr. Arne Babenhauserheide" writes: > I’m not sure whether that’s a bug, but from your description, what you > want might be achieved with :noweb no-export. Because I guess that you > want noweb to work during execution. In my test, =:noweb no-export= did indeed work. But it

Re: [PATCH] Fix noweb tangle recursive expansion issue

2025-09-18 Thread Dr. Arne Babenhauserheide
Hi, I’m not sure whether that’s a bug, but from your description, what you want might be achieved with :noweb no-export. Because I guess that you want noweb to work during execution. I don’t know whether recursive context would be intended. It may be intentional that you have to explicitly

Re: [PATCH] Fix noweb tangle recursive expansion issue

2025-09-18 Thread dominic meiser
Hello, I wanted to follow up on this email. Could you provide feedback to me please whether this is an actual bug or whether I'm using the `:noweb tangle` option wrong. If this is unexpected behavior please let me know if the patches I sent go in the right direction. Thanks! Best re

[PATCH] Fix noweb tangle recursive expansion issue

2025-09-06 Thread dominic meiser
Hi Org Mode maintainers, I encountered what appears to be an issue with noweb reference expansion during tangling. I'm not sure if this is a known limitation, expected behavior, or if I'm misunderstanding how it should work, but I've prepared some patches that seem to fix the issu

Re: Noweb source/result evaluation order

2025-08-09 Thread Ihor Radchenko
Jacek Generowicz writes: > Here is an org document setting out my question. It should export cleanly > to HTML, without any dependencies other than Jujutsu. > ... > #+begin_src sh :noweb yes :exports code :dir /tmp/time-travel-wtf/branching > echo A <> > jj new <>

Re: [BUG] org-babel-detangle not working with noweb [9.7.31 (9.7.31-??-4e6d38d1a @ ~/.config/emacs.doom/.local/straight/build-30.1/org/)]

2025-08-09 Thread Ihor Radchenko
y never work. > Also we could use line-numbers as fallback. It the block is named then > it’s ok to use it’s name directly, but when not, line-numbers will work > better than current implementation with fuzzy line search, all not named > source blocks looks very similar (especiall

Noweb source/result evaluation order

2025-08-06 Thread Jacek Generowicz
Hello, Here is an org document setting out my question. It should export cleanly to HTML, without any dependencies other than Jujutsu. #+title: Noweb source/result evaluation order #+OPTIONS: toc:nil creator:nil author:nil timestamp:nil num:t validate:nil **Warning**: the code below executes

Re: [BUG] org-babel-detangle not working with noweb [9.7.31 (9.7.31-??-4e6d38d1a @ ~/.config/emacs.doom/.local/straight/build-30.1/org/)]

2025-08-03 Thread Konstantin Borisov
Ihor Radchenko writes: > Konstantin Borisov writes: > >> Currently there is a possibility to use `:comments noweb' header option >> in src block, that adds comments with links to source block to the >> tangled files. And this option works great with `org-babel-deta

Re: [BUG] org-babel-detangle not working with noweb [9.7.31 (9.7.31-??-4e6d38d1a @ ~/.config/emacs.doom/.local/straight/build-30.1/org/)]

2025-08-03 Thread Ihor Radchenko
Konstantin Borisov writes: > Currently there is a possibility to use =:comments noweb= header option > in src block, that adds comments with links to source block to the > tangled files. And this option works great with ~org-babel-detangle~ in > simple cases, but it fails to work in

[BUG] org-babel-detangle not working with noweb [9.7.31 (9.7.31-??-4e6d38d1a @ ~/.config/emacs.doom/.local/straight/build-30.1/org/)]

2025-08-02 Thread Konstantin Borisov
possibility to use =:comments noweb= header option in src block, that adds comments with links to source block to the tangled files. And this option works great with ~org-babel-detangle~ in simple cases, but it fails to work in more complex ones. This example of two continuous source blocks works well with

Re: Text preceding noweb references is duplicated

2024-12-22 Thread Ihor Radchenko
8dcc <8dcc@gmail.com> writes: > Paragraph zero... > #+begin_src scheme :tangle org-output.scm :noweb yes > (list <>) >... > After calling `org-babel-tangle', the contents of 'org-output.scm' are: > > (list (+ 1 2) > (l

Re: [FR] :noweb-wrap header arg

2024-12-10 Thread Suhail Singh
Ihor Radchenko writes: > Thinking about this more in the context of the past meetup discussion, > maybe we can just go with two header arguments? :noweb-start :noweb-end? > Or, alternatively, we can use a single string and a placeholder for the > noweb reference name. Something like

Re: [FR] :noweb-wrap header arg

2024-12-08 Thread Ihor Radchenko
"# <<" >>>otherwise, consider read until the first whitespace. >>>|#<<; >>; >>>(re-search-forward (rx (1+ (not whitespace >>>#<<;| >>> >>> However, there may be edge cases like > ... Thi

Text preceding noweb references is duplicated

2024-11-26 Thread 8dcc
Hello, Using the following Org file: Paragraph zero... #+begin_src scheme :tangle org-output.scm :noweb yes (list <>) #+end_src Paragraph one... #+begin_src scheme :tangle no :noweb-ref my-list-item (+ 1 2) #+end_src Paragraph two... #+begin_src

Re: Noweb references and padlines

2024-11-09 Thread Linus Arver
Ihor Radchenko writes: > Linus Arver writes: > >> Org supports adding blank lines between concatenated source code blocks >> with the "padline" header argument [1]. However this does not work for >> Noweb references. >> ... >> Which is great. But

Re: Noweb references and padlines

2024-11-03 Thread Ihor Radchenko
Linus Arver writes: > Org supports adding blank lines between concatenated source code blocks > with the "padline" header argument [1]. However this does not work for > Noweb references. > ... > Which is great. But the same blank lines are not inserted for the > follo

Noweb references and padlines

2024-10-01 Thread Linus Arver
Hello, Org supports adding blank lines between concatenated source code blocks with the "padline" header argument [1]. However this does not work for Noweb references. For example, a blank line is inserted between "foo" and "bar" and again between "bar"

Re: [FR] :noweb-wrap header arg

2024-07-01 Thread Ihor Radchenko
Ihor Radchenko writes: >> Let me know what you think! > > Consider cases like > ... It has been over a month since the last message in this thread. Amy, may I know if you are still working on the patch? -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at

Re: [BUG] "Stack overflow in regexp matcher" when tangling or noweb referencing large blocks [9.7.4 (9.7.4-1387e3 @ /home/andrea/.emacs.d/elpa/org-9.7.4/)]

2024-06-16 Thread Ihor Radchenko
Andrea writes: > Thanks again for Org Mode! > I recently moved to Org Mode 9.7 and I have a boring bug to share: > on tangling or :noweb yes <> src blocks, I get "Stack > overflow in regexp matcher". > > This was working with 9.6, maybe the regexp changed in

Re: [FR] :noweb-wrap header arg

2024-05-23 Thread Ihor Radchenko
Amy Grinn writes: >> I recommend the following: >> >> If the value starts from ", use Elisp's `read': >>|"# <<" ">>" >>(read (current-buffer)) ; => "# <<" >>otherwise, consider read until the first whitespace. >>|#<<; >>; >>(re-search-forward (rx (1+ (not whitespace >>

Re: [FR] :noweb-wrap header arg

2024-05-22 Thread Amy Grinn
Ihor Radchenko writes: > Amy Grinn writes: > >>> +1 >>> You may even use obsolete alias (add it to lisp/org-compat.el) >> >> Here's a patch to rename org-babel-noweb-wrap to >> org-babel-noweb-make-regexp. > > Thanks! > News entry

Re: [FR] :noweb-wrap header arg

2024-05-12 Thread Ihor Radchenko
Amy Grinn writes: >> +1 >> You may even use obsolete alias (add it to lisp/org-compat.el) > > Here's a patch to rename org-babel-noweb-wrap to > org-babel-noweb-make-regexp. Thanks! News entry is not necessary here - we are just renaming a function. Otherwise, the patc

Re: [FR] :noweb-wrap header arg

2024-05-11 Thread Amy Grinn
Ihor Radchenko writes: > Amy Grinn writes: > >> First of all, I would like to change (defalias) the function name >> org-babel-noweb-wrap to org-babel-noweb-make-regexp. I think this in >> more in line with other functions which create regular expressions. > >

Re: [Q/Bug?] Comment for noweb reference comments content

2024-05-04 Thread Ihor Radchenko
João Pedro writes: > #+begin_src emacs-lisp :noweb yes :comments noweb :tangle /tmp/foo.el > (progn > <>) > #+end_src > > #+name: foo > #+begin_src emacs-lisp > (message "foo") > #+end_src > ... > ;; [[file:...][No heading:1]] > (progn >

[Q/Bug?] Comment for noweb reference comments content

2024-05-03 Thread João Pedro
Hi, Ok so I don't know whether this is a bug or intended behaviour (though if its the latter I propose we reconsider), but if I have the following #+begin_src emacs-lisp :noweb yes :comments noweb :tangle /tmp/foo.el (progn <>) #+end_src #+name: foo #+begin_src emacs-lisp (m

Re: [FR] :noweb-wrap header arg

2024-04-13 Thread Ihor Radchenko
his regexp? AFAIU, it >> implies that you want to allow whitespace characters inside :noweb-wrap >> boundaries. But I do not think that we need to complicate things so much. > > That is exactly what I was going for. I thought about the ways this > could be used and the mo

Re: [FR] :noweb-wrap header arg

2024-04-11 Thread Amy Grinn
ng-at " *\\([^ ]+\\)")) > > May you please explain the rationale behind this regexp? AFAIU, it > implies that you want to allow whitespace characters inside :noweb-wrap > boundaries. But I do not think that we need to complicate things so much. That is exactly what I was goi

Re: [FR] :noweb-wrap header arg

2024-04-11 Thread Ihor Radchenko
Amy Grinn writes: > First of all, I would like to change (defalias) the function name > org-babel-noweb-wrap to org-babel-noweb-make-regexp. I think this in > more in line with other functions which create regular expressions. +1 You may even use obsolete alias (add it to lisp/org-

[FR] :noweb-wrap header arg

2024-04-08 Thread Amy Grinn
Hi! I'm working on the :noweb-wrap header argument which controls the syntax of noweb references in a babel src block. For example: #+name: foo #+begin_src elisp :foo #+end_src #+begin_src elisp :noweb yes :noweb-wrap <<< >>> <<>> #+end_src And I would

Re: Support for whitespace prefix for :noweb-prefix

2024-04-03 Thread Fraga, Eric
Ah, okay. Thank you. -- : Eric S Fraga, with org release_9.6.23-1314-g945046 in Emacs 30.0.50

Re: Support for whitespace prefix for :noweb-prefix

2024-04-03 Thread Ihor Radchenko
"Fraga, Eric" writes: > So it's a combination of no prefix in such a case and the indentation > according to major mode. For me, the latter is not an issue but the > former is. > > (but not really an issue for me as I make sure I only have noweb > references

Re: Support for whitespace prefix for :noweb-prefix

2024-04-03 Thread Fraga, Eric
refix in current code[1] with >> ~(setq prefix (replace-regexp-in-string "[^ \t]" " " prefix))~ ? > > I see. > So, you want a custom prefix before the expanded noweb reference lines. Not only that; at the moment, the prefix is defined by the text that comes befo

Re: Support for whitespace prefix for :noweb-prefix

2024-03-29 Thread Doerthous
Thanks, I'll check it out.

Re: Support for whitespace prefix for :noweb-prefix

2024-03-29 Thread Ihor Radchenko
Doerthous writes: > I kind of understand what you mean: what I need is just the no > option, after the expansion (maybe with the help of some > after-expansion-hooks), indent the source block according to > major-mode. Right? > > I will try to find some hooks after expansion and some APIs to > in

Re: Support for whitespace prefix for :noweb-prefix

2024-03-29 Thread Doerthous
Ihor Radchenko writes: > I still feel that what you are really looking for is major-mode-specific > indentation, not a prefix. Because indentation may require tabs, not > spaces. Or may interfere with programming language. I kind of understand what you mean: what I need is just the no option, af

Re: Support for whitespace prefix for :noweb-prefix

2024-03-29 Thread Ihor Radchenko
Doerthous writes: > Ihor Radchenko writes: > >> I think that a more general approach could be allowing :noweb-prefix to >> have a value of string that will be appended to each line on the >> expansion. > > With the use case discussed before, is allowing :noweb-pref

Re: Support for whitespace prefix for :noweb-prefix

2024-03-29 Thread Doerthous
Ihor Radchenko writes: > I think that a more general approach could be allowing :noweb-prefix to > have a value of string that will be appended to each line on the > expansion. With the use case discussed before, is allowing :noweb-prefix to have a value of string means I need to

Re: Support for whitespace prefix for :noweb-prefix

2024-03-29 Thread Ihor Radchenko
Doerthous writes: >> Do you mean that you want the code to be indented according to the major >> mode rules? >> > > Why it relates to major mode, > > Currently, with :noweb-prefix set to yes, the above code will be expand to > #+begin_src elisp > (le

Re: Support for whitespace prefix for :noweb-prefix

2024-03-28 Thread Doerthous
Ihor Radchenko 于2024年3月29日周五 03:25写道: > > Doerthous writes: > > > Can we add a support for whitespace prefix such that the prefix of a > > noweb-ref replaced by whitespace characters? > > > > ... > > #+name: a-fragment > > #+begin_src elisp :

Re: Support for whitespace prefix for :noweb-prefix

2024-03-28 Thread Ihor Radchenko
Doerthous writes: > Can we add a support for whitespace prefix such that the prefix of a > noweb-ref replaced by whitespace characters? > > ... > #+name: a-fragment > #+begin_src elisp :noweb yes :noweb-prefix whitespace > (let (<>) > <>) > #+end_src

[FR] Add whitespace option for :noweb-prefix

2024-03-28 Thread Chen Mingzheng
Hi For :noweb-prefix of noweb feature, now we have "yes" or "no" option. Can we add a new "whitespace" option so that we can: Giving following fragments, #+begin_src elisp :noweb-ref varable-bindings (a 0) (b 1) #+end_src #+begin_src elisp :no

Add new whitespace option for :noweb-prefix

2024-03-28 Thread Chen Mingzheng
Hi For :noweb-prefix of noweb feature, now we have "yes" or "no" option. Can we add a new "whitespace" option so that we can: Giving following fragments, #+begin_src elisp :noweb-ref varable-bindings (a 0) (b 1) #+end_src #+begin_src elisp :no

Support for whitespace prefix for :noweb-prefix

2024-03-28 Thread Doerthous
Hi Can we add a support for whitespace prefix such that the prefix of a noweb-ref replaced by whitespace characters? Here is a use case, #+begin_src elisp :noweb-ref varable-bindings (a 0) (b 1) #+end_src #+begin_src elisp :noweb-ref do-something `(,a ,b) #+end_src #+name: a-fragment

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 backward

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"), t

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 (&optional regexp) > +(defun org-babel-noweb-wrap (&optional regexp info) >"Return regexp matching a Noweb reference. > > Match any reference, or only

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 explai

Re: noweb-start and noweb-end header args

2024-03-07 Thread Ihor Radchenko
ks to cleanup the code before fontification is long due. >> noweb references is just another manifestation of this problem. > > I think we're talking past each other a little. I'm not talking about > changing the text content of a src block, I'm talking about modifying > the sy

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

Re: noweb-start and noweb-end header args

2024-03-06 Thread Amy Grinn
> src blocks to cleanup the code before fontification is long due. > noweb references is just another manifestation of this problem. I think we're talking past each other a little. I'm not talking about changing the text content of a src block, I'm talking about modifying the

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 soluti

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 use

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 value

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: >> ... >>

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-s

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-s

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_s

Re: [BUG]: contradictory requirements between resolving links and noweb result block

2024-02-05 Thread Ihor Radchenko
gerard.vermeu...@posteo.net writes: > * mwe-noweb-ok > > ... > Resolving the last link fails, because it has an org-id > #+begin_src latex > Listing \ref{noop}, \ref{make-noweb}, and \ref{orgd105392}. > #+end_src > while the caption of the linked listing has a user label

Re: [BUG]: contradictory requirements between resolving links and noweb result block

2024-02-04 Thread gerard . vermeulen
On 02.02.2024 21:12, Ihor Radchenko wrote: gerard.vermeu...@posteo.net writes: I want to have a kind of dynamic RESULTS: noweb block to select what other block to put in the LaTeX preamble on LaTeX export. I can get it working, but in this case links to the RESULTS: noweb block are not

Re: [BUG]: contradictory requirements between resolving links and noweb result block

2024-02-02 Thread Ihor Radchenko
gerard.vermeu...@posteo.net writes: > I want to have a kind of dynamic RESULTS: noweb block to select what > other block to put in the LaTeX preamble on LaTeX export. > I can get it working, but in this case links to the RESULTS: noweb block > are not resolved. I found no way to g

[BUG]: contradictory requirements between resolving links and noweb result block

2024-02-02 Thread gerard . vermeulen
Hi, I want to have a kind of dynamic RESULTS: noweb block to select what other block to put in the LaTeX preamble on LaTeX export. I can get it working, but in this case links to the RESULTS: noweb block are not resolved. I found no way to get the links resolved without breaking Noweb. See my

[FR] Re: language-specific org-babel-noweb-wrap-start?

2023-10-02 Thread Ihor Radchenko
Edgar Lux writes: > I wish you a nice day, week, month... > I would like to know if there is a way to set =org-babel-noweb-wrap-start= > for a specific language. If I set that variable to a value, it will apply to > all of them. Thank you. > ... > What I would like

language-specific org-babel-noweb-wrap-start?

2023-10-02 Thread Edgar Lux
Hi! I wish you a nice day, week, month... I would like to know if there is a way to set =org-babel-noweb-wrap-start= for a specific language. If I set that variable to a value, it will apply to all of them. Thank you. This is fine right now #+begin_src lang1 :noweb yes

Re: [BUG] Unable to detangle code with noweb comments [9.6.1 (9.6.1-??-fe92a3c @ /home/phtrivier/.emacs.d/.local/straight/build-28.1/org/)]

2023-04-24 Thread Ihor Radchenko
Pierre-Henri Trivier writes: > I'm using an org file like this one: > ... >     #+name: main >     #+begin_src rust :tangle main.rs :noweb yes :comments noweb >     <> >     fn main() { >     <> >     <> >     } >     #+end_src &g

[BUG] Unable to detangle code with noweb comments [9.6.1 (9.6.1-??-fe92a3c @ /home/phtrivier/.emacs.d/.local/straight/build-28.1/org/)]

2023-04-24 Thread Pierre-Henri Trivier
input     #+begin_src rust :noweb yes :comments noweb     let args: Vec = env::args().collect();     if args.len() < 2 {     panic!("No argument provided");     }     <>     #+end_src     This uses the `env` package, so we should add it:     #+name: imports     #+begin_src rust :

Re: [BUG] Babel Noweb and python name clashing [9.6.1 (9.6.1-??-fe92a3ced @ /var/home/kwalerie/.emacs.d/.local/straight/build-27.1/org/)]

2023-04-23 Thread Ihor Radchenko
Weaver Marquez writes: > Expected Behaviour: > The two code snippets below have the exact same code, except one has its > Babel name as =savefig=, which is a function name inside its code > block, and the other doesn't. > > ... > ==---== > #+name: doesnt-work Works on my side. Cannot reproduce.

[BUG] Babel Noweb and python name clashing [9.6.1 (9.6.1-??-fe92a3ced @ /var/home/kwalerie/.emacs.d/.local/straight/build-27.1/org/)]

2023-04-22 Thread Weaver Marquez
#x27;{filename}')\nreturn '{filename}'" #+end_src #+name: substitute #+begin_src python :var filename="images/python-matplot-figure.png" return f"plt.savefig('{filename}')\nreturn '{filename}'" #+end_src ==---== #+name: do

Re: [O] Injecting properties with noweb

2023-04-08 Thread Ken Mankoff
IN_SRC emacs-lisp (message prop_message) #+END_SRC #+RESULTS: : hello *** Noweb #+BEGIN_SRC emacs-lisp :noweb yes (message "<>") #+END_SRC #+RESULTS: : hello #+BEGIN_SRC bash :noweb yes :results verbatim echo "<>" #+END_SRC #+RESULTS: : hello If hope this helps s

Re: [O] Injecting properties with noweb

2023-04-08 Thread Ihor Radchenko
eader args or PROPERTIES to change variables. That is, something like: Yes. > ... > #+NAME: get-prop > #+BEGIN_SRC emacs-lisp :var prop="FOO" :noweb yes > (org-macro--get-property prop "") > #+END_SRC > > #+NAME: inject_vars > #+BEGIN_SRC shell :noweb yes

Re: Noweb Function's body without evaluation

2023-04-04 Thread Ihor Radchenko
ash" as one of the commands in src block. Or you can do more crazy staff and call "python" (or, say, "ghci") interpreter. There is no sane way to handle such weird scenarios programmatically. I suggest you to write some kind of wrapper like #+name: obl-identity #+beg

Re: Noweb Function's body without evaluation

2023-04-03 Thread suarezmiguelc
Wow, works!, thank you very much. Now, I have a more specific example. #+name: initSSH #+begin_src shell :var connection=“admin@10.0.3.200" :noweb yes ssh -t miguel@172.28.3.249 "sudo -u admin ssh -t $connection 'sudo su'" #+end_src #+name: getClientInstanceNameNew #

Re: Noweb Function's body without evaluation

2023-04-02 Thread Ihor Radchenko
suarezmigu...@icloud.com writes: > I use heavily org-mode for Literate DevOps, so I have a lot of shell commands > that connect through SSH and do some things later, for example: > > #+name: initSSH > #+begin_src shell :var connection=“admin@somehost" > ssh -t miguel@host "sudo -u someuser ssh -t

Re: Noweb Function's body without evaluation

2023-03-16 Thread suarezmiguelc
_src sh :var name="world" :results output :session testing >> >> echo "hello, $name\!" >> #+end_src I have three options in noweb to use this: - Use its body into another begin_src source code block with <> - Use its result “hello, world!” Into another c

Re: Noweb Function's body without evaluation

2023-03-15 Thread Ken Mankoff
Hi, I'm not sure that I understand your issue or needs from the provided examples, but I wonder if the example I provide here would be helpful. It bypasses :var an lets you inject a PROPERTY value anywhere. It is also language agnostic. You can use it to execute commands (that are set as PROPER

Noweb Function's body without evaluation

2023-03-15 Thread suarezmiguelc
Hello Org-mode community. I’m using Emacs Doom Framework, specifically: Emacs 28.2 (build 1, aarch64-apple-darwin22.3.0, Carbon Version 169 AppKit 2299.4) of 2023-02-23. I use heavily org-mode for Literate DevOps, so I have a lot of shell commands that connect through SSH and do some things l

Re: Multiple noweb-ref

2023-03-03 Thread Ihor Radchenko
Théo Maxime Tyburn writes: >> + is a bit awkward. >> Space would be more logical as separator. >> Though I am wondering if people are using noweb reference names with >> spaces in the wild. > > Might be. So maybe we could use another non-alphabetical character? Wha

Re: Multiple noweb-ref

2023-02-26 Thread Théo Maxime Tyburn
Hi Ihor, >> Anyway I tried to hack my way trough it. It seems there are two things >> to do : >> 1) Enable noweb-ref to contain multiple references. >> 2) Accumulate references when using header-args+ or use tags to set the >> value of noweb-ref >> &

[O] Injecting properties with noweb

2023-02-20 Thread Ken Mankoff
eadings (better yet, header-args, but I don't think that is possible). That's the behavior I'm after, but am having trouble. I thought something like: #+NAME: get-prop #+BEGIN_SRC emacs-lisp :var prop="FOO" :noweb yes (org-macro--get-property prop "") #+EN

Re: Multiple noweb-ref

2023-02-20 Thread Ihor Radchenko
re a way to do this with the current features of org-babel? No, AFAIK. Not easily at least. > Anyway I tried to hack my way trough it. It seems there are two things > to do : > 1) Enable noweb-ref to contain multiple references. > 2) Accumulate references when using header-args+ or use

Multiple noweb-ref

2023-02-10 Thread Théo Maxime Tyburn
Hi, I have several code blocks that I label using `:noweb-ref label`. I set them for all blocks under a subtree by setting the org property `header-args+` of the root of the subtree to `:noweb-ref label`. Now with this approach, I can't accumulate `noweb-ref` like I could do for tags. I

Re: [PATCH] lisp/ob-tangle.el, lisp/ob-core.el: Add strip-tangle noweb option

2022-12-27 Thread Ihor Radchenko
Ihor Radchenko writes: > Also, several small comments about the commit message. For the record, an amended version of this patch have been applied. See https://orgmode.org/list/87leona2r1.fsf@localhost -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at

[FR] Allow noweb references from external files

2022-11-14 Thread Ihor Radchenko
Alexander Dinges writes: > Tangling a noweb src-block which is in another file does not work. See > https://www.reddit.com/r/orgmode/comments/tb9reu/how_to_tangle_a_code_block_containing_noweb_from/ > and > https://stackoverflow.com/questions/47058372/in-org-mode-how-to-call-c

[BUG] org-babel-expand-noweb-references works only with () when using external file [9.5.5 (9.5.5-g8ef620 @ /nix/store/k6fdlc7zjkpcc7pcgv4rzg6z03qcxhd3-emacs-packages-deps/share/emacs/site-lisp/elpa/o

2022-11-13 Thread Alexander Dinges
Tangling a noweb src-block which is in another file does not work. See https://www.reddit.com/r/orgmode/comments/tb9reu/how_to_tangle_a_code_block_containing_noweb_from/ and https://stackoverflow.com/questions/47058372/in-org-mode-how-to-call-code-block-to-evaluate-from-other-org-file/61580716

Re: [PATCH] lisp/ob-tangle.el, lisp/ob-core.el: Add strip-tangle noweb option

2022-11-01 Thread Ihor Radchenko
ot;strip-tangle" is failing on my side. Also, several small comments about the commit message. > * lisp/ob-tangle.el (org-babel-tangle-single-block): strip noweb tags > from block if :noweb has been set to strip-tangle. > * lisp/ob-core.el (org-babel-common-header-args-w-values): ad

Re: [PATCH] lisp/ob-tangle.el, lisp/ob-core.el: Add strip-tangle noweb option

2022-10-30 Thread Timothy
Hi Ihor, > #+name: setup > #+begin_src bash > > cd /path/to/tests > #+end_src > > #+begin_src bash :noweb strip-tangle > > make test1 > #+end_src > > #+begin_src bash :noweb strip-tangle > > make test2 > #+end_src > > Then, one can interactiv

Re: [PATCH] lisp/ob-tangle.el, lisp/ob-core.el: Add strip-tangle noweb option

2022-10-30 Thread Ihor Radchenko
Timothy writes: > Hi Daniel, > >> Add a “strip-tangle” noweb option to strip the noweb tags when tangling, but >> keep and expand them otherwise. > > I must admit I can’t see the point of this — would you mind providing an > example of when this would be useful? #+n

Re: [PATCH] lisp/ob-tangle.el, lisp/ob-core.el: Add strip-tangle noweb option

2022-10-30 Thread Daniel Ziltener
Am 30.10.22 um 05:12 schrieb Ihor Radchenko: Daniel Ziltener writes: From: Daniel Ziltener * lisp/ob-tangle.el (org-babel-tangle-single-block): strip noweb tags from block if :noweb has been set to strip-tangle. * lisp/ob-core.el (org-babel-common-header-args-w-values): add "strip-t

Re: [PATCH] lisp/ob-tangle.el, lisp/ob-core.el: Add strip-tangle noweb option

2022-10-29 Thread Timothy
Hi Daniel, > Add a “strip-tangle” noweb option to strip the noweb tags when tangling, but > keep and expand them otherwise. I must admit I can’t see the point of this — would you mind providing an example of when this would be useful? All the best, Timothy -- Timothy (‘tecosaur’/‘TEC’

Re: [PATCH] lisp/ob-tangle.el, lisp/ob-core.el: Add strip-tangle noweb option

2022-10-29 Thread Ihor Radchenko
Daniel Ziltener writes: > From: Daniel Ziltener > > * lisp/ob-tangle.el (org-babel-tangle-single-block): strip noweb tags > from block if :noweb has been set to strip-tangle. > * lisp/ob-core.el (org-babel-common-header-args-w-values): add > "strip-tangle" as new all

Re: [PATCH] lisp/ob-tangle.el, lisp/ob-core.el: Add strip-tangle noweb option

2022-10-29 Thread Daniel Ziltener
From: Daniel Ziltener * lisp/ob-tangle.el (org-babel-tangle-single-block): strip noweb tags from block if :noweb has been set to strip-tangle. * lisp/ob-core.el (org-babel-common-header-args-w-values): add "strip-tangle" as new allowed value. * testing/lisp/test-ob-tangle.el (ob-ta

Re: [PATCH] lisp/ob-tangle.el, lisp/ob-core.el: Add strip-tangle noweb option

2022-10-28 Thread Ihor Radchenko
Daniel Ziltener writes: >> Could you please follow >> https://orgmode.org/worg/org-contribute.html#commit-messages for the >> commit log entries? > I tried to follow that. To follow it "more" I guess I have to make one > commit per file I changed? There isn't an example for multiple files, so >

Re: [PATCH] lisp/ob-tangle.el, lisp/ob-core.el: Add strip-tangle noweb option

2022-10-28 Thread Daniel Ziltener
Am 28.10.22 um 04:19 schrieb Ihor Radchenko: dzilte...@lyrion.ch writes: From: Daniel Ziltener * ob-tangle.el, ob-core.el, test-ob-tangle.el, org-manual.org: Add a "strip-tangle" noweb option to strip the noweb tags when tangling, but keep and expand them otherwise. Thanks for

Re: [PATCH] lisp/ob-tangle.el, lisp/ob-core.el: Add strip-tangle noweb option

2022-10-27 Thread Ihor Radchenko
dzilte...@lyrion.ch writes: > From: Daniel Ziltener > > * ob-tangle.el, ob-core.el, test-ob-tangle.el, org-manual.org: Add a > "strip-tangle" noweb option to strip the noweb tags when tangling, but > keep and expand them otherwise. Thanks for the patch! If I unde

[PATCH] lisp/ob-tangle.el, lisp/ob-core.el: Add strip-tangle noweb option

2022-10-26 Thread dziltener
From: Daniel Ziltener * ob-tangle.el, ob-core.el, test-ob-tangle.el, org-manual.org: Add a "strip-tangle" noweb option to strip the noweb tags when tangling, but keep and expand them otherwise. --- doc/org-manual.org | 6 ++ lisp/ob-core.el| 6 +++--

Re: Org babel noweb expansion includes extra newline

2022-10-23 Thread Ihor Radchenko
ault.nix > git ls-files " > #+end_example > *** here's what hapepns if we just run =all-tangled-filepaths= > > ... > #+name: files-to-remove-from-git > #+begin_src sh :noweb yes :dir ~/system > git ls-files <> > #+end_src This is because noweb automati

Re: [O] Quoting of noweb references and variable noweb function arguments

2022-10-19 Thread Ihor Radchenko
Cody Goodman writes: > I'm having an issue with quoting noweb functions. Since quote is used to > signify a variable being passed into the noweb syntax function call I > cannot put a quote around theno web function call and end up with invalid > bash. >#+begin_sr

[BUG?] :eval strip-export acts like :eval yes :noweb yes even during export (was: :eval yes use and documentation)

2022-10-07 Thread Ihor Radchenko
n. https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=1966a7a8a8a2934443f24ca9c968a4eba09c3650 I documented ":eval yes". strip-export value is actually used, but I feel that it is completely wrong. `org-babel-common-header-args-w-values' lists "strip-export&q

Re: [O] Plantuml w/ noweb and cached results

2022-09-23 Thread Ken Mankoff
Hi Ihor, Thank you for your reply. I apologize for not doing a more thorough test with '-Q'. I'll try to find the problem in my setup. -k. On 2022-09-22 at 22:02 -04, Ihor Radchenko wrote: > Ken Mankoff writes: > >> #+BEGIN_SRC plantuml :noweb yes :file

  1   2   3   4   5   6   7   >