# HG changeset patch # User Eli Zaretskii # Date 1287743731 -7200 # Node ID bfc9f85a0e9d8f83a1f53bf4e6bd14573c476adf # Parent 2f8137628e61bee8b91149020c11971118bd3272 Document values of window-system and deprecate its use as predicate. src/frame.c (Fframep, Fwindow_system): Deprecate use as a predicate. Document all values. src/dispnew.c (syms_of_display) : Deprecate use as a boolean flag. Document all values. src/display.texi (Window Systems): Deprecate use of window-system as a predicate. diff -r 2f8137628e61 -r bfc9f85a0e9d doc/lispref/ChangeLog --- a/doc/lispref/ChangeLog Thu Oct 21 08:33:47 2010 +0200 +++ b/doc/lispref/ChangeLog Fri Oct 22 12:35:31 2010 +0200 @@ -1,3 +1,8 @@ +2010-10-22 Eli Zaretskii + + * display.texi (Window Systems): Deprecate use of window-system as + a predicate. + 2010-09-05 Alexander Klimov (tiny change) * files.texi (Directory Names): Use \` rather than ^. diff -r 2f8137628e61 -r bfc9f85a0e9d doc/lispref/display.texi --- a/doc/lispref/display.texi Thu Oct 21 08:33:47 2010 +0200 +++ b/doc/lispref/display.texi Fri Oct 22 12:35:31 2010 +0200 @@ -5878,6 +5878,14 @@ one documented for the variable @code{window-system} above. @end defun + Do @emph{not} use @code{window-system} and +@code{initial-window-system} as predicates or boolean flag variables, +if you want to write code that works differently on text terminals and +graphic displays. That is because @code{window-system} is not a good +indicator of Emacs capabilities on a given display type. Instead, use +@code{display-graphic-p} or any of the other @code{display-*-p} +predicates described in @ref{Display Feature Testing}. + @defvar window-setup-hook This variable is a normal hook which Emacs runs after handling the initialization files. Emacs runs this hook after it has completed diff -r 2f8137628e61 -r bfc9f85a0e9d src/ChangeLog --- a/src/ChangeLog Thu Oct 21 08:33:47 2010 +0200 +++ b/src/ChangeLog Fri Oct 22 12:35:31 2010 +0200 @@ -1,3 +1,10 @@ +2010-10-22 Eli Zaretskii + + * frame.c (Fframep, Fwindow_system): Deprecate use as a predicate. + + * dispnew.c (syms_of_display) : + Deprecate use as a boolean flag. + 2010-10-18 Ken Brown * s/cygwin.h (SIGNALS_VIA_CHARACTERS): New define (bug#7225). diff -r 2f8137628e61 -r bfc9f85a0e9d src/dispnew.c --- a/src/dispnew.c Thu Oct 21 08:33:47 2010 +0200 +++ b/src/dispnew.c Fri Oct 22 12:35:31 2010 +0200 @@ -7141,13 +7141,29 @@ DEFVAR_LISP ("initial-window-system", &Vinitial_window_system, doc: /* Name of the window system that Emacs uses for the first frame. -The value is a symbol--for instance, `x' for X windows. -The value is nil if Emacs is using a text-only terminal. */); +The value is a symbol: + nil for a termcap frame (a character-only terminal), + 'x' for an Emacs frame that is really an X window, + 'w32' for an Emacs frame that is a window on MS-Windows display, + 'ns' for an Emacs frame on a GNUstep or Macintosh Cocoa display, + 'pc' for a direct-write MS-DOS frame. + +Use of this variable as a boolean is deprecated. Instead, +use `display-graphic-p' or any of the other `display-*-p' +predicates which report frame's specific UI-related capabilities. */); DEFVAR_KBOARD ("window-system", Vwindow_system, doc: /* Name of window system through which the selected frame is displayed. -The value is a symbol--for instance, `x' for X windows. -The value is nil if the selected frame is on a text-only-terminal. */); +The value is a symbol: + nil for a termcap frame (a character-only terminal), + 'x' for an Emacs frame that is really an X window, + 'w32' for an Emacs frame that is a window on MS-Windows display, + 'ns' for an Emacs frame on a GNUstep or Macintosh Cocoa display, + 'pc' for a direct-write MS-DOS frame. + +Use of this variable as a boolean is deprecated. Instead, +use `display-graphic-p' or any of the other `display-*-p' +predicates which report frame's specific UI-related capabilities. */); DEFVAR_LISP ("window-system-version", &Vwindow_system_version, doc: /* The version number of the window system in use. diff -r 2f8137628e61 -r bfc9f85a0e9d src/frame.c --- a/src/frame.c Thu Oct 21 08:33:47 2010 +0200 +++ b/src/frame.c Fri Oct 22 12:35:31 2010 +0200 @@ -211,11 +211,12 @@ DEFUN ("framep", Fframep, Sframep, 1, 1, 0, doc: /* Return non-nil if OBJECT is a frame. -Value is t for a termcap frame (a character-only terminal), -`x' for an Emacs frame that is really an X window, -`w32' for an Emacs frame that is a window on MS-Windows display, -`ns' for an Emacs frame on a GNUstep or Macintosh Cocoa display, -`pc' for a direct-write MS-DOS frame. +Value is: + t for a termcap frame (a character-only terminal), + 'x' for an Emacs frame that is really an X window, + 'w32' for an Emacs frame that is a window on MS-Windows display, + 'ns' for an Emacs frame on a GNUstep or Macintosh Cocoa display, + 'pc' for a direct-write MS-DOS frame. See also `frame-live-p'. */) (object) Lisp_Object object; @@ -259,8 +260,18 @@ DEFUN ("window-system", Fwindow_system, Swindow_system, 0, 1, 0, doc: /* The name of the window system that FRAME is displaying through. -The value is a symbol---for instance, 'x' for X windows. -The value is nil if Emacs is using a text-only terminal. +The value is a symbol: + nil for a termcap frame (a character-only terminal), + 'x' for an Emacs frame that is really an X window, + 'w32' for an Emacs frame that is a window on MS-Windows display, + 'ns' for an Emacs frame on a GNUstep or Macintosh Cocoa display, + 'pc' for a direct-write MS-DOS frame. + +FRAME defaults to the currently selected frame. + +Use of this function as a predicate is deprecated. Instead, +use `display-graphic-p' or any of the other `display-*-p' +predicates which report frame's specific UI-related capabilities. */) FRAME defaults to the currently selected frame. */) (frame)