Re: [PATCH] Fix org-comment-line-break-function

2022-10-04 Thread Ihor Radchenko
Richard Lawrence writes: >> I am attaching an alternative patch to fix the issue using Org element >> parser. Note that I reused your tests. > > FWIW I've tested this patch for a few days and it fixes the issue for > me. I'd be happy if it were merged. Thanks for testing. Applied onto main.

Re: [PATCH] Fix org-comment-line-break-function

2022-09-28 Thread Ihor Radchenko
Kaushal Modi writes: > Hi Nicolas, > > I have added few tests in the updated patch pasted in this email. > I have made the tests for (call-interactive #'default-indent-new-line) > because that the interactive function M-j is bound to by default. > > Can you please review and commit it? The

Re: [PATCH] Fix org-comment-line-break-function

2021-12-11 Thread Nicolas Goaziou
Hello, Kaushal Modi writes: > I have added few tests in the updated patch pasted in this email. > I have made the tests for (call-interactive #'default-indent-new-line) > because that the interactive function M-j is bound to by default. > > Can you please review and commit it? The machine I am

Re: [PATCH] Fix org-comment-line-break-function

2021-12-06 Thread Kaushal Modi
Hi Nicolas, I have added few tests in the updated patch pasted in this email. I have made the tests for (call-interactive #'default-indent-new-line) because that the interactive function M-j is bound to by default. Can you please review and commit it? The machine I am on right now does not allow

Re: [PATCH] Fix org-comment-line-break-function

2021-12-06 Thread Richard Lawrence
Kaushal Modi writes: > On Sat, Dec 4, 2021, 5:25 PM Tim Cross wrote: > >> Given that Nicholas cannot remember the reason for the original function >> and suspects it was meant to be an internal only function, I think this >> patch is probably the best way forward and should be applied. > >

Re: [PATCH] Fix org-comment-line-break-function

2021-12-05 Thread Nicolas Goaziou
Hello, Kaushal Modi writes: > Thanks. Nicolas asked me to add tests for this patch. But I need to look > into how to add tests for behavior of bindings. Need to add tests for M-j > binding behavior when cursor is within a comment or outside. I don't think you need to test the binding. You

Re: [PATCH] Fix org-comment-line-break-function

2021-12-04 Thread Kaushal Modi
On Sat, Dec 4, 2021, 5:25 PM Tim Cross wrote: > > Given that Nicholas cannot remember the reason for the original function > and suspects it was meant to be an internal only function, I think this > patch is probably the best way forward and should be applied. > Thanks. Nicolas asked me to add

Re: [PATCH] Fix org-comment-line-break-function

2021-12-04 Thread Tim Cross
Given that Nicholas cannot remember the reason for the original function and suspects it was meant to be an internal only function, I think this patch is probably the best way forward and should be applied. Kaushal Modi writes: > On Tue, Nov 30, 2021 at 6:29 PM Tim Cross wrote: > > It would

Re: [PATCH] Fix org-comment-line-break-function

2021-12-01 Thread Nicolas Goaziou
Hello, Kaushal Modi writes: > I see that comment-indent-new-line was added to emacs in newcomment.el back > in 2000. So I don't know why org-comment-line-break-function was added. May > be Nicolas can comment more on that. Sorry, I do not remember. As pointed out in the thread, this function

Re: [PATCH] Fix org-comment-line-break-function

2021-12-01 Thread Marco Wahl
Tim and all! >> diff --git a/lisp/org.el b/lisp/org.el >> index 1a1375461..fdeec0d67 100644 >> --- a/lisp/org.el >> +++ b/lisp/org.el >> @@ -19695,7 +19695,8 @@ non-nil." >>(save-excursion (forward-char -1) (delete-horizontal-space)) >>(delete-horizontal-space)

Re: [PATCH] Fix org-comment-line-break-function

2021-12-01 Thread Richard Lawrence
Tim Cross writes: > Well, that is the big question - why was > org-comment-line-break-function added instead of just using the > default comment-indent-new-line? Looking back at commit d58d40f0c864ae3a6d7c66df34769619ad2486c1, I see this comment was added by Nicolas (still in org.el): ;;

Re: [PATCH] Fix org-comment-line-break-function

2021-11-30 Thread Tim Cross
Kaushal Modi writes: > On Tue, Nov 30, 2021 at 6:29 PM Tim Cross wrote: > > It would be good to get Nicholas' input here as I think he wrote the > original function back in 2012. > > Just to see what happens, I tried this: > > M-: (setq-local comment-line-break-function

Re: [PATCH] Fix org-comment-line-break-function

2021-11-30 Thread Kaushal Modi
On Tue, Nov 30, 2021 at 6:29 PM Tim Cross wrote: > > It would be good to get Nicholas' input here as I think he wrote the > original function back in 2012. > Just to see what happens, I tried this: M-: (setq-local comment-line-break-function #'comment-indent-new-line) .. and then M-j started

Re: [PATCH] Fix org-comment-line-break-function

2021-11-30 Thread Kaushal Modi
On Tue, Nov 30, 2021, 6:29 PM Tim Cross wrote: > > Regardless, I think that unless we understand the purpose of > insert-before-markers-and-inherit, we should make the patch such that it > still calls that function. Even if fill-prefix is nil there is > probably a good reason why the markers and

Re: [PATCH] Fix org-comment-line-break-function

2021-11-30 Thread Tim Cross
Kaushal Modi writes: > On Tue, Nov 30, 2021 at 3:20 PM Marco Wahl wrote: > > diff --git a/lisp/org.el b/lisp/org.el > index 1a1375461..fdeec0d67 100644 > --- a/lisp/org.el > +++ b/lisp/org.el > @@ -19695,7 +19695,8 @@ non-nil." > (save-excursion (forward-char

Re: [PATCH] Fix org-comment-line-break-function

2021-11-30 Thread Tim Cross
Marco Wahl writes: > Hi Richard and all, > > [...] > >> Just to be extra, super sure, I built Emacs this afternoon from a >> checkout of the repo, and the error is *still* there, with the same >> cause. In that build, with emacs -Q, I have: >> >> (org-version) >> "9.5" >> >> (emacs-version)

Re: [PATCH] Fix org-comment-line-break-function

2021-11-30 Thread Kaushal Modi
On Tue, Nov 30, 2021 at 3:20 PM Marco Wahl wrote: > > > diff --git a/lisp/org.el b/lisp/org.el > index 1a1375461..fdeec0d67 100644 > --- a/lisp/org.el > +++ b/lisp/org.el > @@ -19695,7 +19695,8 @@ non-nil." >(save-excursion (forward-char -1) (delete-horizontal-space))

Re: [PATCH] Fix org-comment-line-break-function

2021-11-30 Thread Marco Wahl
Hi Richard and all, [...] > Just to be extra, super sure, I built Emacs this afternoon from a > checkout of the repo, and the error is *still* there, with the same > cause. In that build, with emacs -Q, I have: > > (org-version) > "9.5" > > (emacs-version) > "GNU Emacs 29.0.50 (build 1,