Re: [VOTE] expand-window Vs maximize-fill-window



updated proposed patch attached.
diff --git a/lisp/sawfish/wm/commands/shrink-yank.jl b/lisp/sawfish/wm/commands/shrink-yank.jl
index c6db7dd..78ef8f9 100644
--- a/lisp/sawfish/wm/commands/shrink-yank.jl
+++ b/lisp/sawfish/wm/commands/shrink-yank.jl
@@ -30,7 +30,8 @@
             yank-window-left
             yank-window-right
             yank-window-up
-            yank-window-down)
+            yank-window-down
+	    contract-window)
 
     (open   rep
             sawfish.wm.commands
@@ -88,6 +89,13 @@ before."
 before."
     (yank-window window 'down))
 
+  (define (contract-window window)
+    "Contracts a window. (shrink in all four directions)"
+    (shrink-window window 'up)
+    (shrink-window window 'right)
+    (shrink-window window 'down)
+    (shrink-window window 'left))
+
   ;;###autoload
   (define-command 'shrink-window-left shrink-window-left #:spec "%W")
   (define-command 'shrink-window-right shrink-window-right #:spec "%W")
@@ -97,6 +105,7 @@ before."
   (define-command 'yank-window-right yank-window-right #:spec "%W")
   (define-command 'yank-window-up yank-window-up #:spec "%W")
   (define-command 'yank-window-down yank-window-down #:spec "%W")
+  (define-command 'contract-window contract-window #:spec "%W")
 
 ;;; Implementation:
 
diff --git a/lisp/sawfish/wm/state/maximize.jl b/lisp/sawfish/wm/state/maximize.jl
index 2c89973..c7560e1 100644
--- a/lisp/sawfish/wm/state/maximize.jl
+++ b/lisp/sawfish/wm/state/maximize.jl
@@ -39,12 +39,12 @@
 	    maximize-window-toggle
 	    maximize-window-vertically-toggle
 	    maximize-window-horizontally-toggle
-	    maximize-fill-window
-	    maximize-fill-window-vertically
-	    maximize-fill-window-horizontally
-	    maximize-fill-window-toggle
-	    maximize-fill-window-vertically-toggle
-	    maximize-fill-window-horizontally-toggle
+	    expand-window
+	    expand-window-vertically
+	    expand-window-horizontally
+	    expand-window-toggle
+	    expand-window-vertically-toggle
+	    expand-window-horizontally-toggle
 	    maximize-window-fullscreen
 	    maximize-window-fullscreen-toggle
 	    maximize-window-fullxinerama
@@ -454,40 +454,40 @@ unmaximized."
 
 ;;; fill commands
 
-  (define (maximize-fill-window w #!optional direction)
+  (define (expand-window w #!optional direction)
     "Maximize the window without obscuring any other windows."
     (let ((avoid-by-default t)
 	  (maximize-always-expands t)
 	  (dont-avoid-ignored maximize-ignore-when-filling))
       (maximize-window w direction t)))
 
-  (define (maximize-fill-window-vertically w)
+  (define (expand-window-vertically w)
     "Maximize the window vertically without obscuring any other windows."
-    (maximize-fill-window w 'vertical))
+    (expand-window w 'vertical))
 
-  (define (maximize-fill-window-horizontally w)
+  (define (expand-window-horizontally w)
     "Maximize the window horizontally without obscuring any other windows."
-    (maximize-fill-window w 'horizontal))
+    (expand-window w 'horizontal))
 
-  (define (maximize-fill-window-toggle w #!optional direction)
+  (define (expand-window-toggle w #!optional direction)
     "Toggle the state of the window between maximized-filled and unmaximized."
     (if (window-maximized-p w)
 	(unmaximize-window w direction)
-      (maximize-fill-window w direction)))
+      (expand-window w direction)))
 
-  (define (maximize-fill-window-vertically-toggle w)
+  (define (expand-window-vertically-toggle w)
     "Toggle the state of the window between vertically maximized-filled and
 unmaximized."
     (if (window-maximized-vertically-p w)
 	(unmaximize-window w 'vertical)
-      (maximize-fill-window w 'vertical)))
+      (expand-window w 'vertical)))
 
-  (define (maximize-fill-window-horizontally-toggle w)
+  (define (expand-window-horizontally-toggle w)
     "Toggle the state of the window between horizontally maximized-filled and
 unmaximized."
     (if (window-maximized-horizontally-p w)
 	(unmaximize-window w 'horizontal)
-      (maximize-fill-window w 'horizontal)))
+      (expand-window w 'horizontal)))
 
   (define (maximize-unframe w)
     (set-window-type w 'unframed)
@@ -498,18 +498,18 @@ unmaximized."
     (maximize-window w))
 
   ;;###autoload
-  (define-command 'maximize-fill-window
-    maximize-fill-window #:spec "%W")
-  (define-command 'maximize-fill-window-vertically
-    maximize-fill-window-vertically #:spec "%W")
-  (define-command 'maximize-fill-window-horizontally
-    maximize-fill-window-horizontally #:spec "%W")
-  (define-command 'maximize-fill-window-toggle
-    maximize-fill-window-toggle #:spec "%W")
-  (define-command 'maximize-fill-window-horizontally-toggle
-    maximize-fill-window-horizontally-toggle #:spec "%W")
-  (define-command 'maximize-fill-window-vertically-toggle
-    maximize-fill-window-vertically-toggle #:spec "%W")
+  (define-command 'expand-window
+    expand-window #:spec "%W")
+  (define-command 'expand-window-vertically
+    expand-window-vertically #:spec "%W")
+  (define-command 'expand-window-horizontally
+    expand-window-horizontally #:spec "%W")
+  (define-command 'expand-window-toggle
+    expand-window-toggle #:spec "%W")
+  (define-command 'expand-window-horizontally-toggle
+    expand-window-horizontally-toggle #:spec "%W")
+  (define-command 'expand-window-vertically-toggle
+    expand-window-vertically-toggle #:spec "%W")
   (define-command 'maximize-unframe
     maximize-unframe #:spec "%W")
   (define-command 'maximize-reframe
diff --git a/man/sawfish.texi b/man/sawfish.texi
index decbf94..0414ba7 100644
--- a/man/sawfish.texi
+++ b/man/sawfish.texi
@@ -2303,8 +2303,8 @@ maximize without overlap to any other windows, except ``ignored'' ones.
 In addition, they don't shrink the window even if it is already bigger
 than the screen size.
 
- deffn Function maximize-fill-window window &optional direction
- deffnx Command maximize-fill-window window
+ deffn Function expand-window window &optional direction
+ deffnx Command expand-window window
 Maximize both dimensions of @var{window} without overlapping other
 windows.
 
@@ -2313,20 +2313,20 @@ If defined, @var{direction} is a symbol, either @code{vertical} or
 direction.
 @end deffn
 
- deffn Function maximize-fill-window-vertically window
- deffnx Command maximize-fill-window-vertically window
+ deffn Function expand-window-vertically window
+ deffnx Command expand-window-vertically window
 Maximize the vertical dimension of @var{window} in the screen without
 overlapping other windows.
 @end deffn
 
- deffn Function maximize-fill-window-horizontally window
- deffnx Command maximize-fill-window-horizontally window
+ deffn Function expand-window-horizontally window
+ deffnx Command expand-window-horizontally window
 Maximize the horizontal dimension of @var{window} in the screen
 without overlapping other windows.
 @end deffn
 
- deffn Function maximize-fill-window-toggle window
- deffnx Command maximize-fill-window-toggle window
+ deffn Function expand-window-toggle window
+ deffnx Command expand-window-toggle window
 Toggle the state of @var{window} between maximized and unmaximized in
 the screen without overlapping other windows.
 
@@ -2335,14 +2335,14 @@ If defined, @var{direction} is a symbol, either @code{vertical} or
 direction.
 @end deffn
 
- deffn Function maximize-fill-window-vertically-toggle window
- deffnx Command maximize-fill-window-vertically-toggle window
+ deffn Function expand-window-vertically-toggle window
+ deffnx Command expand-window-vertically-toggle window
 Toggle the state of @var{window} between vertically maximized and
 unmaximized in the screen without overlapping other windows.
 @end deffn
 
- deffn Function maximize-fill-window-horizontally-toggle window
- deffnx Command maximize-fill-window-horizontally-toggle window
+ deffn Function expand-window-horizontally-toggle window
+ deffnx Command expand-window-horizontally-toggle window
 Toggle the state of @var{window} between horizontally maximized and
 unmaximized in the screen without overlapping other windows.
 @end deffn

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil



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