[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Enhance the use of prefix arguments when filling text

From: Phil Sainty
Subject: [PATCH] Enhance the use of prefix arguments when filling text
Date: Sun, 13 Nov 2016 00:21:08 +1300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0

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

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.


Attachment: 0001-Enhance-use-of-prefix-arguments-when-filling-text.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]