emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

check_window_system


From: Eli Zaretskii
Subject: check_window_system
Date: Fri, 05 Apr 2013 17:33:31 +0300

I think these changes

  ------------------------------------------------------------
  revno: 112228
  committer: Dmitry Antipov <address@hidden>
  branch nick: trunk
  timestamp: Fri 2013-04-05 14:07:02 +0000
  message:
    Consistently use platform-specific function to detect window system.
    * lisp.h (check_window_system): New prototype.  This function is
    going to replace check_x, check_w32 and check_ns.
    (have_menus_p): Mention msdos.c in comment.
    * fontset.c (check_window_system_func): Remove.  Adjust all users.
    * fontset.h (check_window_system_func): Remove prototype.
    * nsterm.h (check_ns):
    * xterm.h (check_x):
    * w32term.h (check_w32): Likewise.
    * menu.c (Fx_popup_menu): Use check_window_system.
    * msdos.c (check_window_system): Define for MS-DOS.
    * nsfns.m (check_window_system): Define for NS.  Adjust all users.
    * w32fns.c (check_window_system): Likewise for MS-Windows.
    * xfns.c (check_window_system): Likewise for X.
    * font.c, frame.c, nsmenu.m, nsselect.m, nsterm.m, w32menu.c:
    * xfaces.c, xmenu.c: Use check_window_system where appropriate.

go against our tendency to replace window-system tests at compile time
with run-time tests for frame type (FRAME_X_P, FRAME_NS_P, etc.).
Thus, after the changes above, we have 4 different implementations of
the same function check_window_system, which means it would be
impossible to have, say, X and NS frames in the same binary/session.

Instead, check_window_system should have been implemented only once,
in some common source file, and it should have been doing something
like this:

  #ifdef HAVE_X_WINDOWS
    if (FRAME_X_P (f))
      check_x ();
  #endif
  #ifdef HAVE_NS
    if (FRAME_NS_P (f))
      check_ns ();
  #endif

etc., you get the idea.  IOW, there should be no assumption that X,
NS, and w32 are mutually exclusive.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]