diff lisp/calendar/calendar.el @ 101938:0c901689da73

(calendar-window-list): Ignore invisible windows. (calendar-set-mode-line): Fall back to a default width if we seem to be called from daemon. (Bug#2199)
author Glenn Morris <rgm@gnu.org>
date Wed, 11 Feb 2009 04:02:16 +0000
parents 3d527c23c151
children 3206ad427d3c
line wrap: on
line diff
--- a/lisp/calendar/calendar.el	Wed Feb 11 04:01:35 2009 +0000
+++ b/lisp/calendar/calendar.el	Wed Feb 11 04:02:16 2009 +0000
@@ -1723,10 +1723,13 @@
   "List of all calendar-related windows."
   (let ((calendar-buffers (calendar-buffer-list))
         list)
+    ;; Using 0 rather than t for last argument - see bug#2199.
+    ;; This is only used with calendar-hide-window, which ignores
+    ;; iconified frames anyway, so could use 'visible rather than 0.
     (walk-windows (lambda (w)
                     (if (memq (window-buffer w) calendar-buffers)
                         (push w list)))
-                  nil t)
+                  nil 0)
     list))
 
 (defun calendar-buffer-list ()
@@ -2461,6 +2464,11 @@
   (let* ((edges (window-edges))
          ;; As per doc of window-width, total visible mode-line length.
          (width (- (nth 2 edges) (car edges))))
+    ;; Hack for --daemon.  See bug #2199.
+    ;; If no frame exists yet, we have no idea what width to use.
+    (and (= width 10)
+         (not window-system)
+         (setq width (or (getenv "COLUMNS") 80)))
     (setq mode-line-format
           (if buffer-file-name
               `("-" mode-line-modified