Re: [PATCH] function and symbol for headline and olp for org-capture-templates

2024-06-18 Thread Ihor Radchenko
Nafiz Islam writes: > >Why (t nil)? It would be more sensible to throw an error. > > I believe that was already addressed. > + (or final-headline + (error "Invalid headline: %S" headline Right, I was only looking at pcase, which did not appear to be changed. Applied, onto main, after

Re: [PATCH] function and symbol for headline and olp for org-capture-templates

2024-06-18 Thread Nafiz Islam
I've attached the patch with all of the concerns addressed, hopefully. >Why (t nil)? It would be more sensible to throw an error. I believe that was already addressed. + (or final-headline + (error "Invalid headline: %S" headline From 4cf99be212757ad910b8bbf680171434c0e6b06c Mon Sep 17

Re: [PATCH] function and symbol for headline and olp for org-capture-templates

2024-06-16 Thread Ihor Radchenko
Nafiz Islam writes: > I've updated my tests with `org-test-at-time' and updated the commit > message to fit within default column of 70. That does not help, unfortunately. My "0" time is still different from yours. If will be more reliable to use a specific timestamp. See other uses of

Re: [PATCH] function and symbol for headline and olp for org-capture-templates

2024-06-15 Thread Nafiz Islam
I've updated my tests with `org-test-at-time' and updated the commit message to fit within default column of 70. From 25c0252c8532e498e3fce103dd44a81441d8a51a Mon Sep 17 00:00:00 2001 From: Nafiz Islam Date: Tue, 21 May 2024 16:24:26 -0400 Subject: [PATCH] function and symbol for headline and

Re: [PATCH] function and symbol for headline and olp for org-capture-templates

2024-06-09 Thread Ihor Radchenko
Nafiz Islam writes: >> I tried to run make test with your patch, and it is failing: > > On my side it passes on main branch at commit > 6c862699a6db3f6b76391c05380d92d9f1b3838f with patch. > passed 444/1207 test-org-capture/entry (0.099791 sec) > ... > passed 447/1207

Re: [PATCH] function and symbol for headline and olp for org-capture-templates

2024-06-09 Thread Nafiz Islam
I tried to run make test with your patch, and it is failing: On my side it passes on main branch at commit 6c862699a6db3f6b76391c05380d92d9f1b3838f with patch. passed 444/1207 test-org-capture/entry (0.099791 sec) ... passed 447/1207 test-org-capture/org-capture-expand-olp

Re: [PATCH] function and symbol for headline and olp for org-capture-templates

2024-06-05 Thread Bastien Guerry
Ihor Radchenko writes: > Nafiz Islam writes: > >> Craig Topham has cleared me to contribute to Emacs. > > Bastien, may you please check the FSF records? Yes, things are okay. Thanks Nafiz! -- Bastien Guerry

Re: [PATCH] function and symbol for headline and olp for org-capture-templates

2024-06-05 Thread Ihor Radchenko
Nafiz Islam writes: > Craig Topham has cleared me to contribute to Emacs. Bastien, may you please check the FSF records? > > All you need to create a new symbol in local context is (let ((my-symbol > > value)) ...). > > I don't think that will work because of lexical binding. For example: >

Re: [PATCH] function and symbol for headline and olp for org-capture-templates

2024-06-01 Thread Nafiz Islam
Craig Topham has cleared me to contribute to Emacs. I have attached the latest version of my patch. > All you need to create a new symbol in local context is (let ((my-symbol > value)) ...). I don't think that will work because of lexical binding. For example: (should    (equal     "* A\n*

Re: [PATCH] function and symbol for headline and olp for org-capture-templates

2024-05-22 Thread Ihor Radchenko
Nafiz Islam writes: > It's mainly because the tests I have written creates symbols and then > later unbounds them. But, if the test fails then the symbols might not > get unbound. All you need to create a new symbol in local context is (let ((my-symbol value)) ...). -- Ihor Radchenko //

Re: [PATCH] function and symbol for headline and olp for org-capture-templates

2024-05-22 Thread Nafiz Islam
Would it be of org-mode's interest if I update `org-test-with-temp-text-in-file' to include a parameter which is a list of symbols to unbound after the test body is executed? Or maybe another macro called `org-test-with-temp-text-in-file-and-symbols'? It's mainly because the tests I have

Re: [PATCH] function and symbol for headline and olp for org-capture-templates

2024-05-21 Thread Nafiz Islam
> the idea was to pass the FILE and extra OLP arguments to the custom function provided by the user I have misunderstood what you suggested. But, I wanted to maintain consistency with how the `file+headline' handles function as a target where the lambda takes no parameter and is expected to

Re: [PATCH] function and symbol for headline and olp for org-capture-templates

2024-05-20 Thread Nafiz Islam
Sorry. I forgot to actually attach the patch. On Sun, May 19, 2024 at 7:34 PM Nafiz Islam wrote: > > would you consider doing the paperwork? > > Yes. I sent an email to ass...@gnu.org with the form. > > I've also updated the docstring for `org-capture-templates', filtered out > incorrect

Re: [PATCH] function and symbol for headline and olp for org-capture-templates

2024-05-20 Thread Nafiz Islam
> would you consider doing the paperwork? Yes. I sent an email to ass...@gnu.org with the form. I've also updated the docstring for `org-capture-templates', filtered out incorrect target, and updated `org-capture-expand-olp' to take file argument. Additionally, I added a few test cases to

Re: [PATCH] function and symbol for headline and olp for org-capture-templates

2024-05-20 Thread Ihor Radchenko
Nafiz Islam writes: >> I've also updated the docstring for `org-capture-templates', filtered out >> incorrect target, and updated `org-capture-expand-olp' to take file >> argument. I do not think that it does what you expect. AFAIU, the idea was to pass the FILE and extra OLP arguments to the

Re: [PATCH] function and symbol for headline and olp for org-capture-templates

2024-05-17 Thread Ihor Radchenko
Nafiz Islam writes: > This patch adds the option to provide function and symbol for headline and > olp for org-capture-templates. Thanks for the patch. A few comments. Firstly, your total contribution to Org mode with this patch will exceed the maximum allowed number of LOC changes we can

Re: [PATCH] function and symbol for headline and olp for org-capture-templates

2024-05-13 Thread Nafiz Islam
Oh dear, I shouldn't have used `atomic-chrome' to format the message in Gmail. So here's a revised version. Dear All, This patch adds the option to provide function and symbol for headline and olp for org-capture-templates. By that, I mean you can set the org-capture-templates in the following

[PATCH] function and symbol for headline and olp for org-capture-templates

2024-05-13 Thread Nafiz Islam
Dear All, This patch adds the option to provide function and symbol for headline and olp for org-capture-templates. By that, I mean you can set the org-capture-templates in the following manner: (org-capture-templates `(("t" "Todo" entry (file+headline ,file (lambda () "A")) "** H1 %?")))