stumpwm-devel
[Top][All Lists]
Advanced

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

[STUMP] [PATCH] Fix crash when using fmt-head-window-list-hidden-windows


From: John Li
Subject: [STUMP] [PATCH] Fix crash when using fmt-head-window-list-hidden-windows on float group.
Date: Tue, 17 Feb 2009 20:34:57 -0500
User-agent: Mutt/1.5.18 (2008-05-17)

Gotta love fixes that involve throwing away (my) bad code :). Also
update the docstring for *hidden-window-color*.
---

Certain weary project leads may recall being sent many, many versions
of this patch, each slightly less broken than the previous. I'm
reasonably confident that this one has reached a nonbrokenness
plateau, and that I won't find any problems with it in the foreseeable
future.

Thanks for your patience, much <3,
jli

 mode-line.lisp |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/mode-line.lisp b/mode-line.lisp
index 0f6dc20..c8bf25e 100644
--- a/mode-line.lisp
+++ b/mode-line.lisp
@@ -73,8 +73,8 @@ (defvar *mode-line-border-color* "Gray30"
 
 (defvar *hidden-window-color* "^5*"
   "Color command for hidden windows when using the
-fmt-head-window-list2 formatter. To disable coloring hidden windows,
-set this to an empty string.")
+fmt-head-window-list-hidden-windows formatter. To disable coloring
+hidden windows, set this to an empty string.")
 
 (defvar *screen-mode-line-format* "[^B%n^b] %W"
   "This variable describes what will be displayed on the modeline for each 
screen.
@@ -199,19 +199,16 @@ (defun fmt-head-window-list-hidden-windows (ml)
 separated. The currently focused window is highlighted with
 fmt-highlight. Any non-visible windows are colored the
 *hidden-window-color*."
-  (let* ((group (mode-line-current-group ml))
-         (head (mode-line-head ml))
-         (all-wins (head-windows group head))
-         (top-wins (mapcar 'frame-window (head-frames group head)))
-         (non-top-wins (set-difference all-wins top-wins)))
+  (let* ((all (head-windows (mode-line-current-group ml) (mode-line-head ml)))
+         (non-top (set-difference all (top-windows))))
     (format nil "~{~a~^ ~}"
             (mapcar (lambda (w)
                       (let ((str (format-expand *window-formatters*
                                                 *window-format* w)))
                         (cond ((eq w (current-window)) (fmt-highlight str))
-                              ((find w non-top-wins) (fmt-hidden str))
+                              ((find w non-top) (fmt-hidden str))
                               (t str))))
-                    (sort1 all-wins #'< :key #'window-number)))))
+                    (sort1 all #'< :key #'window-number)))))
 
 (defun fmt-modeline-time (ml)
   (declare (ignore ml))
-- 
1.5.6.5





reply via email to

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