Subject: bug#32825: 27.0.50; Deterministic window management

From: Juri Linkov <[email-masked]>
Date: Tue, 30 Oct 2018 23:18:51 +0200

>> That's now something that display-buffer-alist can't do: keep the
>> default action(s), but specify parameters, like a larger
>> window-min-height.  I mean, there is no way to change that value unless
>> you around-advice the whole function.
>
> The caller of 'display-buffer' could bind 'window-min-height' to
> another value around the call.  But that's a bad idea because it may
> override a user customization and because a high value would not allow
> a window to be created even if other windows would tolerate the lower
> value while a low value would allow other windows to shrink to that
> value as well when a new window is created.
>
> Couldn't setting a 'window-height' action alist entry help here?
> Maybe with a suitable function?

I still don't understand why it's impossible to support such uses?

diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index 7fc2b41c70..6d72616dbc 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -239,11 +239,13 @@ debug
 	      (pop-to-buffer
 	       debugger-buffer
 	       `((display-buffer-reuse-window
-		  display-buffer-in-previous-window)
-		 . (,(when (and (window-live-p debugger-previous-window)
-				(frame-visible-p
-				 (window-frame debugger-previous-window)))
-		       `(previous-window . ,debugger-previous-window)))))
+		  display-buffer-in-previous-window
+		  display-buffer-below-selected)
+		 . ((window-min-height . 10)
+		    ,@(when (and (window-live-p debugger-previous-window)
+				 (frame-visible-p
+				  (window-frame debugger-previous-window)))
+		        `((previous-window . ,debugger-previous-window))))))
 	      (setq debugger-window (selected-window))
 	      (if (eq debugger-previous-window debugger-window)
 		  (when debugger-jumping-flag