From a3f3cd7c4a79ba54f00ebd8424db3137f297517b Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Sat, 22 Aug 2015 10:22:26 +0200 Subject: [PATCH] =?utf8?q?In=20=E2=80=98adjust-window-trailing-edge?= =?utf8?q?=E2=80=99=20fix=20bug=20with=20size-preserved=20windows.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * lisp/window.el (adjust-window-trailing-edge): Fix bug where this function refused to resize a size-preserved window. --- ChangeLog.2 | 2 -- lisp/window.el | 14 ++++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ChangeLog.2 b/ChangeLog.2 index 3a93fda6f67..242cf6b59a0 100644 --- a/ChangeLog.2 +++ b/ChangeLog.2 @@ -3151,8 +3151,6 @@ 2015-06-18 Martin Rudalics - Fix last fix" - Set image_cache_refcount before x_default_parameter calls. (Bug#20802) * src/nsfns.m (Fx_create_frame): * src/xfns.c (Fx_create_frame, x_create_tip_frame): Move setting diff --git a/lisp/window.el b/lisp/window.el index d39c7018601..f198d78cc4c 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -3160,7 +3160,7 @@ move it as far as possible in the desired direction." (let* ((frame (window-frame window)) (minibuffer-window (minibuffer-window frame)) (right window) - left this-delta min-delta max-delta ignore) + left first-left first-right this-delta min-delta max-delta ignore) (unless pixelwise (setq pixelwise t) @@ -3188,6 +3188,7 @@ move it as far as possible in the desired direction." (t ;; Set LEFT to the first resizable window on the left. This step is ;; needed to handle fixed-size windows. + (setq first-left left) (while (and left (or (window-size-fixed-p left horizontal) (and (< delta 0) @@ -3200,8 +3201,10 @@ move it as far as possible in the desired direction." (not (window-combined-p left horizontal)))) (window-left left))))) (unless left + ;; We have to resize a size-preserved window. Start again with + ;; the window initially on the left. (setq ignore 'preserved) - (setq left window) + (setq left first-left) (while (and left (or (window-size-fixed-p left horizontal 'preserved) (<= (window-size left horizontal t) @@ -3220,6 +3223,7 @@ move it as far as possible in the desired direction." ;; Set RIGHT to the first resizable window on the right. This step ;; is needed to handle fixed-size windows. + (setq first-right right) (while (and right (or (window-size-fixed-p right horizontal) (and (> delta 0) @@ -3232,12 +3236,14 @@ move it as far as possible in the desired direction." (not (window-combined-p right horizontal)))) (window-right right))))) (unless right + ;; We have to resize a size-preserved window. Start again with + ;; the window initially on the right. (setq ignore 'preserved) - (setq right (window-right window)) + (setq right first-right) (while (and right (or (window-size-fixed-p right horizontal 'preserved)) (<= (window-size right horizontal t) - (window-min-size right horizontal nil t))) + (window-min-size right horizontal 'preserved t))) (setq right (or (window-right right) (progn -- 2.39.2