untypeable key combination

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
21 messages Options
12
Reply | Threaded
Open this post in threaded view
|

untypeable key combination

Nicolai Hess
We have a class KMUntypeableSingleKeyCombination
this is used for key kombinations with
tab
arrow
backspace ....

This is useful for printing key kombinations like
Ctrl+TAB

"space" does not use the KMUntypeableSingleKeyCombination class, therefore
a short cut like
Character space shift asKeyCombination
looks like
" Shift +  "

shouldn't space use this class?
And I find the name a little bit misleading, what is a untypeable key?
The key is typeable, otherwise we couldn't use it.
Renaming the class to KMUnprintableSingleKeyCombination
isn't better, because we can print this keycombination.


nicolai

Reply | Threaded
Open this post in threaded view
|

Re: untypeable key combination

stepharo

Le 7/12/14 12:21, Nicolai Hess a écrit :

> We have a class KMUntypeableSingleKeyCombination
> this is used for key kombinations with
> tab
> arrow
> backspace ....
>
> This is useful for printing key kombinations like
> Ctrl+TAB
>
> "space" does not use the KMUntypeableSingleKeyCombination class, therefore
> a short cut like
> Character space shift asKeyCombination
> looks like
> " Shift +  "
>
> shouldn't space use this class?
> And I find the name a little bit misleading, what is a untypeable key?
> The key is typeable, otherwise we couldn't use it.
> Renaming the class to KMUnprintableSingleKeyCombination
> isn't better, because we can print this keycombination.
>

+1
>
> nicolai
>


Reply | Threaded
Open this post in threaded view
|

Re: untypeable key combination

Guillermo Polito
I think (I just think because I didn't write that class ^^) that class is the result of an unfinished refactor...

On Mon, Dec 8, 2014 at 2:36 PM, stepharo <[hidden email]> wrote:

Le 7/12/14 12:21, Nicolai Hess a écrit :

We have a class KMUntypeableSingleKeyCombination
this is used for key kombinations with
tab
arrow
backspace ....

This is useful for printing key kombinations like
Ctrl+TAB

"space" does not use the KMUntypeableSingleKeyCombination class, therefore
a short cut like
Character space shift asKeyCombination
looks like
" Shift +  "

shouldn't space use this class?
And I find the name a little bit misleading, what is a untypeable key?
The key is typeable, otherwise we couldn't use it.
Renaming the class to KMUnprintableSingleKeyCombination
isn't better, because we can print this keycombination.


+1

nicolai




Reply | Threaded
Open this post in threaded view
|

Re: untypeable key combination

Nicolai Hess
Fogbugz issue 14936
and slice in inbox

After loading this slice, there are still many references to the (now) obsolete class KMUntypeableSingleKeyCombination.
I tried to remove these references with the following code :

NECPreferences popupShowWithShortcut: nil.
KMSingleKeyCombination reset.
KMSpecialCharSingleKeyCombination reset.
KMRepository reset.


But they arent removed.

Anyone knows how to re-init all users of KMUntypeableSingleKeyCombination ?


nicolai






2014-12-08 15:05 GMT+01:00 Guillermo Polito <[hidden email]>:
I think (I just think because I didn't write that class ^^) that class is the result of an unfinished refactor...

On Mon, Dec 8, 2014 at 2:36 PM, stepharo <[hidden email]> wrote:

Le 7/12/14 12:21, Nicolai Hess a écrit :

We have a class KMUntypeableSingleKeyCombination
this is used for key kombinations with
tab
arrow
backspace ....

This is useful for printing key kombinations like
Ctrl+TAB

"space" does not use the KMUntypeableSingleKeyCombination class, therefore
a short cut like
Character space shift asKeyCombination
looks like
" Shift +  "

shouldn't space use this class?
And I find the name a little bit misleading, what is a untypeable key?
The key is typeable, otherwise we couldn't use it.
Renaming the class to KMUnprintableSingleKeyCombination
isn't better, because we can print this keycombination.


+1

nicolai





Reply | Threaded
Open this post in threaded view
|

Re: untypeable key combination

Marcus Denker-4

> On 19 Feb 2015, at 10:19, Nicolai Hess <[hidden email]> wrote:
>
> Fogbugz issue 14936
> and slice in inbox
>
> After loading this slice, there are still many references to the (now) obsolete class KMUntypeableSingleKeyCombination.
> I tried to remove these references with the following code :
>
> NECPreferences popupShowWithShortcut: nil.
> KMSingleKeyCombination reset.
> KMSpecialCharSingleKeyCombination reset.
> KMRepository reset.
>
>
> But they arent removed.
>
> Anyone knows how to re-init all users of KMUntypeableSingleKeyCombination ?
>
>

Very strange… using “explore pointers” with the old inspector, it shows lots of instances… I sadly have no
time to now look deeper, but the pointer explorer should be a way to find who holds onto them…

        Marcus




Reply | Threaded
Open this post in threaded view
|

Re: untypeable key combination

Nicolai Hess

We now use a new class for the space-key as key combination. fixed and included in 50045 (https://pharo.fogbugz.com/default.asp?15529)
This way we don't end up with hundreds of obsolete class instances.

But the problem with circular references still exist.
break circular reference for keymappings

I could need some help here, any idea how to work with the key mapping registration without holding (or how to release) strong references?


thanks in advance
nicolai



2015-02-20 9:26 GMT+01:00 Marcus Denker <[hidden email]>:

> On 19 Feb 2015, at 10:19, Nicolai Hess <[hidden email]> wrote:
>
> Fogbugz issue 14936
> and slice in inbox
>
> After loading this slice, there are still many references to the (now) obsolete class KMUntypeableSingleKeyCombination.
> I tried to remove these references with the following code :
>
> NECPreferences popupShowWithShortcut: nil.
> KMSingleKeyCombination reset.
> KMSpecialCharSingleKeyCombination reset.
> KMRepository reset.
>
>
> But they arent removed.
>
> Anyone knows how to re-init all users of KMUntypeableSingleKeyCombination ?
>
>

Very strange… using “explore pointers” with the old inspector, it shows lots of instances… I sadly have no
time to now look deeper, but the pointer explorer should be a way to find who holds onto them…

        Marcus




Reply | Threaded
Open this post in threaded view
|

Re: untypeable key combination

Nicolai Hess


2015-05-15 9:55 GMT+02:00 Nicolai Hess <[hidden email]>:

We now use a new class for the space-key as key combination. fixed and included in 50045 (https://pharo.fogbugz.com/default.asp?15529)
This way we don't end up with hundreds of obsolete class instances.

But the problem with circular references still exist.
break circular reference for keymappings

I could need some help here, any idea how to work with the key mapping registration without holding (or how to release) strong references?


thanks in advance
nicolai


Can anyone help me with this. I need a way to break the circular references.

a class is referenced by its compiled method
the compiled method is referenced by the method context
the method context is reference by a block context (the keymapping action)
the block context is referenced by the registration item
the registration item is referenced by the pragma registration builder
the builder is reference by the method context (it is the method argument) and here the
circle closes.



 


2015-02-20 9:26 GMT+01:00 Marcus Denker <[hidden email]>:

> On 19 Feb 2015, at 10:19, Nicolai Hess <[hidden email]> wrote:
>
> Fogbugz issue 14936
> and slice in inbox
>
> After loading this slice, there are still many references to the (now) obsolete class KMUntypeableSingleKeyCombination.
> I tried to remove these references with the following code :
>
> NECPreferences popupShowWithShortcut: nil.
> KMSingleKeyCombination reset.
> KMSpecialCharSingleKeyCombination reset.
> KMRepository reset.
>
>
> But they arent removed.
>
> Anyone knows how to re-init all users of KMUntypeableSingleKeyCombination ?
>
>

Very strange… using “explore pointers” with the old inspector, it shows lots of instances… I sadly have no
time to now look deeper, but the pointer explorer should be a way to find who holds onto them…

        Marcus





Reply | Threaded
Open this post in threaded view
|

Re: untypeable key combination

Nicolai Hess


2015-05-18 21:28 GMT+02:00 Nicolai Hess <[hidden email]>:


2015-05-15 9:55 GMT+02:00 Nicolai Hess <[hidden email]>:

We now use a new class for the space-key as key combination. fixed and included in 50045 (https://pharo.fogbugz.com/default.asp?15529)
This way we don't end up with hundreds of obsolete class instances.

But the problem with circular references still exist.
break circular reference for keymappings

I could need some help here, any idea how to work with the key mapping registration without holding (or how to release) strong references?


thanks in advance
nicolai


Can anyone help me with this. I need a way to break the circular references.

a class is referenced by its compiled method
the compiled method is referenced by the method context
the method context is reference by a block context (the keymapping action)
the block context is referenced by the registration item
the registration item is referenced by the pragma registration builder
the builder is reference by the method context (it is the method argument) and here the
circle closes.

anyone?
 
Reply | Threaded
Open this post in threaded view
|

Re: untypeable key combination

Eliot Miranda-2
In reply to this post by Nicolai Hess
Hi Nicolai,

On Mon, May 18, 2015 at 12:28 PM, Nicolai Hess <[hidden email]> wrote:


2015-05-15 9:55 GMT+02:00 Nicolai Hess <[hidden email]>:

We now use a new class for the space-key as key combination. fixed and included in 50045 (https://pharo.fogbugz.com/default.asp?15529)
This way we don't end up with hundreds of obsolete class instances.

But the problem with circular references still exist.
break circular reference for keymappings

I could need some help here, any idea how to work with the key mapping registration without holding (or how to release) strong references?


thanks in advance
nicolai


Can anyone help me with this. I need a way to break the circular references.

a class is referenced by its compiled method
the compiled method is referenced by the method context
the method context is reference by a block context (the keymapping action)
the block context is referenced by the registration item
the registration item is referenced by the pragma registration builder
the builder is reference by the method context (it is the method argument) and here the
circle closes.

Are there any dictionaries in the above?  If there are then we can probably use ephemerons to break the circularity.  This will require Spur and Pharo 5 or ^ (which ever is going to be based on Spur; I can't remember which).  This may seem like a ways off but it isn't.

 
2015-02-20 9:26 GMT+01:00 Marcus Denker <[hidden email]>:

> On 19 Feb 2015, at 10:19, Nicolai Hess <[hidden email]> wrote:
>
> Fogbugz issue 14936
> and slice in inbox
>
> After loading this slice, there are still many references to the (now) obsolete class KMUntypeableSingleKeyCombination.
> I tried to remove these references with the following code :
>
> NECPreferences popupShowWithShortcut: nil.
> KMSingleKeyCombination reset.
> KMSpecialCharSingleKeyCombination reset.
> KMRepository reset.
>
>
> But they arent removed.
>
> Anyone knows how to re-init all users of KMUntypeableSingleKeyCombination ?
>
>

Very strange… using “explore pointers” with the old inspector, it shows lots of instances… I sadly have no
time to now look deeper, but the pointer explorer should be a way to find who holds onto them…

        Marcus








--
best,
Eliot
Reply | Threaded
Open this post in threaded view
|

Re: untypeable key combination

stepharo
Definitively ephemerons will help to solve that nicely.
I cannot wait for Spur.

Stef

Le 30/5/15 02:20, Eliot Miranda a écrit :
Hi Nicolai,

On Mon, May 18, 2015 at 12:28 PM, Nicolai Hess <[hidden email]> wrote:


2015-05-15 9:55 GMT+02:00 Nicolai Hess <[hidden email]>:

We now use a new class for the space-key as key combination. fixed and included in 50045 (https://pharo.fogbugz.com/default.asp?15529)
This way we don't end up with hundreds of obsolete class instances.

But the problem with circular references still exist.
break circular reference for keymappings

I could need some help here, any idea how to work with the key mapping registration without holding (or how to release) strong references?


thanks in advance
nicolai


Can anyone help me with this. I need a way to break the circular references.

a class is referenced by its compiled method
the compiled method is referenced by the method context
the method context is reference by a block context (the keymapping action)
the block context is referenced by the registration item
the registration item is referenced by the pragma registration builder
the builder is reference by the method context (it is the method argument) and here the
circle closes.

Are there any dictionaries in the above?  If there are then we can probably use ephemerons to break the circularity.  This will require Spur and Pharo 5 or ^ (which ever is going to be based on Spur; I can't remember which).  This may seem like a ways off but it isn't.

 
2015-02-20 9:26 GMT+01:00 Marcus Denker <[hidden email]>:

> On 19 Feb 2015, at 10:19, Nicolai Hess <[hidden email]> wrote:
>
> Fogbugz issue 14936
> and slice in inbox
>
> After loading this slice, there are still many references to the (now) obsolete class KMUntypeableSingleKeyCombination.
> I tried to remove these references with the following code :
>
> NECPreferences popupShowWithShortcut: nil.
> KMSingleKeyCombination reset.
> KMSpecialCharSingleKeyCombination reset.
> KMRepository reset.
>
>
> But they arent removed.
>
> Anyone knows how to re-init all users of KMUntypeableSingleKeyCombination ?
>
>

Very strange… using “explore pointers” with the old inspector, it shows lots of instances… I sadly have no
time to now look deeper, but the pointer explorer should be a way to find who holds onto them…

        Marcus








--
best,
Eliot

Reply | Threaded
Open this post in threaded view
|

Re: untypeable key combination

stepharo
In reply to this post by Nicolai Hess

Can anyone help me with this. I need a way to break the circular references.

a class is referenced by its compiled method
the compiled method is referenced by the method context
the method context is reference by a block context (the keymapping action)
the block context is referenced by the registration item
the registration item is referenced by the pragma registration builder
the builder is reference by the method context (it is the method argument) and here the
circle closes.

anyone?

We did the same analysis when we were chasing memory leaks in 30.
And this is why we favored when: send: to: instead of when:do:
This is why igor hacked a ephemeron support.
Now the right solution is nearly there: Spur

Reply | Threaded
Open this post in threaded view
|

Re: untypeable key combination

stepharo
In reply to this post by Nicolai Hess
For now could not we use

     when: send: to: instead of a block in key registration?

Stef

Reply | Threaded
Open this post in threaded view
|

Re: untypeable key combination

Nicolai Hess
In reply to this post by Eliot Miranda-2


2015-05-30 2:20 GMT+02:00 Eliot Miranda <[hidden email]>:
Hi Nicolai,

On Mon, May 18, 2015 at 12:28 PM, Nicolai Hess <[hidden email]> wrote:


2015-05-15 9:55 GMT+02:00 Nicolai Hess <[hidden email]>:

We now use a new class for the space-key as key combination. fixed and included in 50045 (https://pharo.fogbugz.com/default.asp?15529)
This way we don't end up with hundreds of obsolete class instances.

But the problem with circular references still exist.
break circular reference for keymappings

I could need some help here, any idea how to work with the key mapping registration without holding (or how to release) strong references?


thanks in advance
nicolai


Can anyone help me with this. I need a way to break the circular references.

a class is referenced by its compiled method
the compiled method is referenced by the method context
the method context is reference by a block context (the keymapping action)
the block context is referenced by the registration item
the registration item is referenced by the pragma registration builder
the builder is reference by the method context (it is the method argument) and here the
circle closes.

Are there any dictionaries in the above?  If there are then we can probably use ephemerons to break the circularity.  This will require Spur and Pharo 5 or ^ (which ever is going to be based on Spur; I can't remember which).  This may seem like a ways off but it isn't.

Hi Eliot,

yes, we use an OrderedCollection.
I hoped one of our weak collections can solve this issue. But I don't know exaclty how.

 
 

 
2015-02-20 9:26 GMT+01:00 Marcus Denker <[hidden email]>:

> On 19 Feb 2015, at 10:19, Nicolai Hess <[hidden email]> wrote:
>
> Fogbugz issue 14936
> and slice in inbox
>
> After loading this slice, there are still many references to the (now) obsolete class KMUntypeableSingleKeyCombination.
> I tried to remove these references with the following code :
>
> NECPreferences popupShowWithShortcut: nil.
> KMSingleKeyCombination reset.
> KMSpecialCharSingleKeyCombination reset.
> KMRepository reset.
>
>
> But they arent removed.
>
> Anyone knows how to re-init all users of KMUntypeableSingleKeyCombination ?
>
>

Very strange… using “explore pointers” with the old inspector, it shows lots of instances… I sadly have no
time to now look deeper, but the pointer explorer should be a way to find who holds onto them…

        Marcus








--
best,
Eliot

Reply | Threaded
Open this post in threaded view
|

Re: untypeable key combination

Nicolai Hess
In reply to this post by stepharo


2015-05-30 9:49 GMT+02:00 stepharo <[hidden email]>:
For now could not we use

    when: send: to: instead of a block in key registration?

I will check.

Thank you for your response.

 

Stef

Reply | Threaded
Open this post in threaded view
|

Re: untypeable key combination

Nicolai Hess


2015-05-30 10:53 GMT+02:00 Nicolai Hess <[hidden email]>:


2015-05-30 9:49 GMT+02:00 stepharo <[hidden email]>:
For now could not we use

    when: send: to: instead of a block in key registration?

I will check.

That are many many senders. And I don't fully understand what to change.
For example, a keymapping registration like

    (aBuilder shortcut: #browseIt)
        category: #SmalltalkEditor
        default: PharoShortcuts current browseShortcut
        do: [ :morph | morph browseIt ].

how to define it without the block?

    (aBuilder shortcut: #browseIt)
        category: #SmalltalkEditor
        default: PharoShortcuts current browseShortcut
        send: #browseIt
        to: ?what






 

Thank you for your response.

 

Stef


Reply | Threaded
Open this post in threaded view
|

Re: untypeable key combination

Sean P. DeNigris
Administrator
Nicolai Hess wrote
I don't fully understand what to change.
If Spur will be ready for the next release, why don't we just wait...
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: untypeable key combination

Nicolai Hess


2015-05-30 16:01 GMT+02:00 Sean P. DeNigris <[hidden email]>:
Nicolai Hess wrote
> I don't fully understand what to change.

If Spur will be ready for the next release, why don't we just wait...

I would like to better understand what is the problem and I am sure
there is some kind of software pattern to prevent this
circular reference situation.


 



-----
Cheers,
Sean
--
View this message in context: http://forum.world.st/untypeable-key-combination-tp4794607p4829511.html
Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.


Reply | Threaded
Open this post in threaded view
|

Re: untypeable key combination

Henrik Sperre Johansen

On 30 May 2015, at 5:20 , Nicolai Hess <[hidden email]> wrote:



2015-05-30 16:01 GMT+02:00 Sean P. DeNigris <[hidden email]>:
Nicolai Hess wrote
> I don't fully understand what to change.

If Spur will be ready for the next release, why don't we just wait...

I would like to better understand what is the problem and I am sure
there is some kind of software pattern to prevent this
circular reference situation.

A block usually references its outer context.*
The default subscriber of a block is the object that defines it.
Thus, if added to a Weak SubscriptionDictionary, the value/block (which is held strongly) references the key/subscriber (held weakly), and it never gets garbage collected.

While the big selling point of ephemerons is to get notifications when an object is *about* to be GC'd instead of after it has been GC'd (so instead of the executor being a shadow copy of an object, the executor can be the object itself), they also solves the above by disregarding any references to the key from the value when checking liveliness.

Cheers,
Henry

* The exception being "clean" blocks that do not reference inst vars / temps declared outside the block (which aren't of much use for announcements)
Reply | Threaded
Open this post in threaded view
|

Re: untypeable key combination

Eliot Miranda-2
In reply to this post by Nicolai Hess


On Sat, May 30, 2015 at 8:20 AM, Nicolai Hess <[hidden email]> wrote:


2015-05-30 16:01 GMT+02:00 Sean P. DeNigris <[hidden email]>:
Nicolai Hess wrote
> I don't fully understand what to change.

If Spur will be ready for the next release, why don't we just wait...

I would like to better understand what is the problem and I am sure
there is some kind of software pattern to prevent this
circular reference situation.

Yes, they're called ephemerons.  Read the Wikipedia page and the paper.  They explain things well.  http://en.wikipedia.org/wiki/Ephemeron
 


 



-----
Cheers,
Sean
--
View this message in context: http://forum.world.st/untypeable-key-combination-tp4794607p4829511.html
Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.





--
best,
Eliot
Reply | Threaded
Open this post in threaded view
|

Re: untypeable key combination

Nicolai Hess


2015-06-01 22:06 GMT+02:00 Eliot Miranda <[hidden email]>:


On Sat, May 30, 2015 at 8:20 AM, Nicolai Hess <[hidden email]> wrote:


2015-05-30 16:01 GMT+02:00 Sean P. DeNigris <[hidden email]>:
Nicolai Hess wrote
> I don't fully understand what to change.

If Spur will be ready for the next release, why don't we just wait...

I would like to better understand what is the problem and I am sure
there is some kind of software pattern to prevent this
circular reference situation.

Yes, they're called ephemerons.  Read the Wikipedia page and the paper.  They explain things well.  http://en.wikipedia.org/wiki/Ephemeron

Yes now I understand why ephemerons can solve this issue.
But what I was thinking of is, maybe we don't need this circular reference for our keymapping registry, it looks like some the references only
there because we need this information during building the keymap but not afterwards.


 
 


 



-----
Cheers,
Sean
--
View this message in context: http://forum.world.st/untypeable-key-combination-tp4794607p4829511.html
Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.





--
best,
Eliot

12