stumpwm-devel
[Top][All Lists]
Advanced

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

[STUMP] [PATCH] Renumbering windows to remove gaps.


From: Raskin Michael
Subject: [STUMP] [PATCH] Renumbering windows to remove gaps.
Date: Fri, 22 Aug 2008 00:02:45 +0400
User-agent: Thunderbird 2.0.0.14 (X11/20080804)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The patch adds a function to change numbers of windows with numbers not
in the given list to remove gaps in numbering. Also a command that
renumbers all windows (preserving order) to numbers 0..n-1.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQEcBAEBAgAGBQJIrcniAAoJEE6tnN0aWvw3yVQH/3tXiHarZngCsyzNMN8oRLdv
XVmVDk7nDnBdf3BWGxZmAZLspzD/fA3imUgEXjmR3NypNSE0Q5hyspQqzp4mz7D4
XdR6btWkjKMIc1uwRILkKo1tsBxJRkZTx5T7ZqM6GK+zKawJyncIR9WJuxKEcoRo
YMkcsozv4Jba1Y7bL2ALoD4bKPtE3xOPg4HJ3fry0b7H5bWiwViQcTuEGdV/Eh6Y
XUJE3koTMoKUWvsbLLKz5DbVwLr8wWwEAIBiTTQXNsbLcTdOnevHcx1DsZrjO6qa
+1o4ceS6iIq6/crMvQ9/flVxz1RCs0gs/RHHIMkss+Q6d5AYRb9+63/M/gux2pw=
=+1It
-----END PGP SIGNATURE-----
>From d7d16b57e58a7b73c74f7fc6ff17858fb71cb0d3 Mon Sep 17 00:00:00 2001
From: 38a938c2 <address@hidden>
Date: Thu, 21 Aug 2008 23:47:25 +0400
Subject: [PATCH] Added a command to compact window numbering. Also a function 
that allows to leave certain window numbers alone.

---
 window.lisp |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/window.lisp b/window.lisp
index cc862ae..2f4df8d 100644
--- a/window.lisp
+++ b/window.lisp
@@ -1310,6 +1310,23 @@ is using the number, then the windows swap numbers. 
Defaults to current group."
 
 (defcommand-alias number renumber)
 
+(defun make-window-numbers-contiguous (preserved)
+  "Ensure that used window numbers do not have gaps; possibly ignore preserved 
window numbers"
+  (let* ((group (current-group))
+        (windows (sort-windows group)))
+    (loop for w in windows
+         do (unless (find (window-number w) preserved) 
+              (setf
+                (window-number w)
+                (find-free-number 
+                  (remove 
+                    (window-number w) 
+                    (mapcar 'window-number windows)) 
+                  0))))))
+(defcommand make-all-window-numbers-contiguous () ()
+  "Make all window numbers contiguous with no exceptions"
+  (make-window-numbers-contiguous '()))
+
 (defcommand gravity (gravity) ((:gravity "Gravity: "))
   (when (current-window)
     (setf (window-gravity (current-window)) gravity)
-- 
1.5.6.2

Attachment: 0006-Added-a-command-to-compact-window-numbering.-Also-a.patch.sig
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]