|
From: | Jaakov |
Subject: | bug#13949: 24.4.1; `fill-paragraph' should not always put the buffer as modified |
Date: | Tue, 22 Mar 2016 18:52:14 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 |
I would implement just line splitting along the following idea for text-mode (not in LISP - please excuse me):
FOR EACH line l in the current paragraph REMARK space = whitespace or TAB c := rightmost column of l with space or -1 if none found IF c >= fill-column => 0 THEN REPEAT c' := c c := rightmost column of l|_{[0,c'[} with space or -1 if none found UNTIL c < fill-column IF c<0 THEN split line l at column c' ELSE split line l at column c ENDIF modifies := true END IF END FOROf course, fill-paragraph needs to be much more than line splitting, so don't take my terrible piece of code too seriously, i.e., for anything except the initial idea.
[Prev in Thread] | Current Thread | [Next in Thread] |