eshrh/far.el

Does not work on hidden text

Opened this issue · 1 comments

cesha commented

Thank you for making this project. It is neat!

One case I've noticed where it does not work is with e.g. hidden links in Org. Here fill-paragraph (and org-fill-paragraph) work as expected. If only the first link in the text below is present, far-fill-paragraph fills the paragraph, but wrongly: it considers the full length of the link, instead of only "Far.el" (which is displayed), and which fill-paragraph and org-fill-paragraph do. If the second link is included, far-fill-paragraph fails. (I get an error of the form "Args out of range: [(0 0 0 0) ...], 76".)

[[https://github.com/eshrh/far.el][Far.el]] is an alternative to =fill-paragraph=, which reflows the paragraph greedily. [[https://github.com/eshrh/far.el][Far]] chooses line lengths by minimizing the variance of lines subject to a width constraint.
eshrh commented

I've been aware of the hidden text problem for some time now, and i'm thinking of a way to address it neatly. I'm not sure if it's even possible without adding some shim code just for org mode. I think i will read the fill-paragraph source again to see how they do it there. There are also some other edge cases i know of that fill-paragraph handles that we don't (most annoyingly for me, docstrings in python between """ and """).

As for your error, I can't seem to reproduce it. Copying the text and calling far-fill-paragraph does not give me any errors.