changeset 111155:bfc9f85a0e9d

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) <initial-window-system, window-system>: Deprecate use as a boolean flag. Document all values. src/display.texi (Window Systems): Deprecate use of window-system as a predicate.
author Eli Zaretskii <eliz@gnu.org>
date Fri, 22 Oct 2010 12:35:31 +0200
parents 2f8137628e61
children 11b664cef40f
files doc/lispref/ChangeLog doc/lispref/display.texi src/ChangeLog src/dispnew.c src/frame.c
diffstat 5 files changed, 58 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- 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  <eliz@gnu.org>
+
+	* display.texi (Window Systems): Deprecate use of window-system as
+	a predicate.
+
 2010-09-05  Alexander Klimov  <alserkli@inbox.ru>  (tiny change)
 
 	* files.texi (Directory Names): Use \` rather than ^.
--- 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
--- 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  <eliz@gnu.org>
+
+	* frame.c (Fframep, Fwindow_system): Deprecate use as a predicate.
+
+	* dispnew.c (syms_of_display) <initial-window-system, window-system>:
+	Deprecate use as a boolean flag.
+
 2010-10-18  Ken Brown  <kbrown@cornell.edu>
 
 	* s/cygwin.h (SIGNALS_VIA_CHARACTERS): New define (bug#7225).
--- 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.
--- 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)