all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Zachary Kanfer <zkanfer@gmail.com>
Cc: 21501@debbugs.gnu.org
Subject: bug#21501: new Emacs functions for capitalizing text intelligently
Date: Sun, 20 Sep 2015 09:46:42 +0300	[thread overview]
Message-ID: <83eghtpoz1.fsf@gnu.org> (raw)
In-Reply-To: <CAFXT+RMGkYGoLraB9d4k6Jq1sY+t1rzwaAJfpo_1hsL-q6Qu8Q@mail.gmail.com>

> From: Zachary Kanfer <zkanfer@gmail.com>
> Date: Sun, 20 Sep 2015 02:13:39 -0400
> Cc: 21501@debbugs.gnu.org
> 
> Here's a changed patch.

Thanks.  Allow me a couple of minor comments.

> I'm in favor of changing M-u, M-l, and M-c to the new commands; I think it's
> much improved behavior. The only time a user would have to do more work to
> perform a capitalization action is if they've selected a region, but want to
> act only on the next word. I would bet that's rare, and even so, the user only
> has to press C-g before the capitalization. So if we're ok changing default
> commands, I think changing M-u, M-l, and M-c is a win.

For us to be able to bind M-u etc. to these new commands, they need to
support the prefix argument to upcase-word etc.  The way you wrote
these new commands, that feature will be lost.

> +;;; Functions relating to capitalization that Do What I Mean
> +(defun upcase-dwim ()
> +  "Call the upcase command you want (Do What I Mean).
> +If the region is active, call `upcase-region'.  Otherwise call
> +`upcase-word'."

Every doc string should state the effect of the function/variable in
its first line, because some Help commands (like 'apropos') show only
the first line.  The above doc string (and the others in your patch)
don't do that; the effect is only clear if one reads the rest of the
doc string.

I suggest to change the doc strings like this:

  Upcase words in the region, if active; otherwise upcase word at point.
If the region is active, this function calls `upcase-region'.
Otherwise it calls `upcase-word'.





  reply	other threads:[~2015-09-20  6:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-17  4:32 bug#21501: new Emacs functions for capitalizing text intelligently Zachary Kanfer
2015-09-19 20:27 ` Stefan Monnier
2015-09-20  6:13   ` Zachary Kanfer
2015-09-20  6:46     ` Eli Zaretskii [this message]
2015-09-20 18:23   ` Richard Stallman
2015-09-21 18:52     ` Zachary Kanfer
2015-09-26  8:13       ` Eli Zaretskii

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=83eghtpoz1.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=21501@debbugs.gnu.org \
    --cc=zkanfer@gmail.com \
    /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.