GNU bug report logs - #13949
24.3.50; `fill-paragraph' should not always put the buffer as modified

Previous Next

Package: emacs;

Reported by: Dani Moncayo <dmoncayo <at> gmail.com>

Date: Wed, 13 Mar 2013 22:11:01 UTC

Severity: wishlist

Tags: fixed

Merged with 21155

Found in versions 24.3.50, 24.4.1, 25.0.50

Fixed in version 26.1

Done: Lars Magne Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #81 received at 13949 <at> debbugs.gnu.org (full text, mbox):

From: Jaakov <j_k_v <at> ro.ru>
Cc: 13949 <at> debbugs.gnu.org
Subject: Re: bug#13949: 24.4.1; `fill-paragraph' should not always put the
 buffer as modified
Date: Tue, 22 Mar 2016 18:52:14 +0100
Another implementation to fill paragraph in text mode could have as well 
scanned through the text linewise as suggested by Stefan Monnier.

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 FOR

Of 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.




This bug report was last modified 8 years and 166 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.