diff options
| author | Po Lu | 2022-05-12 02:29:15 +0000 |
|---|---|---|
| committer | Po Lu | 2022-05-12 02:29:43 +0000 |
| commit | 2e2efe77226453ef76abc18f38a38b3fe069d314 (patch) | |
| tree | 3e8afd4ae3611be74662f292fff890fd4c83a512 /src | |
| parent | 30fa6da5529f80df25fcba49d10cd8a806774868 (diff) | |
| download | emacs-2e2efe77226453ef76abc18f38a38b3fe069d314.tar.gz emacs-2e2efe77226453ef76abc18f38a38b3fe069d314.zip | |
Clean up Haiku display opening code
* src/haikufns.c (Fx_open_connection):
(Fhaiku_frame_list_z_order): Improve error messages and fix
coding style.
Diffstat (limited to 'src')
| -rw-r--r-- | src/haikufns.c | 19 |
1 files changed, 7 insertions, 12 deletions
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, | |||
| 1998 | } | 1998 | } |
| 1999 | 1999 | ||
| 2000 | DEFUN ("x-open-connection", Fx_open_connection, Sx_open_connection, | 2000 | DEFUN ("x-open-connection", Fx_open_connection, Sx_open_connection, |
| 2001 | 1, 3, 0, | 2001 | 1, 3, 0, doc: /* SKIP: real doc in xfns.c. */) |
| 2002 | doc: /* SKIP: real doc in xfns.c. */) | ||
| 2003 | (Lisp_Object display, Lisp_Object resource_string, Lisp_Object must_succeed) | 2002 | (Lisp_Object display, Lisp_Object resource_string, Lisp_Object must_succeed) |
| 2004 | { | 2003 | { |
| 2005 | struct haiku_display_info *dpyinfo; | ||
| 2006 | CHECK_STRING (display); | 2004 | CHECK_STRING (display); |
| 2007 | 2005 | ||
| 2008 | if (NILP (Fstring_equal (display, build_string ("be")))) | 2006 | if (NILP (Fstring_equal (display, build_string ("be")))) |
| 2009 | { | 2007 | { |
| 2010 | if (!NILP (must_succeed)) | 2008 | if (!NILP (must_succeed)) |
| 2011 | fatal ("Bad display"); | 2009 | fatal ("Invalid display %s", SDATA (display)); |
| 2012 | else | 2010 | else |
| 2013 | error ("Bad display"); | 2011 | signal_error ("Invalid display", display); |
| 2014 | } | 2012 | } |
| 2015 | 2013 | ||
| 2016 | if (x_display_list) | 2014 | if (x_display_list) |
| 2017 | return Qnil; | ||
| 2018 | |||
| 2019 | dpyinfo = haiku_term_init (); | ||
| 2020 | |||
| 2021 | if (!dpyinfo) | ||
| 2022 | { | 2015 | { |
| 2023 | if (!NILP (must_succeed)) | 2016 | if (!NILP (must_succeed)) |
| 2024 | fatal ("Display not responding"); | 2017 | fatal ("A display is already open"); |
| 2025 | else | 2018 | else |
| 2026 | error ("Display not responding"); | 2019 | error ("A display is already open"); |
| 2027 | } | 2020 | } |
| 2028 | 2021 | ||
| 2022 | haiku_term_init (); | ||
| 2029 | return Qnil; | 2023 | return Qnil; |
| 2030 | } | 2024 | } |
| 2031 | 2025 | ||
| @@ -2687,6 +2681,7 @@ Frames are listed from topmost (first) to bottommost (last). */) | |||
| 2687 | 2681 | ||
| 2688 | if (NILP (sel)) | 2682 | if (NILP (sel)) |
| 2689 | return frames; | 2683 | return frames; |
| 2684 | |||
| 2690 | return Fcons (sel, frames); | 2685 | return Fcons (sel, frames); |
| 2691 | } | 2686 | } |
| 2692 | 2687 | ||