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 is n

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 patch loo

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 (messag

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 th

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 like

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 on li

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 >

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,

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 t

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

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

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
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 syntax table of a majo

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 ca

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 syntax table of a ma

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

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

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

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

[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
    #+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 :noweb

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
name}')\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: doesnt-work #+begin_src python :noweb yes :resu

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
der 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 #+

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 #+begin_src

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

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 anoth

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

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

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
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 "") #+END_SRC #+NAME: inject_var

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 would

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

[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-02 Thread Ihor Radchenko
rip-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): add >

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

[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 automatically

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_src sh

[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"

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 cache-yes.png &

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

2022-09-22 Thread Ihor Radchenko
Ken Mankoff writes: > #+BEGIN_SRC plantuml :noweb yes :file cache-yes.png > @startjson > <> > @endjson > #+END_SRC > > #+RESULTS: > [[file:cache-yes.png]] > > The above graphic is an error message. It states, > > "Your data does not sound like JSON

[O] Plantuml w/ noweb and cached results

2022-09-21 Thread Ken Mankoff
;: "92998-3874", "geo": { "lat": "-37.3159", "lng": "81.1496" } } #+END_SRC #+BEGIN_SRC plantuml :noweb yes :file cache-no.png @startjson <> @endjson #+END_SRC #+RESULTS: [[file:cache-no.png]] The above graphic is genera

Re: [PATCH] Make :var foo=name-of-src-block assign the source block code instead of currently assigned result of evaluation (was: [PATCH] Add :noweb-prefix and :noweb-trans babel header arguments)

2022-08-30 Thread Ihor Radchenko
Sébastien Miquel writes: > I've implemented this proposal in the patch attached. > > Does it look good to you ? Thanks! The patch looks mostly fine. Applied onto main via 72f66ca0b. https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=72f66ca0b9d336e0da61b17cbe8ce183eef364dd A

Re: [PATCH] Make :var foo=name-of-src-block assign the source block code instead of currently assigned result of evaluation (was: [PATCH] Add :noweb-prefix and :noweb-trans babel header arguments)

2022-08-29 Thread Sébastien Miquel
Hi Ihor, I've implemented this proposal in the patch attached. Does it look good to you ? -- Sébastien MiquelFrom b1b783dc80821b07937ac4211ec28df8726fff1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Miquel?= Date: Sat, 13 Aug 2022 20:49:27 +0200 Subject: [PATCH] New babel syntax

Re: [PATCH] org-babel: Do not echo output of resolved noweb references

2022-08-22 Thread Ihor Radchenko
Ihor Radchenko writes: > Currently, every time Org resolves noweb references, the behaviour is > resembling :results silent. That is, the results of evaluation are > displayed, but not inserted after the executed source blocks. > > I propose to change this by usin

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
hs. This resulted in doubly wrapped links. By refactoring all link generation into a single function, this double wrapping is avoided. Example file, /tmp/test.org: * Inner #+name: inner #+begin_src emacs-lisp 2 #+end_src * Main #+header: :tangle test.el :comments

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
file, /tmp/test.org: * Inner #+name: inner #+begin_src emacs-lisp 2 #+end_src * Main #+header: :tangle test.el :comments noweb :noweb yes #+begin_src emacs-lisp 1 <> #+end_src Before: ;; [[file:test.org::*Main][Main:1]]

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
This resulted in doubly wrapped links. By refactoring all link generation into a single function, this double wrapping is avoided. Example file, /tmp/test.org: * Inner #+name: inner #+begin_src emacs-lisp 2 #+end_src * Main #+header: :tangle test.el :comments noweb :now

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

2022-07-29 Thread Ihor Radchenko
e org file. This linking was implemented > twice, to handle separate cases, but when using ‘:comments noweb’ it > ended up going through both codepaths. This resulted in doubly wrapped > links. Please use double space " " between sentences. See https://orgmode.org/worg/org-contribute.html#

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

2022-07-28 Thread Hraban Luyat
was implemented twice, to handle separate cases, but when using ‘:comments noweb’ it ended up going through both codepaths. This resulted in doubly wrapped links. By refactoring all link generation into a single function, this double wrapping is avoided. Example file, /tmp/test.org: * Inner

  1   2   3   4   5   6   7   >