what happened to pretty-print?

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

what happened to pretty-print?

Oscar Nierstrasz

The pretty-print function seems to have disappeared.

This is a real nuisance, since copying and pasting code from outside  
to inside an image usually messes it up (on Mac OSX anyway).

Is there a way to reactive pretty printing?  Or is there a way to get  
copy-paste to do the right thing whether they contain linefeeds or  
carriage returns?

- on


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: what happened to pretty-print?

Stéphane Ducasse
If I remember we removed the coloring which was broken.
Alain did we remove the pretty printing too?
Oscar yes the copy and paste should handle correctly the carriage  
return.

Stef

On Jun 8, 2009, at 3:31 PM, Oscar Nierstrasz wrote:

>
> The pretty-print function seems to have disappeared.
>
> This is a real nuisance, since copying and pasting code from outside
> to inside an image usually messes it up (on Mac OSX anyway).
>
> Is there a way to reactive pretty printing?  Or is there a way to get
> copy-paste to do the right thing whether they contain linefeeds or
> carriage returns?
>
> - on
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: what happened to pretty-print?

Alain Plantec-4
Stéphane Ducasse a écrit :
> If I remember we removed the coloring which was broken.
>  
> Alain did we remove the pretty printing too?
>  
no, it works well on my core image:
In a browser, choosing 'pretty print' in the "what to show" button makes
the code pretty printed.
Code is always pretty printed if you check 'BrowseWithPrettyPrinting'
preference.
With pharo, shout-coloring is working.
Is it ok Oscar ?

alain

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: what happened to pretty-print?

Oscar Nierstrasz

Hi Alain,

I have the latest Pharo-dev image.

pharo0.1-10324dev09.06.1

Pretty-print does not work.  Normally I expect to action-click on a  
method and get the option "pretty print (r)".  This is gone now.

Enabling "browseWithPrettyPrint" does not change anything.  Pasting  
copied code is always broken.

I don't know what you mean by the "what to show" button, but if I  
select "view...>PrettyPrint", I get a "MessageNotUnderstood: Compiler  
class>>format:in:notifying:contentsSymbol:" error which seems to come  
from OBCmdMultiView>>togglePrettyPrint.

Bleh.  :-(

Can anyone else verify this?  I am using the Squeak 4.0.1beta1U.app VM  
under Mac OSX 10.5.7.

- on


On Jun 8, 2009, at 16:20, Alain Plantec wrote:

> Stéphane Ducasse a écrit :
>> If I remember we removed the coloring which was broken.
>>
>> Alain did we remove the pretty printing too?
>>
> no, it works well on my core image:
> In a browser, choosing 'pretty print' in the "what to show" button  
> makes
> the code pretty printed.
> Code is always pretty printed if you check 'BrowseWithPrettyPrinting'
> preference.
> With pharo, shout-coloring is working.
> Is it ok Oscar ?
>
> alain
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: what happened to pretty-print?

Alain Plantec-4
Oscar Nierstrasz a écrit :
> I don't know what you mean by the "what to show" button
it is the title of the dialog which is opened when you hit the right
most button of the browser button bar.
> , but if I  
> select "view...>PrettyPrint", I get a "MessageNotUnderstood: Compiler  
> class>>format:in:notifying:contentsSymbol:" error which seems to come  
> from OBCmdMultiView>>togglePrettyPrint.
>
> Bleh.  :-(
>
> Can anyone else verify this?  
I verified and yes, it is broken and this is my fault because
I removed Compiler>>format:in:notifying:contentsSymbol:
which is called by OBCmdMultiView>>togglePrettyPrint.
I've attached a changed set which is fixing it (it reintroduces it as a
deprecated method).
sorry :(
Hope it is ok now.

Cheers
Alain


'From Pharo0.1 of 16 May 2008 [Latest update: #10330] on 8 June 2009 at 9:51:07 pm'!

!Compiler methodsFor: 'public access' stamp: 'alain.plantec 6/8/2009 21:50'!
format: textOrStream in: aClass notifying: aRequestor contentsSymbol: aSymbol
        "Compile a parse tree from the argument, textOrStream.
        Answer a string containing the original code, formatted nicely."  
       
        self deprecated: #colorWhenPrettyPrintingAsBeenRemoved.
        ^ self format: textOrStream in: aClass notifying: aRequestor
! !


!Compiler class methodsFor: 'evaluating' stamp: 'alain.plantec 6/8/2009 21:50'!
format: textOrStream in: aClass notifying: aRequestor contentsSymbol: aSymbol
        ^ self new format: textOrStream in: aClass notifying: aRequestor contentsSymbol: aSymbol
! !


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: what happened to pretty-print?

Stéphane Ducasse
Ok I will integrate it.
Alain dont worry too much we do not do omelette without breaking eggs.
and deprecate is the right pattern here.

Stef

On Jun 8, 2009, at 9:53 PM, Alain Plantec wrote:

> Oscar Nierstrasz a écrit :
>> I don't know what you mean by the "what to show" button
> it is the title of the dialog which is opened when you hit the right  
> most button of the browser button bar.
>> , but if I  select "view...>PrettyPrint", I get a  
>> "MessageNotUnderstood: Compiler  
>> class>>format:in:notifying:contentsSymbol:" error which seems to  
>> come  from OBCmdMultiView>>togglePrettyPrint.
>>
>> Bleh.  :-(
>>
>> Can anyone else verify this?
> I verified and yes, it is broken and this is my fault because
> I removed Compiler>>format:in:notifying:contentsSymbol:
> which is called by OBCmdMultiView>>togglePrettyPrint.
> I've attached a changed set which is fixing it (it reintroduces it  
> as a deprecated method).
> sorry :(
> Hope it is ok now.
>
> Cheers
> Alain
>
> 'From Pharo0.1 of 16 May 2008 [Latest update: #10330] on 8 June 2009  
> at 9:51:07 pm'!
>
> !Compiler methodsFor: 'public access' stamp: 'alain.plantec 6/8/2009  
> 21:50'!
> format: textOrStream in: aClass notifying: aRequestor  
> contentsSymbol: aSymbol
> "Compile a parse tree from the argument, textOrStream.
> Answer a string containing the original code, formatted nicely."
>
> self deprecated: #colorWhenPrettyPrintingAsBeenRemoved.
> ^ self format: textOrStream in: aClass notifying: aRequestor
> ! !
>
>
> !Compiler class methodsFor: 'evaluating' stamp: 'alain.plantec  
> 6/8/2009 21:50'!
> format: textOrStream in: aClass notifying: aRequestor  
> contentsSymbol: aSymbol
> ^ self new format: textOrStream in: aClass notifying: aRequestor  
> contentsSymbol: aSymbol
> ! !
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: what happened to pretty-print?

Stéphane Ducasse
In reply to this post by Oscar Nierstrasz
http://code.google.com/p/pharo/issues/list?thanks=870

oscar can you check the new update and let me know if this is working :)
10331 should fix that ;)


Alain can you check and next time attach a cs or push it into the  
inbox else I have to retype
or fix the bad characters :)


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: what happened to pretty-print?

Oscar Nierstrasz

OK, I updated pharo0.1-10324dev09.06.1 to 10331.  (Or should I update  
pharo-core?)

Pretty-print is still missing when I right-click on the method source  
pane.

View...>Pretty Print now generates the following error:

"Compiler>>format:in:notifying:contentsSymbol: has been deprecated.  
colorWhenPrettyPrintingAsBeenRemoved
Select Proceed to continue, or close this window to cancel the  
operation."

If I select Proceed, it does pretty-print, but I cannot save the  
pretty-printed version!

Pasting code from an external editor is still broken.

- on

On Jun 8, 2009, at 22:36, Stéphane Ducasse wrote:

> http://code.google.com/p/pharo/issues/list?thanks=870
>
> oscar can you check the new update and let me know if this is  
> working :)
> 10331 should fix that ;)
>
>
> Alain can you check and next time attach a cs or push it into the
> inbox else I have to retype
> or fix the bad characters :)
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: what happened to pretty-print?

Alain Plantec-4
Oscar Nierstrasz a écrit :
> OK, I updated pharo0.1-10324dev09.06.1 to 10331.  (Or should I update  
> pharo-core?)
>  
no, it should be ok if you update from pharo0.1-10324dev09.06.1
> Pretty-print is still missing when I right-click on the method source  
> pane.
>  
see my comments below
> View...>Pretty Print now generates the following error:
>
> "Compiler>>format:in:notifying:contentsSymbol: has been deprecated.  
> colorWhenPrettyPrintingAsBeenRemoved
> Select Proceed to continue, or close this window to cancel the  
> operation."
>  
ok, you see this warning because of the deprecation.
you can check off the #showDeprecationWarning preference in order
to avoid that.
> If I select Proceed, it does pretty-print, but I cannot save the  
> pretty-printed version!
>  
I have investigated it a little bit:

With pharo0.1-10292dev09.04.6, we had the pretty print entry in the code
pane menu and it was functional.
With this menu you was able to pretty print and to save your code (so it
was ok for you).
But, even with 9.04.6 version, you was not able to save your pretty
printed code when you choose
'pretty print' from the 'view' button of the top pane.

With pharo0.1-10318dev09.05.4, I can't check the code pane menu because
when I try to open it, it falls into an 'Invalid utf8 input detected' error.
The impossibility to save pretty printed code formated with the help of
the view button is still present.

With pharo0.1-10292dev09.04.6, the pretty print entry of the code pane
menu is not present.
So I guess the lost of the code pane menu pretty print entry results from
some OB refactoring from 09.05.4 to 09.04.6.

and yes, as it was for 9.04.6 and for 09.05.4 versions, you can't save
you pretty printed code when you format it
by the using of the view button. So, except for the deprecation warning,
It seems that the refactoring I made is not responsible for that problem.

I've take a look at the 9.04.6 OB code but I'm completely lost and do
not have enough time for this.
David, do you have an idea of what happen ?

Oscar, for the moment, maybe you can use 9.04.6 pharo version.
> Pasting code from an external editor is still broken.
>  
this annoying problem will certainly be fixed when someone will have
enough time to work on it.
It is already reported as an issue:
http://code.google.com/p/pharo/issues/detail?id=823

Cheers
Alain






_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: what happened to pretty-print?

Alain Plantec-4

> With pharo0.1-10292dev09.04.6,
with pharo0.1-10324dev09.06.1
> the pretty print entry of the code pane
> menu is not present.
> So I guess the lost of the code pane menu pretty print entry results from
> some OB refactoring from 09.05.4 to 09.04.6.
>  
to 09.06.1 of course

> and yes, as it was for 9.04.6 and for 09.05.4 versions, you can't save
> you pretty printed code when you format it
> by the using of the view button. So, except for the deprecation warning,
> It seems that the refactoring I made is not responsible for that problem.
>
> I've take a look at the 9.04.6 OB code but I'm completely lost and do
> not have enough time for this.
> David, do you have an idea of what happen ?
>
> Oscar, for the moment, maybe you can use 9.04.6 pharo version.
>  


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: what happened to pretty-print?

Oscar Nierstrasz
In reply to this post by Alain Plantec-4

I think I prefer to stick with the current pharo image.

I posted this workaround on the issue page:
- copy, paste and accept the ugly code
- View...>PrettyPrint (click Proceed when it complains)
- Copy the pretty-printed code
- Paste it back into the source view and accept
- on

On Jun 9, 2009, at 14:25, Alain Plantec wrote:

> Oscar, for the moment, maybe you can use 9.04.6 pharo version.
>> Pasting code from an external editor is still broken.
>>
> this annoying problem will certainly be fixed when someone will have
> enough time to work on it.
> It is already reported as an issue:
> http://code.google.com/p/pharo/issues/detail?id=823


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project