Subject: bug#30320: 26.0.91; Crash when using lsp-ui-doc-mode

From: martin rudalics <[email-masked]>
Date: Sun, 11 Feb 2018 10:36:10 +0100

>> Maybe a simpler fix would be to process the 'min-width' and
 >> 'min-height' frame parameters for graphic frames only.
 >
 > But then we will not be able to resize TTY frames, is that true?  I
 > think that ability is a feature we shouldn't lose, as it could be
 > useful, certainly with terminal emulators.

Don't worry.  The attached patch will make Emacs 26 behave just like
its predecessors with TTY frames.

The 'min-width' and 'min-height' parameters have been added to allow
people to shrink frames to one line just as they can do with tooltip
frames.  They hardly make sense for TTY frames.

martin
diff --git a/src/frame.c b/src/frame.c
index d5b080d..ecab7fe 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -350,10 +350,13 @@ struct frame *
   struct frame *f = XFRAME (frame);
   Lisp_Object par_size;
 
-  if ((!NILP (horizontal)
-       && NUMBERP (par_size = get_frame_param (f, Qmin_width)))
-      || (NILP (horizontal)
-	  && NUMBERP (par_size = get_frame_param (f, Qmin_height))))
+  /* The 'min-width' and 'min-height' parameters have no effect on TTY
+     frames.  */
+  if (!(FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f))
+      && ((!NILP (horizontal)
+	   && NUMBERP (par_size = get_frame_param (f, Qmin_width)))
+	  || (NILP (horizontal)
+	      && NUMBERP (par_size = get_frame_param (f, Qmin_height)))))
     {
       int min_size = XINT (par_size);