stumpwm-devel
[Top][All Lists]
Advanced

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

[STUMP] [PATCH] Command to make window numbers occupy a contiguous block


From: Raskin Michael
Subject: [STUMP] [PATCH] Command to make window numbers occupy a contiguous block.
Date: Thu, 21 Aug 2008 23:50:55 +0400
User-agent: Thunderbird 2.0.0.14 (X11/20080804)

>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]