Kaushal Modi <kaushal.m...@gmail.com> writes:
> On Tue, Nov 30, 2021 at 6:29 PM Tim Cross <theophil...@gmail.com> 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 working perfectly! It worked fine both: in Org > comment lines and out of comment lines. > > 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. > > So would this patch work? > Well, that is the big question - why was org-comment-line-break-function added instead of just using the default comment-indent-new-line? My only thoughts are there must be some subtle difference in org which the default function was not sophisticated enough to work with. Problem is, not knowing what that might be makes it hard to test and verify the real impact of making the change. Until this is determined, I think the only 'safe' approach would be to just advise those who are impacted by the M-j issue to set comment-line-break-function to comment-indent-new-line and then wait to see if someone who has more historical context to comment. If nothing or nobody says anything after a couple of months, then maybe apply your patch.