[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[STUMP] [PATCH] Exchange windows; Changed window numbering to start at 1
From: |
Matt Shen |
Subject: |
[STUMP] [PATCH] Exchange windows; Changed window numbering to start at 1; Delete specific notifications. |
Date: |
Sat, 29 Mar 2008 11:34:35 -0700 |
---
contrib/notifications.lisp | 5 +++++
core.lisp | 2 +-
user.lisp | 30 ++++++++++++++++++++++++++++++
3 files changed, 36 insertions(+), 1 deletions(-)
diff --git a/contrib/notifications.lisp b/contrib/notifications.lisp
index 411aed4..e1a437e 100644
--- a/contrib/notifications.lisp
+++ b/contrib/notifications.lisp
@@ -88,6 +88,11 @@ added anew."
"Clear all notifications."
(setf notifications nil))
+(defcommand notifications-delete (str)
+ ()
+ (when (member str notifications :test #'string=)
+ (setf notifications (delete str notifications :test #'string=))))
+
(defcommand notifications-delete-first ()
()
"Delete the first notification."
diff --git a/core.lisp b/core.lisp
index 240e2ab..09c26fa 100644
--- a/core.lisp
+++ b/core.lisp
@@ -877,7 +877,7 @@ than the root window's width and height."
(defun find-free-window-number (group)
"Return a free window number for GROUP."
- (find-free-number (mapcar 'window-number (group-windows group))))
+ (find-free-number (mapcar 'window-number (group-windows group)) 1))
(defun reparent-window (window)
;; apparently we need to grab the server so the client doesn't get
diff --git a/user.lisp b/user.lisp
index 6a0b347..72637c0 100644
--- a/user.lisp
+++ b/user.lisp
@@ -1310,6 +1310,36 @@ direction. The following are valid directions:
"Just like move-focus except that the current is pulled along."
(move-focus-and-or-window dir t))
+;; Exchange
+
+(defun exchange-windows (win1 win2)
+ "Exchange the windows in their respective frames."
+ (let ((f1 (window-frame win1))
+ (f2 (window-frame win2)))
+ (unless (eq f1 f2)
+ (pull-window win1 f2)
+ (pull-window win2 f1)
+ (focus-frame (current-group) f2))))
+
+(defun exchange-direction (win dir)
+ (let ((direction (intern (string-upcase dir) :keyword))
+ (frame-set (group-frames (current-group))))
+ (exchange-windows win
+ (frame-window (neighbour direction
+ (window-frame win)
+ frame-set)))))
+
+(defcommand exchange (dir)
+ ((:string "Direction: "))
+ "Exchange the current window with the top window of the frame in direction.
address@hidden @asis
address@hidden up
address@hidden down
address@hidden left
address@hidden right
address@hidden table"
+ (exchange-direction (current-window) dir))
+
(defun run-or-raise (cmd props &optional (all-groups
*run-or-raise-all-groups*) (all-screens *run-or-raise-all-screens*))
"Run the shell command, @var{cmd}, unless an existing window
matches @var{props}. @var{props} is a property list with the following keys:
--
1.5.4.4
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [STUMP] [PATCH] Exchange windows; Changed window numbering to start at 1; Delete specific notifications.,
Matt Shen <=