I think this is the kind of mixin that belongs in the framework and, if you don't want it, you don't mix it in.<div><br></div><div>The preferences dialog additions could be DrRacket-specific, tho.</div><div><br></div>
<div>Also, option 2 should probably have a button in the dialog that adjusts the preference to one of the two "silent" modes.</div><div><br></div><div>Robby<br><br>On Thursday, April 19, 2012, Eli Barzilay wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">An hour ago, Danny Yoo wrote:<br>
> On Thu, Apr 12, 2012 at 5:26 PM, Robby Findler<br>
> <<a href="javascript:;" onclick="_e(event, 'cvml', 'robby@eecs.northwestern.edu')">robby@eecs.northwestern.edu</a>> wrote:<br>
> > Yes, normalization doesn't deal with those spaces. It does change<br>
> > the text in ways that are unfriendly and I often tell DrRacket<br>
> > "no" when it asks about normalization. I just wanted to put that<br>
> > into the mix for this conversation, since it is a place that has<br>
> > to deal with similar issues.<br>
><br>
> I propose a backtrack my current patch, and instead to do the<br>
> following:<br>
><br>
> ---<br>
><br>
> * Add a set of choices in the editor Preferences pane, with the<br>
> following options:<br>
><br>
> Treatment of Unicode zero-width characters (such as zero-width spaces):<br>
><br>
> 1. Preserve them.<br>
> 2. When introduced, prompt a dialog choice to delete them.<br>
> 3. Automatically delete them.<br>
><br>
> with the default preference to be option 2.<br>
<br>
I see some problems here that need to be addressed.<br>
<br>
The first problem is the definition of "zero-width characters": some<br>
of these are not problematic -- for example, #\u05B0 is something that<br>
gets added to a letter so it doesn't have its own width. OTOH, there<br>
are many other sources of confusion that are not at all related to<br>
width, like #\u0392 which is usually even displayed using the same "B"<br>
character so there's no visual difference.<br>
<br>
The second problem is the thir option offering to just delete them.<br>
Since I view a "proper" solution as something that can deal with all<br>
of these problems, plain deletion is obviously not always the right<br>
solution.<br>
<br>
The third problem is something that I already mentioned: even if both<br>
of the above points are addressed, what if I choose #3 because it<br>
seems like an easy way to avoid such problems, and later I get bitten<br>
when I paste some text with an intention of keeping these things in?<br>
There's no way to avoid it by saying that it's only a few people who<br>
would run into these things -- since these people are exactly the kind<br>
of people who are likely to suffer these results. (IOW, if I deal<br>
with weird texts, I'm likely to get nagged a lot and choose #3, and<br>
I'm also likely to want these things in strings.)<br>
<br>
So I think that this should be revised as follows:<br>
<br>
1. Drop the whole "zero-width", and instead just use something that<br>
indicates "potentially confusing". (I'm surprised that this thread<br>
keeps focusing on just zero-width spaces.)<br>
<br>
2. Change #2 to some form of "normalization". (That's a bad term<br>
since it has a specific sense, but I'm sure that there's some term<br>
somewhere for these kind of changes.)<br>
<br>
3. Remove option #3.<br>
<br>
Alternatively: add a display mode that "spells out" all of the fishy<br>
characters, as done in Emacs when you open a file in literal mode.<br>
<br>
<br>
> * Collect the set of zero-width characters. Zero-width spaces, of<br>
> course, but also see what other Unicode characters exhibit similar<br>
> weird behavior.<br>
<br>
(I completely agree with this -- the list of these things will grow;<br>
only not restricted to zero-width-ness.)<br>
<br>
--<br>
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:<br>
<a href="http://barzilay.org/" target="_blank">http://barzilay.org/</a> Maze is Life!<br>
</blockquote></div>