emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r104570: Restore window-safely-shrink


From: martin rudalics
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r104570: Restore window-safely-shrinkable-p but avoid using it in calendar.el.
Date: Sun, 12 Jun 2011 09:46:56 +0200
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 104570
committer: martin rudalics <address@hidden>
branch nick: trunk
timestamp: Sun 2011-06-12 09:46:56 +0200
message:
  Restore window-safely-shrinkable-p but avoid using it in calendar.el.
  
  * window.el (window-safely-shrinkable-p): Restore function which
  was inadvertently removed in change from 2011-06-11.  Declare as
  obsolete.
  
  * calendar/calendar.el (calendar-generate-window): Use
  window-iso-combined-p instead of combination of one-window-p and
  window-safely-shrinkable-p.
modified:
  lisp/ChangeLog
  lisp/calendar/calendar.el
  lisp/window.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-06-12 00:57:24 +0000
+++ b/lisp/ChangeLog    2011-06-12 07:46:56 +0000
@@ -1,3 +1,13 @@
+2011-06-12  Martin Rudalics  <address@hidden>
+
+       * window.el (window-safely-shrinkable-p): Restore function which
+       was inadvertently removed in change from 2011-06-11.  Declare as
+       obsolete.
+
+       * calendar/calendar.el (calendar-generate-window): Use
+       window-iso-combined-p instead of combination of one-window-p and
+       window-safely-shrinkable-p.
+
 2011-06-12  Glenn Morris  <address@hidden>
 
        * progmodes/fortran.el (fortran-mode-syntax-table):

=== modified file 'lisp/calendar/calendar.el'
--- a/lisp/calendar/calendar.el 2011-05-18 03:20:13 +0000
+++ b/lisp/calendar/calendar.el 2011-06-12 07:46:56 +0000
@@ -1373,17 +1373,12 @@
     ;; Don't do any window-related stuff if we weren't called from a
     ;; window displaying the calendar.
     (when in-calendar-window
-      ;; The second test used to be window-full-width-p.
-      ;; Not sure what it was/is for, except perhaps some way of saying
-      ;; "try not to mess with existing configurations".
-      ;; If did the wrong thing on wide frames, where we have done a
-      ;; horizontal split in calendar-basic-setup.
-      (if (or (one-window-p t) (not (window-safely-shrinkable-p)))
-          ;; Don't mess with the window size, but ensure that the first
-          ;; line is fully visible.
-          (set-window-vscroll nil 0)
-        ;; Adjust the window to exactly fit the displayed calendar.
-        (fit-window-to-buffer nil nil calendar-minimum-window-height))
+      (if (window-iso-combined-p)
+         ;; Adjust the window to exactly fit the displayed calendar.
+         (fit-window-to-buffer nil nil calendar-minimum-window-height)
+       ;; For a full height window or a window that is horizontally
+       ;; combined don't fit height to that of its buffer.
+       (set-window-vscroll nil 0))
       (sit-for 0))
     (and (bound-and-true-p font-lock-mode)
          (font-lock-fontify-buffer))

=== modified file 'lisp/window.el'
--- a/lisp/window.el    2011-06-11 14:06:16 +0000
+++ b/lisp/window.el    2011-06-12 07:46:56 +0000
@@ -4481,6 +4481,20 @@
          (error (setq delta nil)))
        delta))))
 
+(defun window-safely-shrinkable-p (&optional window)
+  "Return t if WINDOW can be shrunk without shrinking other windows.
+WINDOW defaults to the selected window."
+  (with-selected-window (or window (selected-window))
+    (let ((edges (window-edges)))
+      ;; The following doesn't satisfy the doc-string's claim when
+      ;; window and previous-/next-window are not part of the same
+      ;; combination but still share a common edge.  Using
+      ;; `window-iso-combined-p' instead should handle that.
+      (or (= (nth 2 edges) (nth 2 (window-edges (previous-window))))
+         (= (nth 0 edges) (nth 0 (window-edges (next-window))))))))
+(make-obsolete
+ 'window-safely-shrinkable-p "use `window-iso-combined-p' instead." "24.1")
+
 (defun shrink-window-if-larger-than-buffer (&optional window)
   "Shrink height of WINDOW if its buffer doesn't need so many lines.
 More precisely, shrink WINDOW vertically to be as small as


reply via email to

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