[squeak-dev] Preferences ignoreStyleIfOnlyBold

Chris Muller asqueaker at gmail.com
Fri Jan 3 16:33:46 UTC 2014


On Fri, Jan 3, 2014 at 3:35 AM, Frank Shearar <frank.shearar at gmail.com> wrote:
> On 31 December 2013 19:54, Colin Putney <colin at wiresong.com> wrote:
>>
>>
>>
>> On Tue, Dec 31, 2013 at 11:48 AM, Chris Muller <asqueaker at gmail.com> wrote:
>>
>>>
>>> Cut-and-pasting _should_ be painful, so you will be encouraged to
>>> write factored code instead.  :)
>>
>>
>> I do write factored code. I just don't like typing it all out by hand.
>>
>>>
>>> But wait!  If you're using Shout, how will you stop the method from
>>> being styled as soon as you type the next character?
>>>
>>> And, if you're not using Shout then "cut" will be cutting plain text
>>> anyway..
>>>
>>> So, unless I'm missing something, this preference seems so useless its
>>> crazy.
>>
>>
>> Yeah, this preference isn't quite right for my purposes. The behaviour I
>> want is that Shout does syntax highlighting for me, but the text is
>> otherwise treated as unstyled. If I cut it, the clipboard has unstyled text,
>> if I paste styled text, the styles are ignored and Shout restyles it
>> according to syntax. Unstyled text gets stored in the changes file and
>> Monticello.
>>
>> The problem I have now is that if I cut Shout-styled text and paste it into
>> a browser, I get a dialog asking me if I want styled text. The answer is
>> always no, so I'd rather not be asked about it every time.
>
> For what it's worth, things still seem to work just fine if you rip
> out #askIfAddStyle:req: and adjust ClassDescription >>
> logMethodSource:forMethodWithNode:inCategory:withStamp:notifying:
> accordingly. That might not mean particularly much. At any rate,
> logging here means storing in the changes file. What the implications
> styling (or the lack thereof) _of methods_ has for the changes file I
> do not know. Since Shout styles code, I don't see what the problem
> would be with simply removing all styling of all source on its way to
> the changes file (so in the ClassDescription method above).
> (Obviously, class comments are different, and we should preserve
> styling here. But that's a different code path.)
>
> In other words, why can't we replace
>
> newText := (requestor notNil and: [Preferences confirmFirstUseOfStyle])
>     ifTrue: [aText askIfAddStyle: priorMethodOrNil req: requestor]
>     ifFalse: [aText].
>
> with aText asString?

+1.  I agree with your reasoning -- there's no obviously good reason
to store styled Text in the changes file.

If you make this change, please "garbage collect"
confirmFirstUseOfStyle from Preferences too, so it's not dangling out
there unreferenced and useless.


More information about the Squeak-dev mailing list