From a147f96cc79e9eb63696eada341c3f9b87fd3dc3 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Wed, 17 Nov 2010 15:43:55 +0100 Subject: [PATCH] Fix sizing in display-buffer-split-window-1. Use quit-restore-window in compile.el. * window.el (display-buffer-split-window-1): Fix sizing for internal windows which got broken by the last fix. * progmodes/compile.el (compilation-minor-mode-map) (compilation-mode-map): Replace bindings for quit-window by bindings for quit-restore-window. --- lisp/ChangeLog | 9 +++++++++ lisp/progmodes/compile.el | 4 ++-- lisp/window.el | 15 ++++++++++++--- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b0c081d18b0..21d9883ba3d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2010-11-17 Martin Rudalics + + * window.el (display-buffer-split-window-1): Fix sizing for + internal windows which got broken by the last fix. + + * progmodes/compile.el (compilation-minor-mode-map) + (compilation-mode-map): Replace bindings for quit-window by + bindings for quit-restore-window. + 2010-11-16 Martin Rudalics * window.el (display-buffer-split-window-1) diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 830e137c5d4..6b0307f74ee 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1493,7 +1493,7 @@ Returns the compilation buffer created." (define-key map "\M-{" 'compilation-previous-file) (define-key map "\M-}" 'compilation-next-file) (define-key map "g" 'recompile) ; revert - (define-key map "q" 'quit-window) + (define-key map "q" 'quit-restore-window) ;; Set up the menu-bar (define-key map [menu-bar compilation] (cons "Errors" compilation-menu-map)) @@ -1539,7 +1539,7 @@ Returns the compilation buffer created." (define-key map "\t" 'compilation-next-error) (define-key map [backtab] 'compilation-previous-error) (define-key map "g" 'recompile) ; revert - (define-key map "q" 'quit-window) + (define-key map "q" 'quit-restore-window) (define-key map " " 'scroll-up) (define-key map "\^?" 'scroll-down) diff --git a/lisp/window.el b/lisp/window.el index 9b1f8b202d2..684f375179e 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -4801,21 +4801,30 @@ description." (max min-size (min (- old-size (window-min-size parent horflag)) (/ old-size + ;; Try to make the size of the new window + ;; proportional to the number of iso-arranged + ;; windows in the combination. (1+ (window-iso-combinations parent horflag)))))) (when (window-sizable-p parent (- new-size) horflag) (split-window window (- new-size) side))) ((window-live-p window) (setq new-size (/ old-size 2)) - ;; When WINDOW is live the old _and_ the new window must be at + ;; When WINDOW is live, the old _and_ the new window must be at ;; least MIN-SIZE large after the split. (when (and (>= new-size min-size) (window-sizable-p window (- new-size) horflag)) ;; Do an even split to make Stepan happy. (split-window window nil side))) (t - ;; When WINDOW is internal the new window must be at least + ;; When WINDOW is internal, the new window must be at least ;; MIN-SIZE large after the split. - (setq new-size (max min-size (/ old-size 2))) + (setq new-size + (max min-size + (/ old-size + ;; Try to make the size of the new window + ;; proportional to the number of iso-arranged + ;; subwindows of WINDOW. + (1+ (window-iso-combinations window horflag))))) (when (window-sizable-p window (- new-size) horflag) (split-window window (- new-size) side)))))) -- 2.39.5