all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Re: [PATCH] Enhance the use of prefix arguments when filling text
Date: Sat, 12 Nov 2016 13:53:12 -0500	[thread overview]
Message-ID: <jwvmvh4edld.fsf-monnier+gmane.emacs.devel@gnu.org> (raw)
In-Reply-To: ab2a1be3-c559-4fa2-c5af-7ca4b6af8892@orcon.net.nz

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 <psainty@orcon.net.nz> 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






  parent reply	other threads:[~2016-11-12 18:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-12 11:21 [PATCH] Enhance the use of prefix arguments when filling text Phil Sainty
2016-11-12 11:55 ` Eli Zaretskii
2016-11-13 10:33   ` Phil Sainty
2016-11-13 15:15     ` Eli Zaretskii
2016-11-14 23:14       ` Noam Postavsky
2016-11-12 17:21 ` Herring, Davis
2016-11-13 10:21   ` Phil Sainty
2016-11-12 18:53 ` Stefan Monnier [this message]
2016-11-13 10:23   ` Phil Sainty
2016-11-14 22:56   ` John Wiegley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvmvh4edld.fsf-monnier+gmane.emacs.devel@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.