From: Po Lu Date: Thu, 12 May 2022 02:29:15 +0000 (+0000) Subject: Clean up Haiku display opening code X-Git-Tag: emacs-29.0.90~1910^2~772 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2e2efe77226453ef76abc18f38a38b3fe069d314;p=emacs.git Clean up Haiku display opening code * src/haikufns.c (Fx_open_connection): (Fhaiku_frame_list_z_order): Improve error messages and fix coding style. --- diff --git a/src/haikufns.c b/src/haikufns.c index 0abb4188955..13432785bd3 100644 --- a/src/haikufns.c +++ b/src/haikufns.c @@ -1998,34 +1998,28 @@ DEFUN ("x-display-grayscale-p", Fx_display_grayscale_p, Sx_display_grayscale_p, } DEFUN ("x-open-connection", Fx_open_connection, Sx_open_connection, - 1, 3, 0, - doc: /* SKIP: real doc in xfns.c. */) + 1, 3, 0, doc: /* SKIP: real doc in xfns.c. */) (Lisp_Object display, Lisp_Object resource_string, Lisp_Object must_succeed) { - struct haiku_display_info *dpyinfo; CHECK_STRING (display); if (NILP (Fstring_equal (display, build_string ("be")))) { if (!NILP (must_succeed)) - fatal ("Bad display"); + fatal ("Invalid display %s", SDATA (display)); else - error ("Bad display"); + signal_error ("Invalid display", display); } if (x_display_list) - return Qnil; - - dpyinfo = haiku_term_init (); - - if (!dpyinfo) { if (!NILP (must_succeed)) - fatal ("Display not responding"); + fatal ("A display is already open"); else - error ("Display not responding"); + error ("A display is already open"); } + haiku_term_init (); return Qnil; } @@ -2687,6 +2681,7 @@ Frames are listed from topmost (first) to bottommost (last). */) if (NILP (sel)) return frames; + return Fcons (sel, frames); }