Mercurial > emacs
comparison lisp/window.el @ 53894:0a356c1b7057
(window-safely-shrinkable-p): Don't change the buffer-list.
Don't allow shrink if there's a window on our right.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Mon, 09 Feb 2004 00:52:41 +0000 |
parents | de1a002c48c7 |
children | 10dc0a48bc2c |
comparison
equal
deleted
inserted
replaced
53893:3c462fb496fc | 53894:0a356c1b7057 |
---|---|
1 ;;; window.el --- GNU Emacs window commands aside from those written in C | 1 ;;; window.el --- GNU Emacs window commands aside from those written in C |
2 | 2 |
3 ;; Copyright (C) 1985, 1989, 1992, 1993, 1994, 2000, 2001, 2002 | 3 ;; Copyright (C) 1985, 1989, 1992, 1993, 1994, 2000, 2001, 2002, 2004 |
4 ;; Free Software Foundation, Inc. | 4 ;; Free Software Foundation, Inc. |
5 | 5 |
6 ;; Maintainer: FSF | 6 ;; Maintainer: FSF |
7 ;; Keywords: internal | 7 ;; Keywords: internal |
8 | 8 |
186 count)) | 186 count)) |
187 | 187 |
188 (defun window-safely-shrinkable-p (&optional window) | 188 (defun window-safely-shrinkable-p (&optional window) |
189 "Non-nil if the WINDOW can be shrunk without shrinking other windows. | 189 "Non-nil if the WINDOW can be shrunk without shrinking other windows. |
190 If WINDOW is nil or omitted, it defaults to the currently selected window." | 190 If WINDOW is nil or omitted, it defaults to the currently selected window." |
191 (save-selected-window | 191 (with-selected-window (or window (selected-window)) |
192 (when window (select-window window)) | 192 (let ((edges (window-edges))) |
193 (or (and (not (eq window (frame-first-window))) | 193 (or (= (nth 2 edges) (nth 2 (window-edges (previous-window)))) |
194 (= (car (window-edges)) | 194 (= (nth 0 edges) (nth 0 (window-edges (next-window)))))))) |
195 (car (window-edges (previous-window))))) | 195 |
196 (= (car (window-edges)) | |
197 (car (window-edges (next-window))))))) | |
198 | 196 |
199 (defun balance-windows () | 197 (defun balance-windows () |
200 "Make all visible windows the same height (approximately)." | 198 "Make all visible windows the same height (approximately)." |
201 (interactive) | 199 (interactive) |
202 (let ((count -1) levels newsizes level-size | 200 (let ((count -1) levels newsizes level-size |