# HG changeset patch # User Stefan Monnier # Date 1076287961 0 # Node ID 0a356c1b705751ccd16f8a950e2e8c5cc7e4c3f0 # Parent 3c462fb496fc5dcf9a115fa2f99e0c4f1f75f466 (window-safely-shrinkable-p): Don't change the buffer-list. Don't allow shrink if there's a window on our right. diff -r 3c462fb496fc -r 0a356c1b7057 lisp/window.el --- a/lisp/window.el Mon Feb 09 00:49:54 2004 +0000 +++ b/lisp/window.el Mon Feb 09 00:52:41 2004 +0000 @@ -1,6 +1,6 @@ ;;; window.el --- GNU Emacs window commands aside from those written in C -;; Copyright (C) 1985, 1989, 1992, 1993, 1994, 2000, 2001, 2002 +;; Copyright (C) 1985, 1989, 1992, 1993, 1994, 2000, 2001, 2002, 2004 ;; Free Software Foundation, Inc. ;; Maintainer: FSF @@ -188,13 +188,11 @@ (defun window-safely-shrinkable-p (&optional window) "Non-nil if the WINDOW can be shrunk without shrinking other windows. If WINDOW is nil or omitted, it defaults to the currently selected window." - (save-selected-window - (when window (select-window window)) - (or (and (not (eq window (frame-first-window))) - (= (car (window-edges)) - (car (window-edges (previous-window))))) - (= (car (window-edges)) - (car (window-edges (next-window))))))) + (with-selected-window (or window (selected-window)) + (let ((edges (window-edges))) + (or (= (nth 2 edges) (nth 2 (window-edges (previous-window)))) + (= (nth 0 edges) (nth 0 (window-edges (next-window)))))))) + (defun balance-windows () "Make all visible windows the same height (approximately)."