unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Michal Nazarewicz'" <mpn@google.com>, <emacs-devel@gnu.org>
Subject: RE: [PATCH] Add smart-space command.
Date: Tue, 4 Dec 2012 14:55:02 -0800	[thread overview]
Message-ID: <024ECA6D33B34D2CB69DC70F5B64B6A3@us.oracle.com> (raw)
In-Reply-To: <xa1tobi930o1.fsf@mina86.com>

> The patch below adds a smart-space command which is sort of
> a generalised just-one-space.  The main difference is that it behaves
> differently depending on how many times it has been called, and cycles
> between three states:
> 
> 1. just one space
> 2. no space at all
> 3. original spacing

I have nothing special to say about the command, and I haven't tried it or
looked at the code.  But from the description I would suggest perhaps renaming
it to suggest more of what it does: `cycle-spacing' or some such.

Personally, I dislike "smart" names - they often say nothing about what the
function does.  They tend to suggest only "this command is an improvement over
the command I'm replacing it by".

At best, they sometimes suggest that the command does something different
depending on the context (aka context-sensitive, ~aka DWIM).

In this case, the command does not seem to be deciding its behavior based on the
textual context.  From your desription, it is the user who controls the behavior
by explicitly repeating the command.  The command is flexible, not smart.

Wrt adding a command that does what you describe: I think it's a good idea.  The
cycling might even include using a hard (nobreak) space.  Or include
`fixup-whitespace'.  Or `delete-horizontal-space'.  The cycling choices could
even be customizable.

Just one opinion.




  reply	other threads:[~2012-12-04 22:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-04 22:36 [PATCH] Add smart-space command Michal Nazarewicz
2012-12-04 22:55 ` Drew Adams [this message]
2012-12-04 23:11   ` Michal Nazarewicz
2012-12-10 14:57 ` [PATCHv2] Add cycle-spacing command Michal Nazarewicz
2013-01-17 11:41   ` [PATCHv3] " Michal Nazarewicz
2013-01-17 13:06     ` Lele Gaifax
2013-01-26 15:26       ` [PATCHv4] " Michal Nazarewicz
2013-01-26 17:14         ` Stephen J. Turnbull

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=024ECA6D33B34D2CB69DC70F5B64B6A3@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=mpn@google.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).