1
#| nokogiri-config.jl -- options that affect the configurator, not the wm
3
$Id: config.jl,v 1.3 2000/09/01 20:02:21 john Exp $
5
Copyright (C) 2000 John Harper <john@dcs.warwick.ac.uk>
7
This file is part of sawfish.
9
sawfish is free software; you can redistribute it and/or modify it
10
under the terms of the GNU General Public License as published by
11
the Free Software Foundation; either version 2, or (at your option)
14
sawfish is distributed in the hope that it will be useful, but
15
WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
GNU General Public License for more details.
19
You should have received a copy of the GNU General Public License
20
along with sawfish; see the file COPYING. If not, write to
21
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24
(define-structure sawfish.ui.config
26
(export define-config-item
35
(define done-init nil)
37
;; list of (NAME . THUNK) -- configs to initialize at some point
38
(define pending-configs '())
40
(define (define-config-item name var thunk)
41
(let ((callback (lambda ()
42
(set var (custom-symbol-value name))
45
(let ((slot (or (get-slot name)
46
(error "Unknown slot: %s" name))))
47
(define-change-handler slot callback)
49
(setq pending-configs (cons (cons name callback) pending-configs)))))
51
(define (initialize-configs)
53
;; ensure that config group has been loaded
54
(fetch-group (get-group root-group))
56
(let ((slot (or (get-slot (car x))
57
(error "Unknown slot: %s" (car x)))))
58
(define-change-handler slot (cdr x))
61
(setq pending-configs '())