From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Re: fill-paragraph ill designed Date: Tue, 25 Aug 2015 11:05:37 +0200 Message-ID: <87bndvivq6.fsf@gnu.org> References: <55DC2621.4030905@online.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1440493574 23788 80.91.229.3 (25 Aug 2015 09:06:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 25 Aug 2015 09:06:14 +0000 (UTC) Cc: emacs-devel To: Andreas =?utf-8?Q?R=C3=B6hler?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 25 11:06:06 2015 Return-path: Envelope-to: ged-emacs-devel@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 1ZUAB1-0002Gn-6K for ged-emacs-devel@m.gmane.org; Tue, 25 Aug 2015 11:05:55 +0200 Original-Received: from localhost ([::1]:58814 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUAAz-0007vr-V6 for ged-emacs-devel@m.gmane.org; Tue, 25 Aug 2015 05:05:53 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45568) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUAAq-0007uH-Nc for emacs-devel@gnu.org; Tue, 25 Aug 2015 05:05:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUAAl-00026Y-Ju for emacs-devel@gnu.org; Tue, 25 Aug 2015 05:05:44 -0400 Original-Received: from deliver.uni-koblenz.de ([141.26.64.15]:32848) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUAAl-000260-1A for emacs-devel@gnu.org; Tue, 25 Aug 2015 05:05:39 -0400 Original-Received: from thinkpad-t440p (dhcp185.uni-koblenz.de [141.26.71.185]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by deliver.uni-koblenz.de (Postfix) with ESMTPSA id 0BCFC1A8307; Tue, 25 Aug 2015 11:05:38 +0200 (CEST) Mail-Followup-To: Andreas =?utf-8?Q?R=C3=B6hler?= , emacs-devel In-Reply-To: <55DC2621.4030905@online.de> ("Andreas \=\?utf-8\?Q\?R\=C3\=B6hler\?\= \=\?utf-8\?Q\?\=22's\?\= message of "Tue, 25 Aug 2015 10:24:01 +0200") User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 141.26.64.15 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:189146 Archived-At: Andreas R=C3=B6hler writes: > There are many issues, uncertain/unsound decisions inside this piece > of code. > > Let's start with fill-paragraph-function. > > If fill-paragraph-function is set, it must be assumed a valid function > and be used. That's not what the documentation says: ,----[ C-h f fill-paragraph RET ] | fill-paragraph is an interactive compiled Lisp function in =E2=80=98fill.= el=E2=80=99. |=20 | [...] |=20 | The REGION argument is non-nil if called interactively; in that | case, if Transient Mark mode is enabled and the mark is active, | call =E2=80=98fill-region=E2=80=99 to fill each of the paragraphs in the = active | region, instead of just filling the current paragraph. `---- So if there is an active region, `fill-paragraph' just calls `fill-region', and then the `fill-paragraph-function' is irrelevant. > So it must precede that clause: > > (and region transient-mark-mode mark-active If `fill-paragraph' would call `fill-paragraph-function' also in this case, then there are two options: (1) `fill-paragraph's documentation stays what it is, and then every `fill-paragraph-function' ever going to be defined has to handle the active region case and call `fill-region'. (2) `fill-paragraph' can't specify any special behavior for the case where the region is active. It might just say that it itself behaves differently with an active region when f-p-f is nil. Option (1) is useless, and option (2) is confusing and might lead to inconsistent behavior, e.g., in some modes `M-q' with an active region fills the region (because f-p-f is nil or a function which considers the active region case) and in some other modes it just fills the current paragraph (because f-p-f is set to some function which doesn't consider the active region case). Bye, Tassilo