<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000">
                                        
                                        
                                            
                                        
                                        
                                        Menu filtering is so cool! :-) And convenient.<div><br></div><div>This proposal about #isControlCharacter aims at preventing malformed user input. For example, the user might wonder if a filter does strange things only because the system cannot render certain (wrongly) typed characters.</div><div><br></div><div>An easier solution would be to render "?" or something similar for such characters. Then, the user can recognize the bad input and hit the [backspace] key. This way, we do not constrain ourselves to a specific range of menu labels at all. :-)</div><div><br></div><div>Best,</div><div>Marcel</div><div class="mb_sig"></div>
                                        
                                        <blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
                        <p style="color: #AAAAAA; margin-top: 10px;">Am 03.10.2019 02:34:40 schrieb David T. Lewis <lewis@mail.msen.com>:</p><div style="font-family:Arial,Helvetica,sans-serif">My personal event horizon does not extend beyond seven bits, so
<br>anything that I say about Unicode should not be taken seriously.
<br>However:
<br>
<br>The concept of "isControlCharacter" dates back to the days of data
<br>terminals connected over seven bit serial lines, and to the use of control
<br>characters for various functions not related to printing characters on
<br>the display screen. I do not really understand the reference to
<br>"type-to-filter a menu for things like '...' or ' ' (space)", but 
<br>it does not sound to me like "control character" would be the right
<br>description.
<br>
<br>Wikipedia has http://en.wikipedia.org/wiki/Control_character which
<br>gives good background. It includes a paragraph about Unicode that
<br>says this:
<br>
<br>  In Unicode, "Control-characters" are U+0000—U+001F
<br>  (C0 controls), U+007F (delete), and U+0080—U+009F
<br>  (C1 controls). Their General Category is "Cc". Formatting codes
<br>  are distinct, in General Category "Cf". The Cc control characters
<br>  have no Name in Unicode, but are given labels such as "<control-001a>"
<br>  instead. 
<br>
<br>So it certainly would be possible to define #isControlCharacter
<br>for Unicode characters, but IMHO it seems to drag along some ancient
<br>concepts of serial data communications that are probably not
<br>meaningful inside a Squeak image.
<br>
<br>Another reference is "man 3 isalpha" on Unix/Linux (C89 and Posix).
<br>There are quite a few character testing functions. Most of them
<br>do not exist in Squeak, and I would not be inclined to start adding
<br>any of them without a good reason.
<br>
<br>Dave
<br>
<br>
<br>On Wed, Oct 02, 2019 at 11:05:04PM +0000, Thiede, Christoph wrote:
<br>> Hi,
<br>> 
<br>> 
<br>> any opinions about this proposal? :-)
<br>> 
<br>> 
<br>> Best,
<br>> 
<br>> Christoph
<br>> 
<br>> ________________________________
<br>> Von: Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Thiede, Christoph
<br>> Gesendet: Donnerstag, 5. September 2019 15:06 Uhr
<br>> An: squeak-dev@lists.squeakfoundation.org; packages@lists.squeakfoundation.org
<br>> Betreff: Re: [squeak-dev] The Trunk: Morphic-mt.1514.mcz
<br>> 
<br>> 
<br>> Personally, I sometimes type-to-filter a menu for things like '...' or ' ' (space). Am I the only one who does this? :)
<br>> 
<br>> 
<br>> I still would consider something like Character>>#isControlCharacter useful. How about this?
<br>> 
<br>> 
<br>> Unicode class>>isControlCode: charCode
<br>> ^ (self generalCategoryOf: charCode) <= cs=""><!--=--><br>> 
<br>> Character>>isControlCharacter
<br>> ^ self encodedCharSet isControlCode: self charCode
<br>> 
<br>> Versions for other char sets would have to be added.
<br>> 
<br>> Best,
<br>> Christoph
<br>> ________________________________
<br>> Von: Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von commits@source.squeak.org <commits@source.squeak.org>
<br>> Gesendet: Donnerstag, 5. September 2019 14:36:59
<br>> An: squeak-dev@lists.squeakfoundation.org; packages@lists.squeakfoundation.org
<br>> Betreff: [squeak-dev] The Trunk: Morphic-mt.1514.mcz
<br>> 
<br>> Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
<br>> http://source.squeak.org/trunk/Morphic-mt.1514.mcz
<br>> 
<br>> ==================== Summary ====================
<br>> 
<br>> Name: Morphic-mt.1514
<br>> Author: mt
<br>> Time: 5 September 2019, 2:36:47.777837 pm
<br>> UUID: 49f63b40-72ce-c447-9fb0-9400ea43fab2
<br>> Ancestors: Morphic-mt.1513, Morphic-ct.1501
<br>> 
<br>> Merges Morphic-ct.1500. and 1501.
<br>> 
<br>> Can't we just filter for #isAlphaNumeric? Do we need parentheses etc.? Would be more readable than  ">= 32". I also do not think that #caseOf: helps much in terms of readability. ;-)
<br>> 
<br>> =============== Diff against Morphic-mt.1513 ===============
<br>> 
<br>> Item was changed:
<br>>   ----- Method: MenuMorph>>handleFiltering: (in category 'keystroke helpers') -----
<br>>   handleFiltering: evt
<br>> 
<br>>          | matchString |
<br>>          matchString := self valueOfProperty: #matchString ifAbsentPut: [ String new ].
<br>> +        matchString := true
<br>> +                caseOf: {
<br>> +                        [ evt keyCharacter = Character backspace ] ->
<br>> +                                [ matchString isEmpty
<br>> +                                        ifTrue: [ matchString ]
<br>> +                                        ifFalse: [ matchString allButLast ] ].
<br>> +                        [ evt keyValue >= 32 ] ->
<br>> +                                [ matchString , evt keyCharacter ] }
<br>> +                otherwise: [ matchString ].
<br>> -        matchString := evt keyValue = 8 " Character backspace asciiValue "
<br>> -                ifTrue: [
<br>> -                        matchString isEmpty
<br>> -                                ifTrue: [ matchString ]
<br>> -                                ifFalse: [ matchString allButLast ] ]
<br>> -                ifFalse: [
<br>> -                        matchString copyWith: evt keyCharacter ].
<br>>          self setProperty: #matchString toValue: matchString.
<br>>          self displayFiltered: evt!
<br>> 
<br>> 
<br>
<br>> 
<br>
<br><br></commits@source.squeak.org></squeak-dev-bounces@lists.squeakfoundation.org></squeak-dev-bounces@lists.squeakfoundation.org></control-001a></div></blockquote></div>