From 625b3ee07c63c16a9167eecbac4e50f1224304db Mon Sep 17 00:00:00 2001 From: Phil Sainty Date: Sun, 31 Mar 2024 16:20:22 +1300 Subject: [PATCH] Prevent unwanted resizing when cycling through buffers in a window (ement-room-compose-buffer-window-auto-height): Do not resize a window which has just switched from some other buffer to a compose buffer, as we may in fact be in the middle of cycling through the available buffers, in which case it would be annoying for the window to suddenly change size along the way. --- ement-room.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ement-room.el b/ement-room.el index de4372f5..a25c40c4 100644 --- a/ement-room.el +++ b/ement-room.el @@ -4472,8 +4472,15 @@ Called via `post-command-hook' if option ;; so a more comprehensive solution, while possible, is not worth the added ;; complexity -- our relatively simplistic approach is good enough for the ;; vast majority of situations. + + ;; Skip resizing if we are being called recursively... (unless (or (bound-and-true-p ement-room-compose-buffer-window-auto-height-resizing-p) - (window-full-height-p)) + ;; ...or there are no other windows to resize... + (window-full-height-p) + ;; ...or we have just switched to this buffer from another buffer + ;; (we may be cycling window buffers, and about to switch again). + (and (window-old-buffer) + (not (eq (window-old-buffer) (current-buffer))))) ;; Manipulate the window body height. (let* ((pixelwise (and ement-room-compose-buffer-window-auto-height-pixelwise (display-graphic-p)))