Re: [Pharo-users] Pharo 5: Bug in removing key combinations

2015-12-30 Thread Tudor Girba
Hi,

That is why I think the mechanism of categories per morph type is too 
complicated. Instead, I would prefer to only have instance side keybindings 
that can be installed during the instantiation.

Cheers,
Doru


> On Dec 30, 2015, at 1:36 AM, Nicolai Hess  wrote:
> 
> 
> 
> 2015-12-29 14:13 GMT+01:00 Johan Fabry :
> Thanks Nicolai for having a look! I added a bug report and notified you since 
> you seem to be knowledgeable of the key shortcut system.
> 
> In any case, URL to the bug report is 
> https://pharo.fogbugz.com/f/cases/17304/Morph-removeKeyCombination-removes-shortcut-key-globally-instead-of-locally
> 
> 
> I think the problem is that this morph, does not have a direct keymap. If it 
> can not find a direct keymap, it searches
> all keymap categories used by this morph and removes the shortcut for this 
> category, and this category keymap is shared
> by all RubEditingAreas.
> 
> (I don't know if this is a bug, but I would say, the call to 
> #removeKeyCombination: on the morph, should only remove direct keymap 
> entries, not
> those defined for the keymap category).
> 
> If you just want to redefine some shortcuts (like in this example), it isn't 
> necessary to remove the defined (category-shortcuts) but just 
> add the new ones:
> 
> 
> | morph |
> morph := RubScrolledTextMorph new.
> 
> (morph textArea)
> on: $s command do: [42 inspect ];
> on: $s control do: [42 inspect ].
> 
> morph openInWorld.
> 
> 
> 
>  
>> On Dec 29, 2015, at 09:51, Nicolai Hess  wrote:
>> 
>> 
>> 
>> 2015-12-28 19:07 GMT+01:00 Johan Fabry :
>> Hi all,
>> 
>> Miguel and I found a bug in removing key combinations on a morph. Now they 
>> are global, while in Pharo 4 this was not the case.
>> 
>> I was able to reproduce this on Pharo 4 as well, I think the main difference 
>> is that Pharo 5 uses Rubric for "Workspace/Playground" AND the Browser.
>> And in Pharo 4 these Tools use different Morphs.
>> 
>>  
>> Consider the following code:
>> 
>> | morph |
>> morph := RubScrolledTextMorph new.
>> 
>> (morph textArea)
>> removeKeyCombination: $s command;
>> removeKeyCombination: $s control;
>> on: $s command do: [morph flash ];
>> on: $s control do: [morph flash ].
>> 
>> morph openInWorld.
>> 
>> In the morph, cmd-s will cause a flash, as expected. However in other 
>> windows (or browsers and playgrounds least) the original shortcut is lost, 
>> only a s character is added to the text field.
>> 
>> For me, the "morph flash" wasn't working on the RubRricTextMorph, unitil I 
>> opened a Transcript and enabled KeyLog setDebug. Only after this the morph 
>> was actually flashing (or the flashing wasn't visible?).
>>  
>> 
>> I did not see it on fogbugz so I would like to announce it here before I 
>> open a case, in case (heh) I missed it. So the question: is this a known bug?
>> 
>> No, I think this bug is not yet reported.
>>  
>> 
>> 
>> ---> Save our in-boxes! http://emailcharter.org <---
>> 
>> Johan Fabry   -   http://pleiad.cl/~jfabry
>> PLEIAD and RyCh labs  -  Computer Science Department (DCC)  -  University of 
>> Chile
> 
> 
> 
> ---> Save our in-boxes! http://emailcharter.org <---
> 
> Johan Fabry   -   http://pleiad.cl/~jfabry
> PLEIAD and RyCh labs  -  Computer Science Department (DCC)  -  University of 
> Chile
> 
> 

--
www.tudorgirba.com
www.feenk.com

"It's not what we do that matters most, it's how we do it."




Re: [Pharo-users] Pharo 5: Bug in removing key combinations

2015-12-30 Thread Johan Fabry

Great, that solves the problem I was having. Thanks a lot!

> On Dec 29, 2015, at 20:36, Nicolai Hess  wrote:
> 
> If you just want to redefine some shortcuts (like in this example), it isn't 
> necessary to remove the defined (category-shortcuts) but just 
> add the new ones:
> 
> 
> | morph |
> morph := RubScrolledTextMorph new.
> 
> (morph textArea)
> on: $s command do: [42 inspect ];
> on: $s control do: [42 inspect ].
> 
> morph openInWorld.



---> Save our in-boxes! http://emailcharter.org <---

Johan Fabry   -   http://pleiad.cl/~jfabry
PLEIAD and RyCh labs  -  Computer Science Department (DCC)  -  University of 
Chile



Re: [Pharo-users] Determining if a Process is waiting on a Semaphore

2015-12-30 Thread Guillermo Polito
A bit more on that:

Processor activeProcess suspendingList. => nil “An active process has nil as a 
list"
Processor activeProcess isSuspended. => true??


p := [  ] forkAt: 30.
p suspendingList. => “the list where it is waiting ready to run"
p isSuspended. => false?

s := Semaphore new.
p := ([ s wait ] forkAt: 50). 
p suspendingList. => “the semaphore where it is waiting to be unsuspended, 
since a semaphore is a list"
p isSuspended. => false?

It is evident that a suspended process has the list where it is waiting, and 
the active process has nil.
Then, I think the problem is that isSuspended is wrong.

isSuspended
^myList isNil or: [ myList isEmpty ]

When it should be maybe

isSuspended
^myList notNil


Am I wrong?

Then, to actually answer your question, you can check if you are waiting in a 
semaphore or not, you can compare that the suspendingList is = to the 
semaphore. Of course we should also revise the API ^^.

s := Semaphore new.
p := ([ s wait ] forkAt: 50). 
p suspendingList == s

Guille


> On 30 dic 2015, at 5:35 a.m., Ben Coman  wrote:
> 
> Looking at at the primitive comment in...
>  Semaphore>>wait
> "excessSignals>0
>ifTrue: [excessSignals := excessSignals-1]
>ifFalse: [self addLastLink: Processor activeProcess suspend]"
> 
> I expected/hoped the following...
>   Transcript clear.
>   s := Semaphore new.
>   p := [ Transcript crShow: '1'. s wait. Transcript crShow: '2' ] forkAt: 50.
>   Transcript crShow: p isSuspended.
>   s signal.
> 
> would produce
> 1
> true
> 2
> 
> but I get
> 1
> false
> 2
> 
> How do I determine from another thread if a Process is waiting on a
> Semaphore,  or even better, waiting on a particular semaphore?
> 
> cheers -ben
> 




[Pharo-users] Versionner and package dependencies

2015-12-30 Thread Ferlicot D. Cyril
Hi,

I wanted to use versionner to manage some existing configurations but in
one of these configuration there is some dependencies on packages that
have no project.

For example in the baseline there is:

spec package: 'Glamour-EyeSee-Presentations'
with: [ spec requires: #('EyeSee').
spec repository: 
'http://smalltalkhub.com/mc/Moose/Glamour/main' ].

But in versionner I can only add a project as dependency.

Is there a way to do such a thing or is it a future feature of versionner?


-- 
Cyril Ferlicot

http://www.synectique.eu

165 Avenue Bretagne
Lille 59000 France



signature.asc
Description: OpenPGP digital signature