[plt-scheme] modifying preferences from a collection .plt

From: Robby Findler (robby at cs.uchicago.edu)
Date: Mon Aug 20 20:59:22 EDT 2007

Try (require (lib "preferences.ss" "framework")) instead.

On 8/20/07, Arjun Guha <arjun.guha at gmail.com> wrote:
> [ Sorry for duplicates, if any. ]
>
> I'd like to add a few entries to "define-like keywords" and "lambda-
> like keywords" when my .plt file is installed.  I tried to do so by
> specifying a post-installer in my info.ss.  To manipulate the
> preferences file, I required (lib "framework.ss" "framework").
> However, this gives me the following error when I run setup-plt:
>
> > setup-plt:   setup-plt: error loading installer: dynamic-require: unknown module: #%mred-kernel; need to run in MrEd instead of MzScheme
>
> I get the same error when I run it within DrScheme (i.e. when I create
> and install the .plt file).  Any suggestions?  Someone may know either
> where this code belongs or may know an alternate way to manipulate the
> preferences file.
>
> For reference, my post-installer module is:
>
> (module post-installer mzscheme
>   (provide post-installer)
>   (require
>    (lib "list.ss")
>    (lib "framework.ss" "framework"))
>
>   (define (hash-table-insert-new! ht key val)
>     (hash-table-get ht key
>      (lambda ()
>        (hash-table-put! ht key val)
>        #t))
>     #f)
>
>   (define post-installer
>     (lambda (path)
>       (let* ([tabify (preferences:get 'framework:tabify)]
>              [tabify-ht (first tabify)])
>         (when
>             (or (hash-table-insert-new! tabify-ht 'type-case 'lambda)
>                 (hash-table-insert-new! tabify-ht 'define-type
> 'define))
>           (preferences:set 'framework:tabify
>                            (cons tabify-ht (rest tabify)))))))
>   )
>
> My info.ss contains the line:
>
> (define post-install-collection "private/post-installer.ss")
>
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>


Posted on the users mailing list.