emacs-devel
[Top][All Lists]
Advanced

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

RE: [PATCH] Add smart-space command.


From: Drew Adams
Subject: RE: [PATCH] Add smart-space command.
Date: Tue, 4 Dec 2012 14:55:02 -0800

> 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 via email to

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