Keymapping - Class vs. Instance Targets

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

Keymapping - Class vs. Instance Targets

Sean P. DeNigris
Administrator
I've run into a lot of trouble implementing the vim bindings because morph instances don't make local copies of the class's maps, so there's no way to override class defaults in an instance. For example, for a particular instance, I can't detach a category that is attached to the class without detaching it from all instances, which I think will not work anyway because existing instances don't pick up those changes.

Sean
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Keymapping - Class vs. Instance Targets

Stéphane Ducasse
may be we should get
        an instance variable plus a class variable
        by default the instance variable points to the class var
        and all the method use only the instance var
=> we can have sharing via the class var and instance based specific customization because there is the instance var
and the user can copy the class var contents and modify it.

Stef

On Jul 13, 2012, at 5:10 PM, Sean P. DeNigris wrote:

> I've run into a lot of trouble implementing the vim bindings because morph
> instances don't make local copies of the class's maps, so there's no way to
> override class defaults in an instance. For example, for a particular
> instance, I can't detach a category that is attached to the class without
> detaching it from all instances, which I think will not work anyway because
> existing instances don't pick up those changes.
>
> Sean
>
> --
> View this message in context: http://forum.world.st/Keymapping-Class-vs-Instance-Targets-tp4639863.html
> Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
>


Reply | Threaded
Open this post in threaded view
|

Re: Keymapping - Class vs. Instance Targets

Tudor Girba-2
+1

On Fri, Jul 13, 2012 at 9:35 PM, Stéphane Ducasse
<[hidden email]> wrote:

> may be we should get
>         an instance variable plus a class variable
>         by default the instance variable points to the class var
>         and all the method use only the instance var
> => we can have sharing via the class var and instance based specific customization because there is the instance var
> and the user can copy the class var contents and modify it.
>
> Stef
>
> On Jul 13, 2012, at 5:10 PM, Sean P. DeNigris wrote:
>
>> I've run into a lot of trouble implementing the vim bindings because morph
>> instances don't make local copies of the class's maps, so there's no way to
>> override class defaults in an instance. For example, for a particular
>> instance, I can't detach a category that is attached to the class without
>> detaching it from all instances, which I think will not work anyway because
>> existing instances don't pick up those changes.
>>
>> Sean
>>
>> --
>> View this message in context: http://forum.world.st/Keymapping-Class-vs-Instance-Targets-tp4639863.html
>> Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
>>
>
>



--
www.tudorgirba.com

"Every thing has its own flow"

Reply | Threaded
Open this post in threaded view
|

Re: Keymapping - Class vs. Instance Targets

Guillermo Polito
In reply to this post by Sean P. DeNigris

On Fri, Jul 13, 2012 at 5:10 PM, Sean P. DeNigris <[hidden email]> wrote:
I've run into a lot of trouble implementing the vim bindings because morph
instances don't make local copies of the class's maps, so there's no way to
override class defaults in an instance. For example, for a particular
instance, I can't detach a category that is attached to the class without
detaching it from all instances, which I think will not work anyway because
existing instances don't pick up those changes.

Coming alive again.  In a previous email I told you about three mechanisms to configure shortcuts:

- static shortcuts (per class)
- dynamic category shortcuts ( you build a category and attach it to an instance)
- single shortcuts per instance

The thing is that you can mix the three above, having the three working together.  The lookup mechanism in a morph is:

- first single shortcuts
- second dynamic category shortcuts
- finally static shortcuts

So, you can put a base static configuration and override stuff with dynamic shortcuts.  But to be sincere, I've never tried a complex configuration like that :)

Is that useful for you?

Guille


Sean

--
View this message in context: http://forum.world.st/Keymapping-Class-vs-Instance-Targets-tp4639863.html
Sent from the Pharo Smalltalk mailing list archive at Nabble.com.


Reply | Threaded
Open this post in threaded view
|

Re: Keymapping - Class vs. Instance Targets

Sean P. DeNigris
Administrator
Guillermo Polito wrote
- static shortcuts (per class)
- dynamic category shortcuts ( you build a category and attach it to an
instance)
The thing is that these two conflict. If I add a category to a class in the "static shortcuts" (which I consider to be "default shortcuts" - I think that's more useful), and then I want to remove that category for an instance, I can't.

What I want is: each instance gets its own copy of all its maps. If the morph instance doesn't have any per-instance customizations, this can point to the class defaults to save space (but I think this would be premature optimization). However, as soon as the instance differs at all from the class defaults, it /must/ have it's own local copy of all the maps. I don't want to have to override each shortcut of a category attached to the class. I want to detach the category /for just this instance/.
Cheers,
Sean