all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* check_window_system
@ 2013-04-05 14:33 Eli Zaretskii
  2013-04-05 15:21 ` check_window_system Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2013-04-05 14:33 UTC (permalink / raw
  To: Dmitry Antipov; +Cc: emacs-devel

I think these changes

  ------------------------------------------------------------
  revno: 112228
  committer: Dmitry Antipov <dmantipov@yandex.ru>
  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.




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-04-07 15:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-05 14:33 check_window_system Eli Zaretskii
2013-04-05 15:21 ` check_window_system Stefan Monnier
2013-04-06 10:13   ` check_window_system Dmitry Antipov
2013-04-06 12:19     ` check_window_system Eli Zaretskii
2013-04-07 15:49       ` check_window_system Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.