From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Enhance the use of prefix arguments when filling text Date: Sat, 12 Nov 2016 13:55:44 +0200 Message-ID: <83k2c8di9r.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1478951810 32667 195.159.176.226 (12 Nov 2016 11:56:50 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 12 Nov 2016 11:56:50 +0000 (UTC) Cc: emacs-devel@gnu.org To: Phil Sainty Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 12 12:56:46 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 1c5Wur-0003ac-70 for ged-emacs-devel@m.gmane.org; Sat, 12 Nov 2016 12:56:13 +0100 Original-Received: from localhost ([::1]:57773 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c5Wuu-0001o5-AC for ged-emacs-devel@m.gmane.org; Sat, 12 Nov 2016 06:56:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48635) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c5WuM-0001nw-CR for emacs-devel@gnu.org; Sat, 12 Nov 2016 06:55:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c5WuJ-0000q8-7y for emacs-devel@gnu.org; Sat, 12 Nov 2016 06:55:42 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34668) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c5WuJ-0000q4-4x; Sat, 12 Nov 2016 06:55:39 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3592 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1c5WuI-00050I-5h; Sat, 12 Nov 2016 06:55:38 -0500 In-reply-to: (message from Phil Sainty on Sun, 13 Nov 2016 00:21:08 +1300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:209355 Archived-At: > From: Phil Sainty > Date: Sun, 13 Nov 2016 00:21:08 +1300 > > 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. Thanks. A few comments below. > +(defcustom fill-interactive-prefix-type 'column-and-justify > + "Determines how fill commands interpret a prefix argument. We use a different style when describing user options. Something like How fill commands interpret the prefix argument. > +Under the default `column-and-justify' setting, a plain C-u Please use \\[universal-argument] instead of a literal "C-u", for those who rebind the command. > +are displayed in the echo area. A numeric prefix argument of > +zero does not modify the fill-column, but also causes the current > +value to be displayed. ^^^^ That "also" is redundant and is better removed, IMO. > +The `hybrid' setting behaves like `column-and-justify' with the > +exception of single-digit numeric arguments, which mean JUSTIFY. > +Because fill-columns of less than 10 are unlikely to be useful, > +this setting provides the new features while still enabling the > +use of a numeric prefix argument to mean JUSTIFY for users who > +were used to doing that." So why isn't the default 'hybrid'? It sounds like a more backward-compatible setting to me. > +(defun fill-interactive-justify-arg () > + "Determine the JUSTIFY argument for the current fill command > +based on the interactive `current-prefix-arg', and the user > +option `fill-interactive-prefix-type'. The first line of a doc string should be a complete sentence. You can then augment it by describing the details later in the doc string. The first line should include the main intent of the command, because it's the only one that's displayed by the likes of "M-x apropos". > +Returns either 'full or nil in all cases." ^^^^^ `full' > +(defun fill-interactive-column (col) > + "Return column COL, modified based on the current prefix arg > +and the user option `fill-interactive-prefix-type'. Again, the first line should be a full sentence.