Interesting. Two questions and a comment:<div><br></div><div>q1) Would it be hard to add something meta to the &#39;more&#39; menu in the Preference Browser that would clue a user in on where to start looking for a way to programmatically interact with the value? I realize that, perhaps, by the time one&#39;s doing that, one ought to know how to search with Cmd-Shift-E (I didn&#39;t, heh ^.^) but I liked being able to look at a preference in the browser and know right away how to set it script-wise without a lot of effort.<br>
<br></div><div>q2) The choice of the word &#39;pragma&#39; is interesting. Are there people hoping to accomplish things analogous to the Perl idiom?</div><div><br></div><div>comment:</div><div><br></div><div>In general, I like this from an architectural perspective. It feels right.</div>
<div><br></div><div> - Ron</div><div><br><div class="gmail_quote">On Sat, Aug 22, 2009 at 10:51 PM, Andreas Raab <span dir="ltr">&lt;<a href="mailto:andreas.raab@gmx.de">andreas.raab@gmx.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">Ronald Spengler wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Interesting. While digging around trying to find out what was going on, <br>
</blockquote>
<br></div>
Yeah, this stuff ain&#39;t pretty. Which is the reason why (in the long term) I want to get away from hardcoded Preferences and move to pragmas. The point being that a pragma preference, such as TextMorph class&gt;&gt;useNewEditors can be discovered by any preference browser/viewer - there is no reason whatsoever to have preferences in the kernel at all. A preference is nothing but a user-visible variable so all we need is to annotate the variables we want to expose.<br>

<br>
Plus, it solves a set of issues for preference installation and initialization. Have a look at the elaborate dance in SHTextStyler80 class&gt;&gt;initializePreferences which is only there because one must inject preferences into this external entity called Preferences instead of keeping them in class vars local to the class/packages where they are needed.<br>

<br>
And of course, it gives you an obvious way of changing the preference. Instead of Preferences enable: #useNewMorphicEditors you simply set the underlying variable, i.e., TextMorph useNewEditors: true. Which is good straightforward code that works directly with senders/implementors etc.<br>

<br>
Cheers,<br><font color="#888888">
  - Andreas<br>
<br>
</font><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
I did stumble across PragmaPreference by printing:<br>
<br>
Preferences allPreferenceObjects<br>
<br>
... and searching the resultant text for &#39;Editors&#39; finding &quot;a PragmaPreference#&#39;Use New Editors&#39; nil#&#39;Use New Editors&#39;&quot; in the output. <br>
But the class comment for PragmaPreference:<br>
<br>
&quot;Differs from superclass by redirecting all queries to preference provider.&quot;<br>
<br>
... didn&#39;t help me any, because I didn&#39;t know what was meant by preference provider. For want of Cmd-Shift-E (thank you! awesome!) I just browsed the protocol a bit, looked at the superclass, gave up and cried &#39;halp!&#39;<br>

<br>
Maybe I would have grokked this right away had I a better (read: passing) grasp of the superclass, but PragmaPreference feels like it wants to do something of architectural significance. Maybe move preferences off to the actual objects where the behavior is specified, instead of a big pile, perhaps?<br>

<br>
 - Ron, curiously<br>
<br></div><div><div></div><div class="h5">
On Sat, Aug 22, 2009 at 9:50 PM, Andreas Raab &lt;<a href="mailto:andreas.raab@gmx.de" target="_blank">andreas.raab@gmx.de</a> &lt;mailto:<a href="mailto:andreas.raab@gmx.de" target="_blank">andreas.raab@gmx.de</a>&gt;&gt; wrote:<br>

<br>
    Ronald Spengler wrote:<br>
<br>
        How can I talk to preferences that have spaces in them? I&#39;m<br>
        trying to add a line to my image configuration script that<br>
        enables the Cuis editors automatically.<br>
<br>
<br>
    Cmd-Shift-E (Alt-Shift-E) is your friend. Select &quot;Use New Editors&quot;,<br>
    press Cmd-Shift-E and the only hit should be TextMorph<br>
    class&gt;&gt;useNewEditors with its companion accessor #useNewEditors:.<br>
<br>
    (what you are seeing here is a pragma preference which shouldn&#39;t be<br>
    manipulated by its user-visible description)<br>
<br>
    Cheers,<br>
     - Andreas<br>
<br>
<br>
        My usual strategy of:<br>
<br>
        Preferences<br>
        setPreference: #swapMouseButtons toValue: true<br>
<br>
        ... doesn&#39;t seem to work.<br>
<br>
        When I print:<br>
<br>
        Preferences setPreference: #&#39;Use New Editors&#39; toValue: true;<br>
        valueOfPreference: #&#39;Use New Editors&#39;<br>
<br>
        ... I get back nil.<br>
<br>
        Failing that, I also tried:<br>
<br>
        Preferences togglePreference: #&#39;Use New Editors&#39;<br>
<br>
        ... which pops a MNU, so in general I think there&#39;s something<br>
        that I&#39;m failing to understand.<br>
<br>
        Any help is much appreciated.<br>
<br>
         - Ron<br>
<br>
<br>
        ------------------------------------------------------------------------<br>
<br>
<br>
<br>
<br>
<br>
<br></div></div>
------------------------------------------------------------------------<br>
<br>
<br>
</blockquote>
<br>
<br>
</blockquote></div><br></div>