From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jaakov Newsgroups: gmane.emacs.bugs 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 Message-ID: <56F1864E.403@ro.ru> References: <56F12360.5030301@ro.ru> <83y49a4hga.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1458669203 16058 80.91.229.3 (22 Mar 2016 17:53:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 22 Mar 2016 17:53:23 +0000 (UTC) Cc: 13949@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Mar 22 18:53:13 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aiQUQ-0002I1-JN for geb-bug-gnu-emacs@m.gmane.org; Tue, 22 Mar 2016 18:53:10 +0100 Original-Received: from localhost ([::1]:38672 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiQUP-0007lE-TT for geb-bug-gnu-emacs@m.gmane.org; Tue, 22 Mar 2016 13:53:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37262) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiQUM-0007l7-Dk for bug-gnu-emacs@gnu.org; Tue, 22 Mar 2016 13:53:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aiQUI-0001SY-9I for bug-gnu-emacs@gnu.org; Tue, 22 Mar 2016 13:53:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34922) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiQUH-0001SU-V0 for bug-gnu-emacs@gnu.org; Tue, 22 Mar 2016 13:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1aiQUH-0004G1-Kw for bug-gnu-emacs@gnu.org; Tue, 22 Mar 2016 13:53:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jaakov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Mar 2016 17:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13949 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13949-submit@debbugs.gnu.org id=B13949.145866913816313 (code B ref 13949); Tue, 22 Mar 2016 17:53:01 +0000 Original-Received: (at 13949) by debbugs.gnu.org; 22 Mar 2016 17:52:18 +0000 Original-Received: from localhost ([127.0.0.1]:60282 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiQTZ-0004F3-S5 for submit@debbugs.gnu.org; Tue, 22 Mar 2016 13:52:17 -0400 Original-Received: from huan1.mail.rambler.ru ([81.19.66.27]:36718) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiQTX-0004Ev-Um for 13949@debbugs.gnu.org; Tue, 22 Mar 2016 13:52:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ro.ru; s=mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:Cc:References:Subject; bh=Y3BAGxBLHf1YYm/Bn60NCvJFT4ozUO1nL9ucJ/nzyoE=; b=lyFIoyJiZ0dky0G9r1nDLv22B3co4SZ3DTr6TYwRZzhbaXsoLn19r1+841X78rTpFKvCTUFqZi6wa/h1sECfZjXMd3SdSyYaj6Umh+laYqRABYuClwRe81uK5GODt2RJaQIlowN3HzoVGj9mjprzEzX/gbpTE8cFGdG56qgzjho=; Original-Received: from [UNAVAILABLE] ([131.159.50.38]:31651) by huan1.mail.rambler.ru with esmtpa (Exim 4.76) (envelope-from ) id 1aiQTW-0005ZH-SC for 13949@debbugs.gnu.org; Tue, 22 Mar 2016 20:52:15 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 In-Reply-To: <83y49a4hga.fsf@gnu.org> X-Rambler-User: j_k_v@ro.ru/131.159.50.38 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:115340 Archived-At: 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.