emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Marco Wahl
Subject: Re: [PATCH] Fix org-comment-line-break-function
Date: Wed, 01 Dec 2021 09:36:47 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

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)
>>        (indent-to-left-margin)
>>     -  (insert-before-markers-and-inherit fill-prefix))
>>     +  (when fill-prefix
>>     +    (insert-before-markers-and-inherit fill-prefix)))
>>  
>> I don't have anything better.  I think this is a good patch.  It makes
>> M-j work again.
>>
>> Possible refinements and improvements can follow.
>>
>> +1 for applying of your patch.
>
> I was finally able to reproduce the error. It depends to some degree on
> the text in the buffer and where the cursor is when you hit M-j. Adding
> some additional text and moving the cursor to different locations
> enabled me to reproduce the error and I now agree it is a bug in
> org-comment-line-break-function.
>
> I don't know if your patch is the right fix or not because I don't
> understand what the purpose of insert-before-marks-and-inherit is - in
> fact, the doc string for that function doesn't even state what the @rest
> args argument is for, so I don't understand why it is passing in
> fill-prefix. For example, is it safe to assume
> insert-before-merks-and-inherit does not need to be called if
> fill-prefix is nil? Why is that function even called with the
> fill-prefix as an argument? 

Thanks for staying critical!

I can't answer your questions.  I agree that we should deepen the
understanding.  Your questions are a start.

Pragmatically I still vote for applying the patch immediately since it
is a step in the right direction AFAICS.


Ciao,
-- 
Marco



reply via email to

[Prev in Thread] Current Thread [Next in Thread]