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: Wed, 26 Aug 2015 14:40:05 +0200 Message-ID: <87a8temdei.fsf@gnu.org> References: <55DC2621.4030905@online.de> <55DD5D02.9090407@online.de> <87bndule6e.fsf@gnu.org> <55DDAF7D.4000809@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 1440592836 9412 80.91.229.3 (26 Aug 2015 12:40:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 26 Aug 2015 12:40:36 +0000 (UTC) Cc: rms@gnu.org, Stefan Monnier , emacs-devel@gnu.org To: Andreas =?utf-8?Q?R=C3=B6hler?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 26 14:40:27 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 1ZUa0A-0003LT-Uu for ged-emacs-devel@m.gmane.org; Wed, 26 Aug 2015 14:40:27 +0200 Original-Received: from localhost ([::1]:38090 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUa08-0001xF-Mx for ged-emacs-devel@m.gmane.org; Wed, 26 Aug 2015 08:40:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51241) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUZzu-0001vp-E8 for emacs-devel@gnu.org; Wed, 26 Aug 2015 08:40:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUZzr-0003sU-7i for emacs-devel@gnu.org; Wed, 26 Aug 2015 08:40:10 -0400 Original-Received: from deliver.uni-koblenz.de ([141.26.64.15]:34450) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUZzr-0003oT-22; Wed, 26 Aug 2015 08:40:07 -0400 Original-Received: from thinkpad-t440p (dhcp220.uni-koblenz.de [141.26.71.220]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by deliver.uni-koblenz.de (Postfix) with ESMTPSA id 17F601A8371; Wed, 26 Aug 2015 14:40:06 +0200 (CEST) Mail-Followup-To: Andreas =?utf-8?Q?R=C3=B6hler?= , emacs-devel@gnu.org, rms@gnu.org, Stefan Monnier In-Reply-To: <55DDAF7D.4000809@online.de> ("Andreas \=\?utf-8\?Q\?R\=C3\=B6hler\?\= \=\?utf-8\?Q\?\=22's\?\= message of "Wed, 26 Aug 2015 14:22:21 +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:189194 Archived-At: Andreas R=C3=B6hler writes: >>>> There is a lot of ugliness in the way fill-paragraph works, but >>>> developing a replacement that works ok in practice is harder than it >>>> looks. I recall a time that we tried. >>> What would prevent switching the clauses as suggested? >> IMO, it makes completely sense that `fill-paragraph' delegates to >> `fill-region' if the region is active so that not every mode-specific >> `fill-paragraph-function' has to do that on its own. > > Let's assume region is up to or inside a documentation-string in > Python. > > Then fill-region will be called instead of fill-paragraph-function. > > But how should fill-region get access or know about Python docu-string > styles? `fill-region' would utilize `fill-forward-paragraph-function' to move over the paragraphs in that region and call `fill-paragraph-function' on them. Then you as a mode author are free to define what a paragraph in python means and how to properly fill it, e.g., every function definition is a "paragraph", and when filling a paragraph, your `fill-paragraph-function' actually only fills the documentation string of the function. Bye, Tassilo