jonmacs / jove

Jonathan's Own Version of Emacs : a venerable (1983?), fast, small Emacs clone that was originally written for 2.8BSD on PDP-11. Some of us have been using and contributing to it since 1986.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fill-comment leaves trailing spaces on Paragraph Break Lines ...

caseyleedom opened this issue · comments

Low Priority:

When we perform fill-comment on a multi-paragraph comment, the result leaves trailing spaces on the Paragraph Break Lines: * . I presume that this is because comment-format contains /*%n%! * %c%!%n */ and we're using that for the Paragraph Break Lines. Unfortunately this causes git to complain and the Linux Community to reject patches if these trailing space lines are present.

Interestingly, the fill-comment command doesn't have a problem with multi-paragraph comments which don't have * on the Paragraph Break Lines, so if we could somehow avoid emitting them, the result would be stable. That is, one could issue back-to-back fill-paragraph commands idempotently ...

Casey, does this patch resolve the issue? (Note: I believe the lines I deleted were intended for this case but misfired because the eolp test is false in all situations where there is any text before the %c in comment-format (i.e. trimmed_header has something in it) because after n_indent, curchar is on the first non-blank character of the trimmed_header that was inserted in the line, and if trimmed_header is empty, there is no reason for the DelWtSpace to happen anyway). In my tests, at least, this patch seems to work with that code moved after the Eol call.

patch-fill-comment.txt

Let me try it now ...

Yep. One quick test of it works great. And it's idempotent with my quick test!

Great, seems ok in a bit of my testing too, will commit and tag 4.17.5.2 with this (and a couple of others) shortly

You're going gangbusters @markmoraes!