[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[STUMP] [PATCH] Renumbering windows to remove gaps.
From: |
38a938c2 |
Subject: |
[STUMP] [PATCH] Renumbering windows to remove gaps. |
Date: |
Fri, 22 Aug 2008 00:06:40 +0400 |
User-agent: |
Thunderbird 2.0.0.14 (X11/20080804) |
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.
>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
0006-Added-a-command-to-compact-window-numbering.-Also-a.patch.sig
Description: Binary data
- [STUMP] [PATCH] Renumbering windows to remove gaps.,
38a938c2 <=