|
From: | Carsten Dominik |
Subject: | bug#1806: dired-pop-to-buffer in wrong place |
Date: | Thu, 8 Jan 2009 12:52:04 +0100 |
On Jan 7, 2009, at 11:27 AM, martin rudalics wrote:
Hi Martin, org-mode already protects itself against this possibility, I think: Here is my code: (defun org-fit-window-to-buffer (&optional window max-height min-height shrink-only) "Fit WINDOW to the buffer, but only if it is not a side-by-side window. WINDOW defaults to the selected window. MAX-HEIGHT and MIN-HEIGHT are passed through to `fit-window-to-buffer'. If SHRINK-ONLY is set, call `shrink-window-if-larger-than-buffer' instead, the hight limit are ignored in this case." (cond ((> (frame-width) (window-width window)) ;; do nothing if another window would suffer ) ((and (fboundp 'fit-window-to-buffer) (not shrink-only)) (fit-window-to-buffer window max-height min-height)) ((fboundp 'shrink-window-if-larger-than-buffer) (shrink-window-if-larger-than-buffer window))) (or window (selected-window))) If the current window is not the full frame width, I do not adjust its size because it would shink other windows along with it. - Carsten
|
[Prev in Thread] | Current Thread | [Next in Thread] |