[racket-dev] pr 12683 and using something like text:nbsp->space?

From: Danny Yoo (dyoo at cs.wpi.edu)
Date: Thu Apr 12 15:47:30 EDT 2012

On Thu, Apr 12, 2012 at 3:26 PM, Eli Barzilay <eli at barzilay.org> wrote:
> A few minutes ago, Danny Yoo wrote:
>> I want the behavior of the auto-translator to notify the text has
>> changed, so that if the user opens a file in DrRacket with the zero
>> width space, they can Save the file:
> So, this happens on any editing?  What if I want to have those
> strings?

Let me think of some example use cases, just to make sure the
scenarios are sensical.

    1.  Copying and pasting program source into a buffer, where the
clipboard has zero-width space.

    2.  Loading an existing file whose content contains zero-width spaces.

    3.  Manually typing in a zero-width space (is this even possible?!).

In all three scenarios, I can see that it's possible the user really
does want to leave zero-width characters unmolested.

Possible actions for remediation:

    1. Quietly and automatically translate the characters.

    2. Bring up a dialog with the user asking whether the character
should be translated or not.

    3. Status quo: don't do anything.

Maybe make these editor preference options?

Is there another action or use case that I'm missing?  I like #1 from
a beginner's perspective: if I'm a beginner and have no clue what a
zero width space is, why shouldn't DrRacket just fix it for me?  From
a power-user's perspective, I can see the argument for either #2 or
#3.    But I'm already content with the notion that DrRacket is
already going some text normalization, such as the DOS newline stuff
from a month or so ago, so #1 doesn't bother me so much from a
power-users perspective either.

Posted on the dev mailing list.