[sawfish] Added cycle-among-groups{, -backwards} commands (cycle between the most recently used window of group



commit 0d69a27a2458ba2adc359389a4eb44f6e76fb4ae
Author: chrisb <zanghar freenet de>
Date:   Thu May 7 19:35:47 2009 +0200

    Added cycle-among-groups{,-backwards} commands (cycle between the most recently used window of groups) [Fernando Carmano Varo]
---
 ChangeLog                           |    3 +++
 lisp/sawfish/wm/autoload.jl         |    2 ++
 lisp/sawfish/wm/commands/x-cycle.jl |   18 ++++++++++++++++++
 man/news.texi                       |    2 ++
 4 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c282c19..1276a47 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,9 @@
 2009-05-07  Christopher Bratusek <zanghar freenet de>
 	* COPYING.SOUNDS: added
 
+	* lisp/sawfish/wm/autoload.jl
+	* lisp/sawfish/wm/commands/x-cycle.jl: added cycle-among-groups{,-backwards} [Fernando Carmano Varo]
+
 2009-05-06  Christopher Bratusek <zanghar freenet de>
 	* sawfish.spec.in: don't re-define %{_host} [Ritz]
 
diff --git a/lisp/sawfish/wm/autoload.jl b/lisp/sawfish/wm/autoload.jl
index 92883b7..36786a7 100644
--- a/lisp/sawfish/wm/autoload.jl
+++ b/lisp/sawfish/wm/autoload.jl
@@ -121,6 +121,8 @@
 (autoload-command 'cycle-windows-backwards 'sawfish.wm.commands.x-cycle)
 (autoload-command 'cycle-group 'sawfish.wm.commands.x-cycle)
 (autoload-command 'cycle-group-backwards 'sawfish.wm.commands.x-cycle)
+(autoload-command 'cycle-among-groups 'sawfish.wm.commands.x-cycle)
+(autoload-command 'cycle-among-groups-backwards 'sawfish.wm.commands.x-cycle)
 (autoload-command 'cycle-prefix 'sawfish.wm.commands.x-cycle)
 (autoload-command 'cycle-prefix-backwards 'sawfish.wm.commands.x-cycle)
 (autoload-command 'cycle-class 'sawfish.wm.commands.x-cycle)
diff --git a/lisp/sawfish/wm/commands/x-cycle.jl b/lisp/sawfish/wm/commands/x-cycle.jl
index 8faa5b3..bc72ce3 100644
--- a/lisp/sawfish/wm/commands/x-cycle.jl
+++ b/lisp/sawfish/wm/commands/x-cycle.jl
@@ -348,6 +348,14 @@ Any extra arguments are passed to each call to define-command."
    #:spec "%W")
 
   (define-cycle-command-pair
+   'cycle-among-groups 'cycle-among-groups-backwards
+   (lambda ()
+     "Only cycle the top members of each group."
+     (delete-if-not window-in-cycle-p
+                    (mapcar (lambda (gid) (car (windows-by-group gid t)))
+                            (window-group-ids)))))
+
+  (define-cycle-command-pair
    'cycle-prefix 'cycle-prefix-backwards
    (lambda (w)
      (when (string-match "^([^:]+)\\s*:" (window-name w))
@@ -388,6 +396,8 @@ Any extra arguments are passed to each call to define-command."
 ###autoload (autoload-command 'cycle-windows-backwards 'sawfish.wm.commands.x-cycle)
 ###autoload (autoload-command 'cycle-group 'sawfish.wm.commands.x-cycle)
 ###autoload (autoload-command 'cycle-group-backwards 'sawfish.wm.commands.x-cycle)
+###autoload (autoload-command 'cycle-among-groups 'sawfish.wm.commands.x-cycle)
+###autoload (autoload-command 'cycle-among-groups-backwards 'sawfish.wm.commands.x-cycle)
 ###autoload (autoload-command 'cycle-prefix 'sawfish.wm.commands.x-cycle)
 ###autoload (autoload-command 'cycle-prefix-backwards 'sawfish.wm.commands.x-cycle)
 ###autoload (autoload-command 'cycle-class 'sawfish.wm.commands.x-cycle)
@@ -415,6 +425,14 @@ Cycle through all windows in the same group as the current window.
 Reverse cycle through all windows in the same group as the current window.
 ::end::
 
+::doc:sawfish.wm.commands.x-cycle#cycle-among-groups::
+Cycle through different groups (only the top window of each group).
+::end::
+
+::doc:sawfish.wm.commands.x-cycle#cycle-among-groups-backwards::
+Reverse cycle through different groups (only the top window of each group).
+::end::
+
 ::doc:sawfish.wm.commands.x-cycle#cycle-prefix::
 Cycle through all windows whose names match the leading colon-delimited
 prefix of the current window.
diff --git a/man/news.texi b/man/news.texi
index d89be80..36c6852 100644
--- a/man/news.texi
+++ b/man/news.texi
@@ -88,6 +88,8 @@ To use the old style, put @code{(define-special-variable customize-program "sawf
 @item Make Viewport commands appear in Sawfish-UI [Christopher Bratusek]
 
 @item Make Window History appear in Sawfish-UI [Christopher Bratusek]
+
+ item Added cycle-among-groups{,-backwards} commands (cycle between the most recently used window of groups) [Fernando Carmano Varo]
 @end itemize
 
 @item Other changes:



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