From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Enhance the use of prefix arguments when filling text Date: Sat, 12 Nov 2016 13:53:12 -0500 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1478976882 30647 195.159.176.226 (12 Nov 2016 18:54:42 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 12 Nov 2016 18:54:42 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 12 19:54:39 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c5dRP-0004r9-4F for ged-emacs-devel@m.gmane.org; Sat, 12 Nov 2016 19:54:15 +0100 Original-Received: from localhost ([::1]:59321 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c5dRS-0002e4-DA for ged-emacs-devel@m.gmane.org; Sat, 12 Nov 2016 13:54:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44367) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c5dRN-0002dx-0q for emacs-devel@gnu.org; Sat, 12 Nov 2016 13:54:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c5dRJ-0007PE-VW for emacs-devel@gnu.org; Sat, 12 Nov 2016 13:54:13 -0500 Original-Received: from [195.159.176.226] (port=43765 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c5dRJ-0007Nz-OU for emacs-devel@gnu.org; Sat, 12 Nov 2016 13:54:09 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1c5dQv-0001H8-Jk for emacs-devel@gnu.org; Sat, 12 Nov 2016 19:53:45 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 52 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:Qli4dtplYLU6EJ3YAy42ko28xc4= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:209357 Archived-At: FWIW, I rarely need to force a particular one-time fill-column, whereas I'd regularly appreciate being able to force a particular one-time fill prefix. Stefan >>>>> "Phil" == Phil Sainty writes: > This patch enables the use of a numeric prefix argument to select a > one-time `fill-column' value, over-riding the value for that call. > It takes effect before the main fill loop in `fill-region-as-paragraph' > (which is ultimately used by all the other fill commands), by which time > the likes of `emacs-lisp-docstring-fill-column' have already been dealt > with, and won't clobber the prefix value. > A prefix argument of `-' now means "un-fill" (turning multiple lines > into a single long line), by using most-positive-fixnum as the > fill-column for that call. > All fill commands accept a JUSTIFY argument, and at present a prefix > argument of any kind always simply means JUSTIFY is 'full. As that > interactive behaviour is implemented independently by each command, > this patch necessarily changes the interactive argument handling for > each fill command, to prevent them from justifying when we are just > setting a fill column. > With the patch, negative numeric arguments now mean JUSTIFY using the > specified fill column. > In all cases a plain C-u still means (only) JUSTIFY. > A new user option `fill-interactive-prefix-type' determines whether or > not the new behaviour is used. There is a setting to revert to the > original behaviour (where any prefix argument means JUSTIFY), and also > a hybrid setting to combine the old and new behaviours in a practical > manner. > This initial patch addresses only the commands in fill.el itself, but > changes for other fill commands ought to follow a similar pattern. > The patch is also missing documentation changes to the modified commands > and to the info manuals, but I'm sending it as-is for review of the > general idea and implementation. > The patch was rolled against the emacs-25 branch. > -Phil