Re: [BUG] Cannot tangle src block in capture buffer [9.7.6]

2025-06-08 Thread Ihor Radchenko
Derek Chen-Becker writes: > My copyright assignment has been processed! I've attached the latest > version of my patches, rebased against the current mainline. It's been a > while since I created the patches last time, so if I've made a mistake in > the options please let me know. Thanks! Applie

Re: [BUG] Cannot tangle src block in capture buffer [9.7.6]

2025-05-27 Thread Derek Chen-Becker
Just pinging again that these patches should be ready now. Thanks, Derek On Sun, May 18, 2025 at 7:21 AM Derek Chen-Becker wrote: > My copyright assignment has been processed! I've attached the latest > version of my patches, rebased against the current mainline. It's been a > while since I cr

Re: [BUG] Cannot tangle src block in capture buffer [9.7.6]

2025-05-18 Thread Derek Chen-Becker
My copyright assignment has been processed! I've attached the latest version of my patches, rebased against the current mainline. It's been a while since I created the patches last time, so if I've made a mistake in the options please let me know. Cheers, Derek On Sun, Mar 2, 2025 at 10:49 AM D

Re: [BUG] Cannot tangle src block in capture buffer [9.7.6]

2025-03-02 Thread Derek Chen-Becker
Also, just to point out, once the legal stuff is all complete I'll have free reign to help with anything org-mode related, so I'm looking forward to more contributions soon! On Sun, Mar 2, 2025 at 10:49 AM Derek Chen-Becker wrote: > Yes, sorry. I've submitted my own assignment form and I'm waiti

Re: [BUG] Cannot tangle src block in capture buffer [9.7.6]

2025-03-02 Thread Derek Chen-Becker
Yes, sorry. I've submitted my own assignment form and I'm waiting to get the signed version back from the FSF. My company's legal department is also working with the FSF rep to get the corporate release done. I've been rebasing against HEAD as things have been committed and testing, so hopefully th

Re: [BUG] Cannot tangle src block in capture buffer [9.7.6]

2025-03-02 Thread Ihor Radchenko
Ihor Radchenko writes: >> I submitted my assignment form this week, but I'm not sure how long it >> takes for that to get processed. > > 5 working days in theory, but they may take longer in practice as there > is, AFAIK, a single guy handling all these assignments. > I suggest to wait up to 1 mo

Re: [BUG] Cannot tangle src block in capture buffer [9.7.6]

2025-02-09 Thread Ihor Radchenko
Derek Chen-Becker writes: > I submitted my assignment form this week, but I'm not sure how long it > takes for that to get processed. 5 working days in theory, but they may take longer in practice as there is, AFAIK, a single guy handling all these assignments. I suggest to wait up to 1 month an

Re: [BUG] Cannot tangle src block in capture buffer [9.7.6]

2025-02-02 Thread Derek Chen-Becker
I submitted my assignment form this week, but I'm not sure how long it takes for that to get processed. In the meantime, I'm attaching the latest version of my patches for capture buffer tangling, updated with feedback. If there are any other suggestions or concerns with the patches I can address t

Re: [BUG] Cannot tangle src block in capture buffer [9.7.6]

2025-01-18 Thread Ihor Radchenko
Derek Chen-Becker writes: > I'm still sorting out the copyright assignment, but I have another style > question: It feels like I should move the `should' clauses closer to the > checks so that I get a more concise report when something is wrong: > ... > Is that OK? Yes, it is fine. Also, no need

Re: [BUG] Cannot tangle src block in capture buffer [9.7.6]

2025-01-18 Thread Derek Chen-Becker
I'm still sorting out the copyright assignment, but I have another style question: It feels like I should move the `should' clauses closer to the checks so that I get a more concise report when something is wrong: (ert-deftest test-org-base-buffer-file-name () "Test `org-base-buffer-file-name'.

Re: [BUG] Cannot tangle src block in capture buffer [9.7.6]

2025-01-16 Thread Ihor Radchenko
Derek Chen-Becker writes: >> The latest version of your patch exceeds 20LOC and cannot be accepted >> unless you have FSF copyright assignment. > > Sorry, that was clear in your previous comment. I am working on the > assignment form right now but I expect that to be a solved problem and I > want

Re: [BUG] Cannot tangle src block in capture buffer [9.7.6]

2025-01-16 Thread Derek Chen-Becker
On Wed, Jan 15, 2025 at 10:13 AM Ihor Radchenko wrote: > Looks like I was not clear enough in my last comment. > > The latest version of your patch exceeds 20LOC and cannot be accepted > unless you have FSF copyright assignment. > Sorry, that was clear in your previous comment. I am working on t

Re: [BUG] Cannot tangle src block in capture buffer [9.7.6]

2025-01-15 Thread Ihor Radchenko
Derek Chen-Becker writes: > Before I submit the updated patch, does this look like a better approach? > > In the test for `org-base-buffer-file-name' I changed it to explicitly find > the current buffer file name and use that: > ... Looks like I was not clear enough in my last comment. The late

Re: [BUG] Cannot tangle src block in capture buffer [9.7.6]

2025-01-15 Thread Derek Chen-Becker
Before I submit the updated patch, does this look like a better approach? In the test for `org-base-buffer-file-name' I changed it to explicitly find the current buffer file name and use that: (ert-deftest test-org-base-buffer-file-name () "Test `org-base-buffer-file-name'." (should (or

Re: [BUG] Cannot tangle src block in capture buffer [9.7.6]

2025-01-14 Thread Michael Heerdegen
Ihor Radchenko writes: > > + (if (buffer-base-buffer BUFFER) > > + (buffer-file-name (buffer-base-buffer BUFFER)) > > +(buffer-file-name BUFFER))) > > Nit: Can also use `if-let*' to avoid calling `buffer-base-buffer' twice. Nit^2: or just (buffer-file-name (or (buffer-base-buffer buffe

Re: [BUG] Cannot tangle src block in capture buffer [9.7.6]

2025-01-14 Thread Derek Chen-Becker
Thanks for the comments! This is my first real foray into non-trivial elisp so I really appreciate your patience and help. Let me try and get these addressed. Cheers, derek On Tue, Jan 14, 2025 at 10:54 AM Ihor Radchenko wrote: > Derek Chen-Becker writes: > > > Thanks for the help on this! I'

Re: [BUG] Cannot tangle src block in capture buffer [9.7.6]

2025-01-14 Thread Ihor Radchenko
Derek Chen-Becker writes: > Thanks for the help on this! I've reworked the changes into two patches > (one for the README and one for tangle) and I think I've covered your > concerns. I also added a unit test for the org-base-buffer-file-name > function to cover the miss on provided buffers. Plea

Re: [BUG] Cannot tangle src block in capture buffer [9.7.6]

2025-01-13 Thread Derek Chen-Becker
Thanks for the help on this! I've reworked the changes into two patches (one for the README and one for tangle) and I think I've covered your concerns. I also added a unit test for the org-base-buffer-file-name function to cover the miss on provided buffers. Please let me know if you have any quest

Re: [BUG] Cannot tangle src block in capture buffer [9.7.6]

2025-01-13 Thread Ihor Radchenko
Derek Chen-Becker writes: >> Also, what about other places in the code that use `buffer-file-name'? >> We may want to use the new function there as well. > > Definitely. There are hundreds of places in the code where the same pattern > applies. Per our previous discussion in the thread, though, I

Re: [BUG] Cannot tangle src block in capture buffer [9.7.6]

2025-01-12 Thread Derek Chen-Becker
On Sun, Jan 12, 2025 at 9:43 AM Ihor Radchenko wrote: > What if BUFFER is provided, but that buffer is already a base buffer? > Your function will then return file name for _current buffer_, not BUFFER. > Hmmm, I thought I tested that but I can take a look and fix it. > > Also, what about oth

Re: [BUG] Cannot tangle src block in capture buffer [9.7.6]

2025-01-12 Thread Ihor Radchenko
Derek Chen-Becker writes: > OK, I've attached the patch. It wasn't clear from > https://orgmode.org/worg/org-contribute.html#first-patch whether this > should be sent in the thread or as a new thread. I can start a new one if > needed. Thanks! The same thread is the right place - we want everyth

Re: [BUG] Cannot tangle src block in capture buffer [9.7.6]

2025-01-12 Thread Derek Chen-Becker
OK, I've attached the patch. It wasn't clear from https://orgmode.org/worg/org-contribute.html#first-patch whether this should be sent in the thread or as a new thread. I can start a new one if needed. Thanks, Derek 0001-ob-tangle-Ensure-proper-tangling-within-a-capture-bu.patch Description: Bi

Re: [BUG] Cannot tangle src block in capture buffer [9.7.6]

2025-01-11 Thread Ihor Radchenko
Derek Chen-Becker writes: > The holidays got the better of me and I'm just coming back to this. I've > made the code changes to add the new function for resolving the base name, > but I was thinking about adding a test for it as well. I'm looking at the > examples in test-ob-tangle.el and I think

Re: [BUG] Cannot tangle src block in capture buffer [9.7.6]

2025-01-10 Thread Derek Chen-Becker
The holidays got the better of me and I'm just coming back to this. I've made the code changes to add the new function for resolving the base name, but I was thinking about adding a test for it as well. I'm looking at the examples in test-ob-tangle.el and I think I understand some of it, but is the

Re: [BUG] Cannot tangle src block in capture buffer [9.7.6]

2024-12-24 Thread Ihor Radchenko
Derek Chen-Becker writes: > ... Where would be the best place to put the > `org-base-buffer-file-name` function? org-macs.el -- Ihor Radchenko // yantar92, Org mode maintainer, Learn more about Org mode at . Support Org development at , or

Re: [BUG] Cannot tangle src block in capture buffer [9.7.6]

2024-12-23 Thread Derek Chen-Becker
On Thu, Dec 19, 2024 at 12:16 PM Ihor Radchenko wrote: > > Thanks in advance! > Do note that we still cannot blindly replace every instance of > buffer-file-name with the new function. At least a cursory case-by-case > check is necessary to make sure that logic will not be broken.] Understood,

Re: [BUG] Cannot tangle src block in capture buffer [9.7.6]

2024-12-19 Thread Ihor Radchenko
Derek Chen-Becker writes: > OK, I can start working on the new function and plumb it in. I agree that > "org-base-buffer-file-name" would be better. Thanks in advance! Do note that we still cannot blindly replace every instance of buffer-file-name with the new function. At least a cursory case-b

Re: [BUG] Cannot tangle src block in capture buffer [9.7.6]

2024-12-19 Thread Derek Chen-Becker
OK, I can start working on the new function and plumb it in. I agree that "org-base-buffer-file-name" would be better. For the case you mentioned about an Org buffer not yet associated with a file, that seems like a complication that we can't solve at this level. Do we leave that as a known issue,

Re: [BUG] Cannot tangle src block in capture buffer [9.7.6]

2024-12-16 Thread Ihor Radchenko
Derek Chen-Becker writes: > OK, after some debugging it looks like the primary culprit is the assignment > of source-file from buffer-file-name. A quick > patch seems to fix it, but I can definitely see a pattern here if org > functions are trying to get the filename of the current > buffer (I

Re: [BUG] Cannot tangle src block in capture buffer [9.7.6]

2024-12-15 Thread Derek Chen-Becker
On Mon, Aug 05, 2024 at 02:03:50PM +, Ihor Radchenko wrote: > That's because capture buffer is an indirect buffer and indirect buffers > are technically not associated with any file. > > We should probably fix handling indirect buffers across Org mode. > > Confirmed. > OK, after some debugg

Re: [BUG] Cannot tangle src block in capture buffer [9.7.6]

2024-08-05 Thread Ihor Radchenko
Dilip writes: > You get ~Wrong type argument: stringp, nil~ error when you > =org-babel-tangle= on a source block in capture buffer. > > To reproduce: > > 1. set a template > (setq org-capture-templates > '(("t" "Test" entry (file "/tmp/debug.org") > "* TODO %?\n %i\n %a"))) > > 2. Create a sourc

[BUG] Cannot tangle src block in capture buffer [9.7.6]

2024-07-31 Thread Dilip
You get ~Wrong type argument: stringp, nil~ error when you =org-babel-tangle= on a source block in capture buffer. To reproduce: 1. set a template (setq org-capture-templates '(("t" "Test" entry (file "/tmp/debug.org") "* TODO %?\n %i\n %a"))) 2. Create a source block (C-c C-, s) add :tangle hea