Text >> unembellished

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

Text >> unembellished

Christoph Thiede

Hi all, I think we have a problem with Text>>#unembellished. By looking at its name, I would have assumed that this method checks whether a text has not any (visible) attributes. But actually, it checks whether the text has no other attributes than the default font and TextEmphasis bold!


I think this is a misleading name. It causes an actual bug when you try to accept a HelpTopic which only contains bold formatting. In this case, the emphasis is not preserved ...


What is the history of #unembellished? I suspect it comes from times where we didn't have shout but only formatted method headers that should not be stored into the methodSource. Am I correct?

The related preference #ignoreStyleIfOnlyBold also only has one sender, #unembellished. I would propose to ignore that preference and deprecate it. Any opinions? :-)


Best,

Christoph



Carpe Squeak!
Reply | Threaded
Open this post in threaded view
|

Re: Text >> unembellished

Tobias Pape

> On 15.11.2019, at 18:40, Thiede, Christoph <[hidden email]> wrote:
>
> Hi all, I think we have a problem with Text>>#unembellished. By looking at its name, I would have assumed that this method checks whether a text has not any (visible) attributes. But actually, it checks whether the text has no other attributes than the default font and TextEmphasis bold!
>
> I think this is a misleading name. It causes an actual bug when you try to accept a HelpTopic which only contains bold formatting. In this case, the emphasis is not preserved ...


>
> What is the history of #unembellished? I suspect it comes from times where we didn't have shout but only formatted method headers that should not be stored into the methodSource. Am I correct?

Yes:
This comes from the fact that before shout, the System Browser used to
make the selector bold in any method it showed. (Text>>makeSelectorBold).

So to detect whether anyone actually added text attributes (like color or links) to a method, and if so, ask the user to say whether they want to keep it (Text>>askIfAddStyle:req:). This is also use for showing code in a FileContentsBrowser (See #extraInfo) and when writing styled text to disk or so (WriteStream>>nextChunkPutWithStyle:)


> The related preference #ignoreStyleIfOnlyBold also only has one sender, #unembellished. I would propose to ignore that preference and deprecate it. Any opinions? :-)

Hmm,  no opinion here other than "don't break all the thingsā€¦" :)

Best regards
        -Tobias