[sawfish] Fix of a semi-bug. (defgroup stacking) is moved to custom.jl from stacking. Without this, adding 'ta



commit 9283555b269169f6a8e00f64782312c33fb6e049
Author: Teika kazura <teika lavabit com>
Date:   Sat Mar 13 13:25:50 2010 +0900

    Fix of a semi-bug. (defgroup stacking) is moved to custom.jl from stacking.
    Without this, adding 'tab' to open clause of wm.frames breaks the startup.
    
    Reason: In lisp/sawfish/wm.jl, wm.stacking is loaded. But long chain of
    'open' starting from wm.stacking reaches wm.util.stacking, which has
     (defcustom foo :group (misc stacking))
    But the definition of the group 'stacking' is in body of wm.stacking
    which is not yet evaluated! But body eval has to come after 'open', so
    it can't be fixed by respecting modularity (of librep).
    
    Of course it can be solved by fixing defcustom & defgroup, but it's
    beyond us now. (And isn't it the same reason that Harper decided to
    centralize many defgroups into wm.custom?)

 lisp/sawfish/wm/custom.jl   |   13 +++++++++----
 lisp/sawfish/wm/stacking.jl |    2 --
 2 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/lisp/sawfish/wm/custom.jl b/lisp/sawfish/wm/custom.jl
index 5f3ca4b..1182a01 100644
--- a/lisp/sawfish/wm/custom.jl
+++ b/lisp/sawfish/wm/custom.jl
@@ -305,7 +305,8 @@ of choices."
            ;; keep on recursing
            (loop (cdr group)
                  (or (assq (car group) (cddr parent))
-                     (error "Unknown group %s" full-group)))
+                     (error
+		      "Unknown customization group: %s.\nIf not typo, its defgroup is not called yet." full-group)))
            (unless (cdr group)
              (rplacd (cdr custom-groups)
                      (nconc (sort (filter consp (cddr custom-groups))
@@ -484,14 +485,18 @@ the user."
 
 ;;; default groups
 
-  (defgroup focus "Focus")
-  (defgroup move "Move/Resize" :require sawfish.wm.commands.move-resize)
+  ;; If you suffer from Sawfish init failure in defcustom / defgroup
+  ;; which is the result of additional "open", then push the defcustom
+  ;; of the parent group here.
   (defgroup appearance "Appearance")
-  (defgroup workspace "Workspaces")
   (defgroup bindings "Bindings")
+  (defgroup focus "Focus")
   (defgroup min-max "Mini/Maximizing")
   (defgroup misc "Miscellaneous")
+  (defgroup move "Move/Resize" :require sawfish.wm.commands.move-resize)
   (defgroup placement "Placement" :group misc)
+  (defgroup stacking "Stacking" :group misc)
+  (defgroup workspace "Workspaces")
 
 ;;; loading user's customisations
 
diff --git a/lisp/sawfish/wm/stacking.jl b/lisp/sawfish/wm/stacking.jl
index 50dc4fe..a6a79b7 100644
--- a/lisp/sawfish/wm/stacking.jl
+++ b/lisp/sawfish/wm/stacking.jl
@@ -54,8 +54,6 @@
   ;; represents the level of normal windows, negative for windows below
   ;; this level, and positive for windows above the normal level
 
-  (defgroup stacking "Stacking" :group misc)
-
   (defcustom transients-above 'parents
     "Keep transient windows stacked above: \\w"
     :group (misc stacking)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]