Re: [PATCH] ob-tangle.el: restore :tangle closure nil behavior

2023-08-17 Thread Ihor Radchenko
Tom Gillespie writes: >> My confusion about you patch comes from the fact that >> >> #+begin_src emacs-lisp :tangle (if (= 1 1) "yes") >> 2 >> #+end_src >> >> works just fine on main. > > It appears to work fine on main, but that is because > what is actually happening behind the scenes is that

Re: [PATCH] ob-tangle.el: restore :tangle closure nil behavior

2023-08-16 Thread Tom Gillespie
On Wed, Aug 16, 2023 at 2:09 AM Ihor Radchenko wrote: > > Tom Gillespie writes: > > > Subject: [PATCH] ob-tangle.el: restore :tangle closure evaluation before > > eval > > info > > This patch fixes a bug where header arguments like :tangle (or "no") > > were treated as if they were tangling to

Re: [PATCH] ob-tangle.el: restore :tangle closure nil behavior

2023-08-16 Thread Tom Gillespie
> My confusion about you patch comes from the fact that > > #+begin_src emacs-lisp :tangle (if (= 1 1) "yes") > 2 > #+end_src > > works just fine on main. It appears to work fine on main, but that is because what is actually happening behind the scenes is that in the test (unless (or (string=

Re: [PATCH] ob-tangle.el: restore :tangle closure nil behavior

2023-08-16 Thread Ihor Radchenko
Tom Gillespie writes: >> What do you mean by "restore"? Were it evaluated in the past? >> May you please provide a reproducer? > > Hrm. I think I may have mixed two commit lines. It is the case that > :tangle closures used to work, but you are right, the historical behavior > when tangling

Re: [PATCH] ob-tangle.el: restore :tangle closure nil behavior

2023-08-16 Thread Ihor Radchenko
Tom Gillespie writes: > Subject: [PATCH] ob-tangle.el: restore :tangle closure evaluation before eval > info > This patch fixes a bug where header arguments like :tangle (or "no") > were treated as if they were tangling to a file named "(or \"no\")". > As a result, org-bable would call

Re: [PATCH] ob-tangle.el: restore :tangle closure nil behavior

2023-08-15 Thread Tom Gillespie
Here is a corrected patch that fixes the fact that closures passed to the :tangle header were not being evaluated. Details in the commit message. Best, Tom On Tue, Aug 15, 2023 at 6:41 PM Tom Gillespie wrote: > > After a bit more investigation don't apply this patch because the change > is

Re: [PATCH] ob-tangle.el: restore :tangle closure nil behavior

2023-08-15 Thread Tom Gillespie
After a bit more investigation don't apply this patch because the change is insufficient to correct another issue. Specifically org-babel-tangle-collect-blocks must check for and resolve any closures that are passed to :tangle _before_ testing (string= src-tfile "no"). As it stands blocks that

[PATCH] ob-tangle.el: restore :tangle closure nil behavior

2023-08-15 Thread Tom Gillespie
Hi, Here's a patch to fix the :tangle header behavior when it is passed a closure that returns nil. Best, Tom From f1e15e0634fffed4648aa11628a14e0a68c3b18d Mon Sep 17 00:00:00 2001 From: Tom Gillespie Date: Tue, 15 Aug 2023 13:46:08 -0700 Subject: [PATCH] ob-tangle.el: restore :tangle closure