[squeak-dev] Preferences ignoreStyleIfOnlyBold

Frank Shearar frank.shearar at gmail.com
Fri Jan 3 17:39:56 UTC 2014


On 3 January 2014 17:33, David T. Lewis <lewis at mail.msen.com> wrote:
> On Fri, Jan 03, 2014 at 05:03:56PM +0000, Frank Shearar wrote:
>> On 3 January 2014 16:33, Chris Muller <asqueaker at gmail.com> wrote:
>> > 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.
>
> Does this effect hyperlinks in class comments and methos source?

As far as I can make out it would leave class comments unharmed,
because Compiler sends #logMethodSource:too:long:to:type: only when
saving methods.

My suggestion as it stands right now would nuke hyperlinks in method
source. If we don't want to do that, we could just use "aText" then,
and always save styled code.

frank

> Dave
>
>>
>> OK, so that's you & I in agreement. I think Colin's happy for it to
>> go. Any ol' timers out there with warnings of doom, before I rip this
>> out?
>>
>> > If you make this change, please "garbage collect"
>> > confirmFirstUseOfStyle from Preferences too, so it's not dangling out
>> > there unreferenced and useless.
>>
>> Yep!
>>
>> frank
>


More information about the Squeak-dev mailing list