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

From: Arjun Guha (arjun.guha at gmail.com)
Date: Mon Aug 20 12:48:14 EDT 2007

[ 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)
   (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)

  (define post-installer
    (lambda (path)
      (let* ([tabify (preferences:get 'framework:tabify)]
             [tabify-ht (first tabify)])
            (or (hash-table-insert-new! tabify-ht 'type-case 'lambda)
                (hash-table-insert-new! tabify-ht 'define-type
          (preferences:set 'framework:tabify
                           (cons tabify-ht (rest tabify)))))))

My info.ss contains the line:

(define post-install-collection "private/post-installer.ss")

Posted on the users mailing list.