[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Enhance the use of prefix arguments when filling text
From: |
Stefan Monnier |
Subject: |
Re: [PATCH] Enhance the use of prefix arguments when filling text |
Date: |
Sat, 12 Nov 2016 13:53:12 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) |
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 <address@hidden> 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