all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Phil Sainty <psainty@orcon.net.nz>
Cc: emacs-devel@gnu.org
Subject: Re: [PATCH] Enhance the use of prefix arguments when filling text
Date: Sat, 12 Nov 2016 13:55:44 +0200	[thread overview]
Message-ID: <83k2c8di9r.fsf@gnu.org> (raw)
In-Reply-To: <ab2a1be3-c559-4fa2-c5af-7ca4b6af8892@orcon.net.nz> (message from Phil Sainty on Sun, 13 Nov 2016 00:21:08 +1300)

> From: Phil Sainty <psainty@orcon.net.nz>
> 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.



  reply	other threads:[~2016-11-12 11:55 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 [this message]
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
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=83k2c8di9r.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=psainty@orcon.net.nz \
    /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.