An open API service indexing awesome lists of open source software.

https://github.com/eshrh/far.el

elisp implementation of far, a DP algorithm for paragraph refilling
https://github.com/eshrh/far.el

Last synced: 7 months ago
JSON representation

elisp implementation of far, a DP algorithm for paragraph refilling

Awesome Lists containing this project

README

          

* inflow.el: minimal variance paragraph filling

inflow.el (previously called far.el) is a reimplementation of
[[https://github.com/stephen-huan/inflow][inflow]] (previously called far).

It is an alternative to =fill-paragraph=, which reflows the
paragraph greedily. Inflow chooses line lengths by minimizing
the variance of lines subject to a width constraint.

* Dependencies

There are currently two non built in dependencies but these might go
away in the future if I decide to rewrite some bits more verbosely

+ =s.el=: string utils
+ =dash.el=: list utils

There is a good chance you already have one or two of these
packages installed if you use some common packages like magit.

=cl-lib= is also depended upon, which has been included in emacs since
24.3

* Installation

You could copy =inflow.el= into your load path the manual
way, or you could use a package manager like straight:

#+BEGIN_SRC emacs-lisp
(straight-use-package
'(inflow :type git
:repo "https://github.com/eshrh/inflow.el"))
#+END_SRC

* Usage

The variable =inflow-fill-paragraph-width= can be customized the change
the maximum line width. The default value is 70, which matches the emacs
default for =fill-column=. It may be helpful to write functions on mode
hooks that modify this value so that you can have different line widths
for different programming languages.

inflow.el currently exposes only one function,
=inflow-fill-paragraph= which fills the paragraph at the point.