[sawfish: 1/10] rename-window functions are moved to wm/windows.jl.



commit 942dcec1ac3ee86bc2d3b35f54c247dc3a5d4894
Author: Teika kazura <teika lavabit com>
Date:   Fri Sep 25 18:05:32 2009 +0900

    rename-window functions are moved to wm/windows.jl.
    Currently, rename-window-{func,interactive} are defined in
    wm/ext/match-window.jl, but they are moved to natural locations.
    
    To achive that, opening sawfish.wm.util.prompt is done by inline
    `require'.

 lisp/sawfish/wm/autoload.jl         |    2 +-
 lisp/sawfish/wm/ext/match-window.jl |   20 ++++----------------
 lisp/sawfish/wm/windows.jl          |   20 ++++++++++++++++++--
 3 files changed, 23 insertions(+), 19 deletions(-)
---
diff --git a/lisp/sawfish/wm/autoload.jl b/lisp/sawfish/wm/autoload.jl
index dd5837c..3f59b6a 100644
--- a/lisp/sawfish/wm/autoload.jl
+++ b/lisp/sawfish/wm/autoload.jl
@@ -144,7 +144,7 @@
 (autoload-command 'xterm 'sawfish.wm.commands.user)
 (autoload-command 'browser 'sawfish.wm.commands.user)
 (autoload-command '3d-hack 'sawfish.wm.ext.3d-hack)
-(autoload-command 'rename-window 'sawfish.wm.ext.match-window)
+(autoload-command 'rename-window 'sawfish.wm.windows)
 (defgroup audio "Sound" :require sawfish.wm.ext.audio-events)
 (defgroup match-window "Window Rules" :layout single :require sawfish.wm.ext.match-window)
 (defgroup tooltips "Tooltips" :group appearance :require sawfish.wm.ext.tooltips)
diff --git a/lisp/sawfish/wm/ext/match-window.jl b/lisp/sawfish/wm/ext/match-window.jl
index e06894e..6ae912c 100644
--- a/lisp/sawfish/wm/ext/match-window.jl
+++ b/lisp/sawfish/wm/ext/match-window.jl
@@ -45,16 +45,14 @@
 	    define-match-window-formatter
 	    add-window-matcher
 	    remove-window-matcher
-	    match-window
-	    rename-window-func
-	    rename-window-interactive)
+	    match-window)
 
     (open rep
 	  rep.system
 	  rep.regexp
 	  sawfish.wm
-	  sawfish.wm.util.groups
-	  sawfish.wm.util.prompt)
+	  sawfish.wm.windows
+	  sawfish.wm.util.groups)
 
   (define-structure-alias match-window sawfish.wm.ext.match-window)
 
@@ -492,14 +490,4 @@
               (lambda () (interactive)
                 (synthesize-event (lookup-event (cadr pair)) (current-event-window))))) value))))
 
-  (define (rename-window-func window new-name)
-    (set-x-text-property window 'WM_NAME (vector new-name))
-    (set-x-text-property window '_NET_WM_NAME (vector new-name))
-    (set-x-text-property window 'WM_ICON_NAME (vector new-name))
-    (set-x-text-property window '_NET_WM_ICON_NAME (vector new-name)))
-
-  (define (rename-window-interactive w)
-    (let ((new-name (prompt-for-string "Enter new window title:" (window-name w))))
-      (rename-window-func w new-name)))
-
-  (define-command 'rename-window rename-window-interactive #:spec "%W"))
+)
diff --git a/lisp/sawfish/wm/windows.jl b/lisp/sawfish/wm/windows.jl
index 84e9d84..3fd1c7c 100644
--- a/lisp/sawfish/wm/windows.jl
+++ b/lisp/sawfish/wm/windows.jl
@@ -58,7 +58,9 @@
 	     window-avoided-p
 	     avoided-windows
 	     call-after-property-changed
-	     call-after-state-changed))
+	     call-after-state-changed
+	     rename-window-func
+	     rename-window-interactive))
 
     (open rep
 	  rep.system
@@ -513,7 +515,21 @@ STATES has been changed. STATES may also be a single symbol."
 		 ((cdr cell) w relevant))))
 	    state-changes)))
 
-;; gaollable functions
+  (define (rename-window-func window new-name)
+    "Renames the WINDOW to NEW-NAME."
+    (set-x-text-property window 'WM_NAME (vector new-name))
+    (set-x-text-property window '_NET_WM_NAME (vector new-name))
+    (set-x-text-property window 'WM_ICON_NAME (vector new-name))
+    (set-x-text-property window '_NET_WM_ICON_NAME (vector new-name)))
+
+  (define (rename-window-interactive w)
+    (require 'sawfish.wm.util.prompt)
+    (let ((new-name (prompt-for-string "Enter new window title:"
+				       (window-name w))))
+      (rename-window-func w new-name)))
+
+  (define-command 'rename-window rename-window-interactive #:spec "%W")
+  ;; gaollable functions
 
   (gaol-add window-really-wants-input-p window-class window-avoided-p
 	    call-after-property-changed call-after-state-changed



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