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-paragraph and fill-comment won't wrap a word if it's the last in a paragraph

caseyleedom opened this issue · comments

When you have the right-margin set at, say 76, and you attempt to perform a fill-paragraph on the following:

This is a long sentence which needs to be wrapped since it just fails the limit

nothing happens. The word limit remains past the 76 column. If you add a single word, say foo, and reissue the fill-paragraph command, limit foo will be wrapped to the next line. I remember this as a regression a few years ago when @HughR did his AWESOME work to make fill-paragraph [mostly][1] properly handle fill-comment when there were multiple paragraphs in a comment. Because I loved his new work so much, I've lived with it ever since. But it is worth filing an issue.

[1] "[mostly]" only because fill-comment now results in * between comment paragraphs instead of * and git (and the Linux Community) get very pissy about the trailing space.

Guessing this is the same as #17

Casey, can you try this patch and see if the problem goes away (without undoing all the rest of Hugh's improvements that you describe, which I agree, were such a step forward that I've lived with this bug too.

revfix1.txt

Huh, this is a patch against the file paragraph.c which doesn't exist in my git repository ... Am I completely out of sync?

... your patch looks like matches para.c around line 504?

... okay, I applied your patch to para.c and it does work. It still handles multi-paragraph comments and it now wraps the last word of paragraphs where only the last word needs wrapping. It still adds the * instead of * in the comment paragraph breaks.

Sorry, that file was paragraph.c back in the 4.16 days, I was deep inside a git bisect when I generated that patch!

Ok, that confirms it's a duplicate of #17. If you don't kind, I'll close this in favor of 17 so we can continue in one place?

I don't mind at all.

Should I open a second GitHub issue on the bad inter-paragraph * fill instead of *? I'm guessing that it's because we're using * (space-asterisk-space) as the comment body in comment-format ...