changeset 83342:9216636c02fc

Rename `struct display' to `struct device'. Update function, parameter and variable names accordingly. * src/termhooks.h (struct device): Rename to `struct device'. Rename member `next_display' to `next_device'. Rename member `delete_display_hook' to `delete_device_hook'. (FRAME_DISPLAY): Rename to FRAME_DEVICE. (DISPLAY_ACTIVE_P): Rename to DEVICE_ACTIVE_P. (DISPLAY_TERMINAL_CODING): Rename to DEVICE_TERMINAL_CODING. (DISPLAY_KEYBOARD_CODING): Rename to DEVICE_KEYBOARD_CODING. * src/frame.h (stuct frame): Rename `display' member to `device'. * src/xterm.h (x_display_info): Rename member `frame_display' to `device'. * src/termchar.h (struct tty_display_info): Rename `display' member to `device'. * src/keyboard.c (push_display_kboard): Rename to push_device_kboard. * lisp/frame.el (make-frame): Rename frame parameter `display-id' to `device'. * src/frame.c (Fmake_terminal_frame): Ditto. * src/xfns.c (Fx_create_frame): Ditto. * src/term.c (display_list): Rename to device_list. * src/term.c (initial_display): Rename to initial_device. * src/term.c (next_display_id): Rename to next_device_id. * src/term.c (get_display): Rename to get_device. * src/term.c (get_tty_display): Rename to get_tty_device. * src/term.c (get_named_tty_display): Rename to get_named_tty. * src/term.c (init_initial_display): Rename to init_initial_device. * src/term.c (delete_initial_display): Rename to delete_initial_device. * src/term.c (create_display): Rename to create_device. * src/term.c (delete_display): Rename to delete_device. * src/xfns.c (check_x_display_info): Document that the function allows display ids as well. * src/xterm.c (x_delete_frame_display): Rename to x_delete_device. * src/xterm.c (x_create_frame_display): Rename to x_create_device. * src/coding.c: Update. * src/dispextern.h: Update. * src/data.c: Update. * src/dispnew.c: Update. * src/frame.c: Update. * src/frame.h: Update. * src/keyboard.c: Update. * src/keyboard.h: Update. * src/lisp.h: Update. * src/sysdep.c: Update. * src/term.c: Update. * src/xdisp.c: Update. * src/xselect.c: Update. * src/xterm.c: Update. * src/prefix-args.c: Include stdlib.h for exit. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-382
author Karoly Lorentey <lorentey@elte.hu>
date Mon, 11 Jul 2005 00:05:55 +0000
parents 76e51706154e
children ccccb663aed3
files README.multi-tty lisp/frame.el src/coding.c src/data.c src/dispextern.h src/dispnew.c src/frame.c src/frame.h src/keyboard.c src/keyboard.h src/lisp.h src/prefix-args.c src/sysdep.c src/term.c src/termchar.h src/termhooks.h src/xdisp.c src/xfns.c src/xselect.c src/xterm.c src/xterm.h
diffstat 21 files changed, 676 insertions(+), 676 deletions(-) [+]
line wrap: on
line diff
--- a/README.multi-tty	Sun Jul 10 22:25:28 2005 +0000
+++ b/README.multi-tty	Mon Jul 11 00:05:55 2005 +0000
@@ -461,6 +461,7 @@
     display-name                        terminal-name
     display-tty-type                    terminal-tty-type
     frame-display                       terminal-of-frame
+    delete-display			delete-terminal
 
 ** The semantics of terminal-local variables are confusing; it is not
    clear what binding is in effect in any given time.  See if
--- a/lisp/frame.el	Sun Jul 10 22:25:28 2005 +0000
+++ b/lisp/frame.el	Mon Jul 11 00:05:55 2005 +0000
@@ -640,7 +640,7 @@
  (window-system . nil)	The frame should be displayed on a terminal device.
  (window-system . x)	The frame should be displayed in an X window.
 
- (display-id . ID)      The frame should use the display identified by ID.
+ (device . ID)          The frame should use the display device identified by ID.
 
 Before the frame is created (via `frame-creation-function-alist'), functions on the
 hook `before-make-frame-hook' are run.  After the frame is created, functions
@@ -653,11 +653,11 @@
 setup is for focus to follow the pointer."
   (interactive)
   (let* ((w (cond
-	     ((assq 'display-id parameters)
-	      (let ((type (display-live-p (cdr (assq 'display-id parameters)))))
+	     ((assq 'device parameters)
+	      (let ((type (display-live-p (cdr (assq 'device parameters)))))
 		(cond
 		 ((eq type t) nil)
-		 ((eq type nil) (error "Display %s does not exist" (cdr (assq 'display-id parameters))))
+		 ((eq type nil) (error "Display %s does not exist" (cdr (assq 'device parameters))))
 		 (t type))))
 	     ((assq 'window-system parameters)
 	      (cdr (assq 'window-system parameters)))
--- a/src/coding.c	Sun Jul 10 22:25:28 2005 +0000
+++ b/src/coding.c	Mon Jul 11 00:05:55 2005 +0000
@@ -7307,11 +7307,11 @@
 DEFUN ("set-terminal-coding-system-internal", Fset_terminal_coding_system_internal,
        Sset_terminal_coding_system_internal, 1, 2, 0,
        doc: /* Internal use only.  */)
-     (coding_system, display)
+     (coding_system, device)
      Lisp_Object coding_system;
-     Lisp_Object display;
+     Lisp_Object device;
 {
-  struct coding_system *terminal_coding = DISPLAY_TERMINAL_CODING (get_display (display, 1));
+  struct coding_system *terminal_coding = DEVICE_TERMINAL_CODING (get_device (device, 1));
   CHECK_SYMBOL (coding_system);
   setup_coding_system (Fcheck_coding_system (coding_system), terminal_coding);
   /* We had better not send unsafe characters to terminal.  */
@@ -7345,38 +7345,39 @@
 
 DEFUN ("terminal-coding-system", Fterminal_coding_system,
        Sterminal_coding_system, 0, 1, 0,
-       doc: /* Return coding system specified for terminal output on the given display.
-DISPLAY may be a display id, a frame, or nil for the selected frame's display.  */)
-     (display)
-     Lisp_Object display;
+       doc: /* Return coding system specified for terminal output on the given device.
+DEVICE may be a display device id, a frame, or nil for the selected
+frame's display device.  */)
+     (device)
+     Lisp_Object device;
 {
-  return DISPLAY_TERMINAL_CODING (get_display (display, 1))->symbol;
+  return DEVICE_TERMINAL_CODING (get_device (device, 1))->symbol;
 }
 
 DEFUN ("set-keyboard-coding-system-internal", Fset_keyboard_coding_system_internal,
        Sset_keyboard_coding_system_internal, 1, 2, 0,
        doc: /* Internal use only.  */)
-     (coding_system, display)
+     (coding_system, device)
      Lisp_Object coding_system;
-     Lisp_Object display;
+     Lisp_Object device;
 {
-  struct display *d = get_display (display, 1);
+  struct device *d = get_device (device, 1);
   CHECK_SYMBOL (coding_system);
 
   setup_coding_system (Fcheck_coding_system (coding_system),
-                       DISPLAY_KEYBOARD_CODING (d));
+                       DEVICE_KEYBOARD_CODING (d));
   /* Character composition should be disabled.  */
-  DISPLAY_KEYBOARD_CODING (d)->composing = COMPOSITION_DISABLED;
+  DEVICE_KEYBOARD_CODING (d)->composing = COMPOSITION_DISABLED;
   return Qnil;
 }
 
 DEFUN ("keyboard-coding-system", Fkeyboard_coding_system,
        Skeyboard_coding_system, 0, 1, 0,
        doc: /* Return coding system specified for decoding keyboard input.  */)
-     (display)
-     Lisp_Object display;
+     (device)
+     Lisp_Object device;
 {
-  return DISPLAY_KEYBOARD_CODING (get_display (display, 1))->symbol;
+  return DEVICE_KEYBOARD_CODING (get_device (device, 1))->symbol;
 }
 
 
--- a/src/data.c	Sun Jul 10 22:25:28 2005 +0000
+++ b/src/data.c	Mon Jul 11 00:05:55 2005 +0000
@@ -1876,39 +1876,42 @@
   return Qnil;
 }
 
-extern struct display *get_display P_ ((Lisp_Object display, int));
+extern struct device *get_device P_ ((Lisp_Object display, int));
 
 DEFUN ("terminal-local-value", Fterminal_local_value, Sterminal_local_value, 2, 2, 0,
-       doc: /* Return the terminal-local value of SYMBOL on DISPLAY.
+       doc: /* Return the terminal-local value of SYMBOL on DEVICE.
 If SYMBOL is not a terminal-local variable, then return its normal
 value, like `symbol-value'.
 
-DISPLAY may be a display, a frame, or nil (meaning the selected
-frame's display).  */)
-  (symbol, display)
+DEVICE may be a display device id, a frame, or nil (meaning the
+selected frame's display device).  */)
+  (symbol, device)
      Lisp_Object symbol;
-     Lisp_Object display;
+     Lisp_Object device;
 {
   Lisp_Object result;
-  struct display *d = get_display (display, 1);
-  push_display_kboard (d);
+  struct device *d = get_device (device, 1);
+  push_device_kboard (d);
   result = Fsymbol_value (symbol);
   pop_frame_kboard ();
   return result;
 }
 
 DEFUN ("set-terminal-local-value", Fset_terminal_local_value, Sset_terminal_local_value, 3, 3, 0,
-       doc: /* Set the terminal-local binding of SYMBOL on DISPLAY to VALUE.
+       doc: /* Set the terminal-local binding of SYMBOL on DEVICE to VALUE.
 If VARIABLE is not a terminal-local variable, then set its normal
-binding, like `set'.  */)
-  (symbol, display, value)
+binding, like `set'.
+
+DEVICE may be a display device id, a frame, or nil (meaning the
+selected frame's display device).  */)
+  (symbol, device, value)
      Lisp_Object symbol;
-     Lisp_Object display;
+     Lisp_Object device;
      Lisp_Object value;
 {
   Lisp_Object result;
-  struct display *d = get_display (display, 1);
-  push_display_kboard (d);
+  struct device *d = get_device (device, 1);
+  push_device_kboard (d);
   result = Fset (symbol, value);
   pop_frame_kboard ();
   return result;
--- a/src/dispextern.h	Sun Jul 10 22:25:28 2005 +0000
+++ b/src/dispextern.h	Mon Jul 11 00:05:55 2005 +0000
@@ -2929,17 +2929,17 @@
 extern void calculate_costs P_ ((struct frame *));
 extern void set_tty_color_mode P_ ((struct frame *, Lisp_Object));
 extern void tty_setup_colors P_ ((struct tty_display_info *, int));
-extern struct display *get_display P_ ((Lisp_Object display, int));
-extern struct display *get_named_tty_display P_ ((char *));
+extern struct device *get_device P_ ((Lisp_Object display, int));
+extern struct device *get_named_tty P_ ((char *));
 EXFUN (Fdisplay_tty_type, 1);
-extern struct display *init_initial_display P_ ((void));
-extern struct display *init_tty P_ ((char *, char *, int));
-extern void delete_tty P_ ((struct display *));
+extern struct device *init_initial_device P_ ((void));
+extern struct device *init_tty P_ ((char *, char *, int));
+extern void delete_tty P_ ((struct device *));
 extern void fatal P_ ((/* char *, ... */));
 extern void cursor_to P_ ((struct frame *, int, int));
 extern int tty_capable_p P_ ((struct tty_display_info *, unsigned, unsigned long, unsigned long));
-extern void tty_set_terminal_modes P_ ((struct display *));
-extern void tty_reset_terminal_modes P_ ((struct display *));
+extern void tty_set_terminal_modes P_ ((struct device *));
+extern void tty_reset_terminal_modes P_ ((struct device *));
 extern void create_tty_output P_ ((struct frame *));
 
 
--- a/src/dispnew.c	Sun Jul 10 22:25:28 2005 +0000
+++ b/src/dispnew.c	Mon Jul 11 00:05:55 2005 +0000
@@ -3343,7 +3343,7 @@
   update_begin (f);
 #ifdef MSDOS
   if (FRAME_MSDOS_P (f))
-    set_terminal_modes (FRAME_DISPLAY (f));
+    set_terminal_modes (FRAME_DEVICE (f));
 #endif
   clear_frame (f);
   clear_current_matrices (f);
@@ -6723,7 +6723,7 @@
 #endif /* VMS */
 
   {
-    struct display *d;
+    struct device *d;
     struct frame *f = XFRAME (selected_frame);
 
     /* Open a display on the controlling tty. */
@@ -6733,16 +6733,16 @@
     if (f->output_method != output_initial)
       abort ();
     f->output_method = d->type;
-    f->display = d;
+    f->device = d;
 
     d->reference_count++;
     d->display_info.tty->top_frame = selected_frame;
     change_frame_size (XFRAME (selected_frame), FrameRows (d->display_info.tty), FrameCols (d->display_info.tty), 0, 0, 1);
 
     /* Delete the initial display. */
-    if (--initial_display->reference_count == 0
-        && initial_display->delete_display_hook)
-      (*initial_display->delete_display_hook) (initial_display);
+    if (--initial_device->reference_count == 0
+        && initial_device->delete_device_hook)
+      (*initial_device->delete_device_hook) (initial_device);
 
     /* Update frame parameters to reflect the new type. */
     Fmodify_frame_parameters
--- a/src/frame.c	Sun Jul 10 22:25:28 2005 +0000
+++ b/src/frame.c	Mon Jul 11 00:05:55 2005 +0000
@@ -76,7 +76,7 @@
 
 Lisp_Object Qx_frame_parameter;
 Lisp_Object Qx_resource_name;
-Lisp_Object Qdisplay_id;
+Lisp_Object Qdevice;
 Lisp_Object Qdisplay_live_p;
 
 /* Frame parameters (set or reported).  */
@@ -422,7 +422,7 @@
 
 #ifdef MULTI_KBOARD
   if (!NILP (mini_window)
-      && XFRAME (XWINDOW (mini_window)->frame)->display->kboard != kb)
+      && XFRAME (XWINDOW (mini_window)->frame)->device->kboard != kb)
     error ("Frame and minibuffer must be on the same display");
 #endif
 
@@ -507,7 +507,7 @@
 make_initial_frame (void)
 {
   struct frame *f;
-  struct display *display;
+  struct device *device;
   Lisp_Object frame;
 
 #ifdef MULTI_KBOARD
@@ -525,7 +525,7 @@
   if (! (NILP (Vframe_list) || CONSP (Vframe_list)))
     Vframe_list = Qnil;
 
-  display = init_initial_display ();
+  device = init_initial_device ();
 
   f = make_frame (1);
   XSETFRAME (frame, f);
@@ -538,9 +538,9 @@
   f->visible = 1;
   f->async_visible = 1;
 
-  f->output_method = display->type;
-  f->display = display;
-  f->display->reference_count++;
+  f->output_method = device->type;
+  f->device = device;
+  f->device->reference_count++;
   f->output_data.nothing = 0;
   
   FRAME_FOREGROUND_PIXEL (f) = FACE_TTY_DEFAULT_FG_COLOR;
@@ -554,7 +554,7 @@
 
 
 struct frame *
-make_terminal_frame (struct display *display)
+make_terminal_frame (struct device *device)
 {
   register struct frame *f;
   Lisp_Object frame;
@@ -605,8 +605,8 @@
 #else
   {
     f->output_method = output_termcap;
-    f->display = display;
-    f->display->reference_count++;
+    f->device = device;
+    f->device->reference_count++;
     create_tty_output (f);
     
     FRAME_FOREGROUND_PIXEL (f) = FACE_TTY_DEFAULT_FG_COLOR;
@@ -658,7 +658,7 @@
      Lisp_Object parms;
 {
   struct frame *f;
-  struct display *d = NULL;
+  struct device *d = NULL;
   Lisp_Object frame, tem;
   struct frame *sf = SELECTED_FRAME ();
 
@@ -682,12 +682,12 @@
   {
     Lisp_Object display_device;
 
-    display_device = Fassq (Qdisplay_id, parms);
+    display_device = Fassq (Qdevice, parms);
     if (!NILP (display_device))
       {
         display_device = XCDR (display_device);
         CHECK_NUMBER (display_device);
-        d = get_display (XINT (display_device), 1);
+        d = get_device (XINT (display_device), 1);
       }
   }
   
@@ -1053,14 +1053,14 @@
   (frame)
      Lisp_Object frame;
 {
-  struct display *d;
+  struct device *d;
 
   if (NILP (frame))
     frame = selected_frame;
 
   CHECK_LIVE_FRAME (frame);
 
-  d = get_display (frame, 0);
+  d = get_device (frame, 0);
 
   if (!d)
     return Qnil;
@@ -1502,27 +1502,27 @@
      promise that the display of the frame must be valid until we have
      called the window-system-dependent frame destruction routine.  */
 
-  if (FRAME_DISPLAY (f)->delete_frame_hook)
-    (*FRAME_DISPLAY (f)->delete_frame_hook) (f);
+  if (FRAME_DEVICE (f)->delete_frame_hook)
+    (*FRAME_DEVICE (f)->delete_frame_hook) (f);
 
   {
-    struct display *display = FRAME_DISPLAY (f);
+    struct device *device = FRAME_DEVICE (f);
     f->output_data.nothing = 0; 
-    f->display = 0;             /* Now the frame is dead. */
+    f->device = 0;             /* Now the frame is dead. */
 
     /* If needed, delete the device that this frame was on.
        (This must be done after the frame is killed.) */
-    display->reference_count--;
-    if (display->reference_count == 0)
+    device->reference_count--;
+    if (device->reference_count == 0)
       {
         kb = NULL;
-        if (display->delete_display_hook)
-          (*display->delete_display_hook) (display);
+        if (device->delete_device_hook)
+          (*device->delete_device_hook) (device);
         else
-          delete_display (display);
+          delete_device (device);
       }
     else
-      kb = display->kboard;
+      kb = device->kboard;
   }
 
   /* If we've deleted the last_nonminibuf_frame, then try to find
@@ -1669,8 +1669,8 @@
 
 #ifdef HAVE_MOUSE
   /* It's okay for the hook to refrain from storing anything.  */
-  if (FRAME_DISPLAY (f)->mouse_position_hook)
-    (*FRAME_DISPLAY (f)->mouse_position_hook) (&f, -1,
+  if (FRAME_DEVICE (f)->mouse_position_hook)
+    (*FRAME_DEVICE (f)->mouse_position_hook) (&f, -1,
                                               &lispy_dummy, &party_dummy,
                                               &x, &y,
                                               &long_dummy);
@@ -1712,8 +1712,8 @@
 
 #ifdef HAVE_MOUSE
   /* It's okay for the hook to refrain from storing anything.  */
-  if (FRAME_DISPLAY (f)->mouse_position_hook)
-    (*FRAME_DISPLAY (f)->mouse_position_hook) (&f, -1,
+  if (FRAME_DEVICE (f)->mouse_position_hook)
+    (*FRAME_DEVICE (f)->mouse_position_hook) (&f, -1,
                                               &lispy_dummy, &party_dummy,
                                               &x, &y,
                                               &long_dummy);
@@ -1993,8 +1993,8 @@
   /* Do like the documentation says. */
   Fmake_frame_visible (frame);
 
-  if (FRAME_DISPLAY (f)->frame_raise_lower_hook)
-    (*FRAME_DISPLAY (f)->frame_raise_lower_hook) (f, 1);
+  if (FRAME_DEVICE (f)->frame_raise_lower_hook)
+    (*FRAME_DEVICE (f)->frame_raise_lower_hook) (f, 1);
 
   return Qnil;
 }
@@ -2017,8 +2017,8 @@
 
   f = XFRAME (frame);
   
-  if (FRAME_DISPLAY (f)->frame_raise_lower_hook)
-    (*FRAME_DISPLAY (f)->frame_raise_lower_hook) (f, 0);
+  if (FRAME_DEVICE (f)->frame_raise_lower_hook)
+    (*FRAME_DEVICE (f)->frame_raise_lower_hook) (f, 0);
 
   return Qnil;
 }
@@ -2066,8 +2066,8 @@
   
   f->focus_frame = focus_frame;
 
-  if (FRAME_DISPLAY (f)->frame_rehighlight_hook)
-    (*FRAME_DISPLAY (f)->frame_rehighlight_hook) (f);
+  if (FRAME_DEVICE (f)->frame_rehighlight_hook)
+    (*FRAME_DEVICE (f)->frame_rehighlight_hook) (f);
 
   return Qnil;
 }
@@ -4223,8 +4223,8 @@
   Qx_frame_parameter = intern ("x-frame-parameter");
   staticpro (&Qx_frame_parameter);
 
-  Qdisplay_id = intern ("display-id");
-  staticpro (&Qdisplay_id);
+  Qdevice = intern ("device");
+  staticpro (&Qdevice);
   Qdisplay_live_p = intern ("display-live-p");
   staticpro (&Qdisplay_live_p);
   
--- a/src/frame.h	Sun Jul 10 22:25:28 2005 +0000
+++ b/src/frame.h	Mon Jul 11 00:05:55 2005 +0000
@@ -69,7 +69,7 @@
 #define FRAME_FOREGROUND_PIXEL(f) ((f)->foreground_pixel)
 #define FRAME_BACKGROUND_PIXEL(f) ((f)->background_pixel)
 
-struct display;
+struct device;
 
 struct frame
 {
@@ -131,7 +131,7 @@
      Actually, we don't specify exactly what is stored here at all; the
      scroll bar implementation code can use it to store anything it likes.
      This field is marked by the garbage collector.  It is here
-     instead of in the `display' structure so that the garbage
+     instead of in the `device' structure so that the garbage
      collector doesn't need to look inside the window-system-dependent
      structure.  */
   Lisp_Object scroll_bars;
@@ -262,14 +262,14 @@
 
   /* The output method says how the contents of this frame are
      displayed.  It could be using termcap, or using an X window.
-     This must be the same as the display->type. */
+     This must be the same as the device->type. */
   enum output_method output_method;
 
-  /* The display that this frame uses.  If this is NULL, then the
-     frame is deleted. */
-  struct display *display;
+  /* The display device that this frame uses.  If this is NULL, then
+     the frame has been deleted. */
+  struct device *device;
   
-  /* Display-dependent, frame-local auxiliary data used for displaying
+  /* Device-dependent, frame-local auxiliary data used for displaying
      the contents.  When the frame is deleted, this data is deleted as
      well. */
   union output_data
@@ -415,7 +415,7 @@
   /* The baud rate that was used to calculate costs for this frame.  */
   int cost_calculation_baud_rate;
 
-  /* Nonzero if the mouse has moved on this display
+  /* Nonzero if the mouse has moved on this display device
      since the last time we checked.  */
   char mouse_moved;
 
@@ -446,7 +446,7 @@
 };
 
 #ifdef MULTI_KBOARD
-#define FRAME_KBOARD(f) ((f)->display->kboard)
+#define FRAME_KBOARD(f) ((f)->device->kboard)
 #else
 #define FRAME_KBOARD(f) (&the_only_kboard)
 #endif
@@ -484,7 +484,7 @@
 #endif
 
 /* Nonzero if frame F is still alive (not deleted).  */
-#define FRAME_LIVE_P(f) ((f)->display != 0)
+#define FRAME_LIVE_P(f) ((f)->device != 0)
 
 /* Nonzero if frame F is a minibuffer-only frame.  */
 #define FRAME_MINIBUF_ONLY_P(f) \
@@ -768,12 +768,12 @@
 
 extern Lisp_Object Qframep, Qframe_live_p;
 extern Lisp_Object Qtty, Qtty_type;
-extern Lisp_Object Qdisplay_id, Qdisplay_live_p;
+extern Lisp_Object Qdevice, Qdisplay_live_p;
 
 extern struct frame *last_nonminibuf_frame;
 
 extern struct frame *make_initial_frame P_ ((void));
-extern struct frame *make_terminal_frame P_ ((struct display *));
+extern struct frame *make_terminal_frame P_ ((struct device *));
 extern struct frame *make_frame P_ ((int));
 #ifdef HAVE_WINDOW_SYSTEM
 extern struct frame *make_minibuffer_frame P_ ((void));
--- a/src/keyboard.c	Sun Jul 10 22:25:28 2005 +0000
+++ b/src/keyboard.c	Mon Jul 11 00:05:55 2005 +0000
@@ -1112,8 +1112,8 @@
 static struct kboard_stack *kboard_stack;
 
 void
-push_display_kboard (d)
-     struct display *d;
+push_device_kboard (d)
+     struct device *d;
 {
 #ifdef MULTI_KBOARD
   struct kboard_stack *p
@@ -4169,9 +4169,9 @@
       x = Qnil;
 
       /* XXX Can f or mouse_position_hook be NULL here? */
-      if (f && FRAME_DISPLAY (f)->mouse_position_hook)
-        (*FRAME_DISPLAY (f)->mouse_position_hook) (&f, 0, &bar_window,
-                                                   &part, &x, &y, &time);
+      if (f && FRAME_DEVICE (f)->mouse_position_hook)
+        (*FRAME_DEVICE (f)->mouse_position_hook) (&f, 0, &bar_window,
+                                                  &part, &x, &y, &time);
 
       obj = Qnil;
 
@@ -6670,13 +6670,13 @@
 {
   int nread = 0;
   int err = 0;
-  struct display *d;
-
-  /* Loop through the available displays, and call their input hooks. */
-  d = display_list;
+  struct device *d;
+
+  /* Loop through the available devices, and call their input hooks. */
+  d = device_list;
   while (d)
     {
-      struct display *next = d->next_display;
+      struct device *next = d->next_device;
 
       if (d->read_socket_hook)
         {
@@ -6702,7 +6702,7 @@
               /* The display device terminated; it should be closed. */
               
               /* Kill Emacs if this was our last display. */
-              if (! display_list->next_display)
+              if (! device_list->next_device)
                 /* Formerly simply reported no input, but that
                    sometimes led to a failure of Emacs to terminate.
                    SIGHUP seems appropriate if we can't reach the
@@ -6713,11 +6713,11 @@
                    alone in its group.  */
                 kill (getpid (), SIGHUP);
               
-              /* XXX Is calling delete_display safe here?  It calls Fdelete_frame. */
-              if (d->delete_display_hook)
-                (*d->delete_display_hook) (d);
+              /* XXX Is calling delete_device safe here?  It calls Fdelete_frame. */
+              if (d->delete_device_hook)
+                (*d->delete_device_hook) (d);
               else
-                delete_display (d);
+                delete_device (d);
             }
 
           if (hold_quit.kind != NO_EVENT)
@@ -6735,12 +6735,12 @@
 
 /* This is the tty way of reading available input.
 
-   Note that each terminal device has its own `struct display' object,
+   Note that each terminal device has its own `struct device' object,
    and so this function is called once for each individual termcap
    display.  The first parameter indicates which device to read from.  */
 
 int
-tty_read_avail_input (struct display *display,
+tty_read_avail_input (struct device *device,
                       int expected,
                       struct input_event *hold_quit)
 {
@@ -6749,10 +6749,10 @@
      of characters on some systems when input is stuffed at us.  */
   unsigned char cbuf[KBD_BUFFER_SIZE - 1];
   int n_to_read, i;
-  struct tty_display_info *tty = display->display_info.tty;
+  struct tty_display_info *tty = device->display_info.tty;
   int nread = 0;
 
-  if (display->type != output_termcap)
+  if (device->type != output_termcap)
     abort ();
 
   /* XXX I think the following code should be moved to separate hook
@@ -6782,7 +6782,7 @@
   if (ioctl (fileno (tty->input), FIONREAD, &n_to_read) < 0)
     {
       if (! noninteractive)
-        return -2;          /* Close this display. */
+        return -2;          /* Close this device. */
       else
         n_to_read = 0;
     }
@@ -6811,14 +6811,14 @@
          when the control tty is taken away.
          Jeffrey Honig <jch@bsdi.com> says this is generally safe. */
       if (nread == -1 && errno == EIO)
-        return -2;          /* Close this display. */
+        return -2;          /* Close this device. */
 #if defined (AIX) && (! defined (aix386) && defined (_BSD))
       /* The kernel sometimes fails to deliver SIGHUP for ptys.
          This looks incorrect, but it isn't, because _BSD causes
          O_NDELAY to be defined in fcntl.h as O_NONBLOCK,
          and that causes a value other than 0 when there is no input.  */
       if (nread == 0)
-        return -2;          /* Close this display. */
+        return -2;          /* Close this device. */
 #endif
     }
   while (
@@ -10365,7 +10365,7 @@
 {
   /* Must preserve main program's value of errno.  */
   int old_errno = errno;
-  struct display *display;
+  struct device *device;
 
 #if defined (USG) && !defined (POSIX_SIGNALS)
   /* USG systems forget handlers when they are used;
@@ -10377,8 +10377,8 @@
   SIGNAL_THREAD_CHECK (signalnum);
 
   /* See if we have an active display on our controlling terminal. */
-  display = get_named_tty_display (NULL);
-  if (!display)
+  device = get_named_tty (NULL);
+  if (!device)
     {
       /* If there are no frames there, let's pretend that we are a
          well-behaving UN*X program and quit. */
@@ -10392,7 +10392,7 @@
          controlling tty, if we have a frame there.  We disable the
          interrupt key on secondary ttys, so the SIGINT must have come
          from the controlling tty.  */
-      internal_last_event_frame = display->display_info.tty->top_frame;
+      internal_last_event_frame = device->display_info.tty->top_frame;
 
       handle_interrupt ();
     }
@@ -10421,7 +10421,7 @@
   /* XXX This code needs to be revised for multi-tty support. */
   if (!NILP (Vquit_flag)
 #ifndef MSDOS
-      && get_named_tty_display (NULL)
+      && get_named_tty (NULL)
 #endif
       )
     {
@@ -10606,7 +10606,7 @@
 
 #ifdef SIGIO
 /* Note SIGIO has been undef'd if FIONREAD is missing.  */
-  if (FRAME_DISPLAY (SELECTED_FRAME ())->read_socket_hook)
+  if (FRAME_DEVICE (SELECTED_FRAME ())->read_socket_hook)
     {
       /* When using X, don't give the user a real choice,
 	 because we haven't implemented the mechanisms to support it.  */
@@ -10819,7 +10819,7 @@
       && FRAMEP (selected_frame)
       && FRAME_LIVE_P (XFRAME (selected_frame)))
     {
-      current_kboard = XFRAME (selected_frame)->display->kboard;
+      current_kboard = XFRAME (selected_frame)->device->kboard;
       if (current_kboard == kb)
 	abort ();
     }
--- a/src/keyboard.h	Sun Jul 10 22:25:28 2005 +0000
+++ b/src/keyboard.h	Mon Jul 11 00:05:55 2005 +0000
@@ -315,7 +315,7 @@
 extern void delete_kboard P_ ((KBOARD *));
 extern void single_kboard_state P_ ((void));
 extern void not_single_kboard_state P_ ((KBOARD *));
-extern void push_display_kboard P_ ((struct display *));
+extern void push_device_kboard P_ ((struct device *));
 extern void push_frame_kboard P_ ((struct frame *));
 extern void pop_frame_kboard P_ ((void));
 extern void record_asynch_buffer_change P_ ((void));
@@ -350,7 +350,7 @@
 extern Lisp_Object menu_item_eval_property P_ ((Lisp_Object));
 extern int  kbd_buffer_events_waiting P_ ((int));
 
-extern int tty_read_avail_input P_ ((struct display *, int,
+extern int tty_read_avail_input P_ ((struct device *, int,
                                      struct input_event *));
 
 /* arch-tag: 769cbade-1ba9-4950-b886-db265b061aa3
--- a/src/lisp.h	Sun Jul 10 22:25:28 2005 +0000
+++ b/src/lisp.h	Mon Jul 11 00:05:55 2005 +0000
@@ -3108,7 +3108,7 @@
 struct tty_display_info;
 
 /* defined in termhooks.h */
-struct display;
+struct device;
 
 /* defined in sysdep.c */
 extern void stuff_char P_ ((char c));
--- a/src/prefix-args.c	Sun Jul 10 22:25:28 2005 +0000
+++ b/src/prefix-args.c	Mon Jul 11 00:05:55 2005 +0000
@@ -44,6 +44,7 @@
    I'm quitting and taking up gardening.  */
 
 #include <stdio.h>
+#include <stdlib.h>
 
 int
 main (argc, argv)
--- a/src/sysdep.c	Sun Jul 10 22:25:28 2005 +0000
+++ b/src/sysdep.c	Mon Jul 11 00:05:55 2005 +0000
@@ -1709,7 +1709,7 @@
   setbuf (tty_out->output, (char *) _sobuf);
 #endif
 
-  tty_set_terminal_modes (tty_out->display);
+  tty_set_terminal_modes (tty_out->device);
 
   if (!tty_out->term_initted)
     {
@@ -1921,7 +1921,7 @@
   }
 #endif
 
-  tty_reset_terminal_modes (tty_out->display);
+  tty_reset_terminal_modes (tty_out->device);
 
 #ifdef BSD_SYSTEM
 #ifndef BSD4_1
--- a/src/term.c	Sun Jul 10 22:25:28 2005 +0000
+++ b/src/term.c	Mon Jul 11 00:05:55 2005 +0000
@@ -85,9 +85,9 @@
 static void tty_show_cursor P_ ((struct tty_display_info *));
 static void tty_hide_cursor P_ ((struct tty_display_info *));
 
-static struct display *get_tty_display (Lisp_Object display);
-
-void delete_initial_display P_ ((struct display *));
+static struct device *get_tty_device (Lisp_Object device);
+
+void delete_initial_device P_ ((struct device *));
 void create_tty_output P_ ((struct frame *));
 void delete_tty_output P_ ((struct frame *));
 
@@ -126,10 +126,10 @@
 Lisp_Object Vresume_tty_functions;
 
 /* Chain of all displays currently in use. */
-struct display *display_list;
+struct device *device_list;
 
 /* The initial display device, created by initial_term_init. */
-struct display *initial_display;
+struct device *initial_device;
 
 /* Chain of all tty device parameters. */
 struct tty_display_info *tty_list;
@@ -172,7 +172,7 @@
 static int no_controlling_tty;
 
 /* The first unallocated display id. */
-static int next_display_id;
+static int next_device_id;
 
 /* Provided for lisp packages.  */
 
@@ -216,8 +216,8 @@
 
       Vring_bell_function = function;
     }
-  else if (FRAME_DISPLAY (f)->ring_bell_hook)
-    (*FRAME_DISPLAY (f)->ring_bell_hook) (f);
+  else if (FRAME_DEVICE (f)->ring_bell_hook)
+    (*FRAME_DEVICE (f)->ring_bell_hook) (f);
 }
 
 /* Ring the bell on a tty. */
@@ -239,7 +239,7 @@
 /* Set up termcap modes for Emacs. */
 
 void
-tty_set_terminal_modes (struct display *display)
+tty_set_terminal_modes (struct device *display)
 {
   struct tty_display_info *tty = display->display_info.tty;
   
@@ -256,7 +256,7 @@
 /* Reset termcap modes before exiting Emacs. */
 
 void
-tty_reset_terminal_modes (struct display *display)
+tty_reset_terminal_modes (struct device *display)
 {
   struct tty_display_info *tty = display->display_info.tty;
 
@@ -278,15 +278,15 @@
 void
 update_begin (struct frame *f)
 {
-  if (FRAME_DISPLAY (f)->update_begin_hook)
-    (*FRAME_DISPLAY (f)->update_begin_hook) (f);
+  if (FRAME_DEVICE (f)->update_begin_hook)
+    (*FRAME_DEVICE (f)->update_begin_hook) (f);
 }
 
 void
 update_end (struct frame *f)
 {
-  if (FRAME_DISPLAY (f)->update_end_hook)
-    (*FRAME_DISPLAY (f)->update_end_hook) (f);
+  if (FRAME_DEVICE (f)->update_end_hook)
+    (*FRAME_DEVICE (f)->update_end_hook) (f);
 }
 
 /* Flag the end of a display update on a termcap display. */
@@ -310,8 +310,8 @@
 void
 set_terminal_window (struct frame *f, int size)
 {
-  if (FRAME_DISPLAY (f)->set_terminal_window_hook)
-    (*FRAME_DISPLAY (f)->set_terminal_window_hook) (f, size);
+  if (FRAME_DEVICE (f)->set_terminal_window_hook)
+    (*FRAME_DEVICE (f)->set_terminal_window_hook) (f, size);
 }
 
 /* The implementation of set_terminal_window for termcap frames. */
@@ -450,8 +450,8 @@
 void
 cursor_to (struct frame *f, int vpos, int hpos)
 {
-  if (FRAME_DISPLAY (f)->cursor_to_hook)
-    (*FRAME_DISPLAY (f)->cursor_to_hook) (f, vpos, hpos);
+  if (FRAME_DEVICE (f)->cursor_to_hook)
+    (*FRAME_DEVICE (f)->cursor_to_hook) (f, vpos, hpos);
 }
 
 void
@@ -479,8 +479,8 @@
 void
 raw_cursor_to (struct frame *f, int row, int col)
 {
-  if (FRAME_DISPLAY (f)->raw_cursor_to_hook)
-    (*FRAME_DISPLAY (f)->raw_cursor_to_hook) (f, row, col);  
+  if (FRAME_DEVICE (f)->raw_cursor_to_hook)
+    (*FRAME_DEVICE (f)->raw_cursor_to_hook) (f, row, col);  
 }
 
 void
@@ -504,8 +504,8 @@
 void
 clear_to_end (struct frame *f)
 {
-  if (FRAME_DISPLAY (f)->clear_to_end_hook)
-    (*FRAME_DISPLAY (f)->clear_to_end_hook) (f);
+  if (FRAME_DEVICE (f)->clear_to_end_hook)
+    (*FRAME_DEVICE (f)->clear_to_end_hook) (f);
 }
 
 /* Clear from cursor to end of frame on a termcap device. */
@@ -536,8 +536,8 @@
 void
 clear_frame (struct frame *f)
 {
-  if (FRAME_DISPLAY (f)->clear_frame_hook)
-    (*FRAME_DISPLAY (f)->clear_frame_hook) (f);
+  if (FRAME_DEVICE (f)->clear_frame_hook)
+    (*FRAME_DEVICE (f)->clear_frame_hook) (f);
 }
 
 /* Clear an entire termcap frame. */
@@ -568,8 +568,8 @@
 void
 clear_end_of_line (struct frame *f, int first_unused_hpos)
 {
-  if (FRAME_DISPLAY (f)->clear_end_of_line_hook)
-    (*FRAME_DISPLAY (f)->clear_end_of_line_hook) (f, first_unused_hpos);
+  if (FRAME_DEVICE (f)->clear_end_of_line_hook)
+    (*FRAME_DEVICE (f)->clear_end_of_line_hook) (f, first_unused_hpos);
 }
 
 /* An implementation of clear_end_of_line for termcap frames.
@@ -739,8 +739,8 @@
 void
 write_glyphs (struct frame *f, struct glyph *string, int len)
 {
-  if (FRAME_DISPLAY (f)->write_glyphs_hook)
-    (*FRAME_DISPLAY (f)->write_glyphs_hook) (f, string, len);
+  if (FRAME_DEVICE (f)->write_glyphs_hook)
+    (*FRAME_DEVICE (f)->write_glyphs_hook) (f, string, len);
 }
 
 /* An implementation of write_glyphs for termcap frames. */
@@ -824,8 +824,8 @@
   if (len <= 0)
     return;
 
-  if (FRAME_DISPLAY (f)->insert_glyphs_hook)
-    (*FRAME_DISPLAY (f)->insert_glyphs_hook) (f, start, len);
+  if (FRAME_DEVICE (f)->insert_glyphs_hook)
+    (*FRAME_DEVICE (f)->insert_glyphs_hook) (f, start, len);
 }
 
 /* An implementation of insert_glyphs for termcap frames. */
@@ -920,8 +920,8 @@
 void
 delete_glyphs (struct frame *f, int n)
 {
-  if (FRAME_DISPLAY (f)->delete_glyphs_hook)
-    (*FRAME_DISPLAY (f)->delete_glyphs_hook) (f, n);
+  if (FRAME_DEVICE (f)->delete_glyphs_hook)
+    (*FRAME_DEVICE (f)->delete_glyphs_hook) (f, n);
 }
 
 /* An implementation of delete_glyphs for termcap frames. */
@@ -962,8 +962,8 @@
 void
 ins_del_lines (struct frame *f, int vpos, int n)
 {
-  if (FRAME_DISPLAY (f)->ins_del_lines_hook)
-    (*FRAME_DISPLAY (f)->ins_del_lines_hook) (f, vpos, n);
+  if (FRAME_DEVICE (f)->ins_del_lines_hook)
+    (*FRAME_DEVICE (f)->ins_del_lines_hook) (f, vpos, n);
 }
 
 /* An implementation of ins_del_lines for termcap frames. */
@@ -1953,11 +1953,12 @@
 
 DEFUN ("tty-display-color-p", Ftty_display_color_p, Stty_display_color_p,
        0, 1, 0,
-       doc: /* Return non-nil if the tty device that DISPLAY uses can display colors. */)
-     (display)
-     Lisp_Object display;
+       doc: /* Return non-nil if the display device DEVICE can display colors.
+DEVICE must be a tty device.  */)
+     (device)
+     Lisp_Object device;
 {
-  struct display *d = get_tty_display (display);
+  struct device *d = get_tty_device (device);
   if (!d)
     return Qnil;
   else
@@ -1967,11 +1968,11 @@
 /* Return the number of supported colors.  */
 DEFUN ("tty-display-color-cells", Ftty_display_color_cells,
        Stty_display_color_cells, 0, 1, 0,
-       doc: /* Return the number of colors supported by the tty device that DISPLAY uses.  */)
-     (display)
-     Lisp_Object display;
+       doc: /* Return the number of colors supported by the tty device DEVICE.  */)
+     (device)
+     Lisp_Object device;
 {
-  struct display *d = get_tty_display (display);
+  struct device *d = get_tty_device (device);
   if (!d)
     return make_number (0);
   else
@@ -2117,86 +2118,79 @@
 
 
 
-/* Return the display object specified by DISPLAY.  DISPLAY may be a
+/* Return the display object specified by DEVICE.  DEVICE may be a
    display id, a frame, or nil for the display device of the current
    frame.  If THROW is zero, return NULL for failure, otherwise throw
    an error.  */
 
-struct display *
-get_display (Lisp_Object display, int throw)
+struct device *
+get_device (Lisp_Object device, int throw)
 {
-  struct display *result = NULL;
-
-  if (NILP (display))
-    display = selected_frame;
-
-  if (INTEGERP (display))
+  struct device *result = NULL;
+
+  if (NILP (device))
+    device = selected_frame;
+
+  if (INTEGERP (device))
     {
-      struct display *d;
-
-      for (d = display_list; d; d = d->next_display)
+      struct device *d;
+
+      for (d = device_list; d; d = d->next_device)
         {
-          if (d->id == XINT (display))
+          if (d->id == XINT (device))
             {
               result = d;
               break;
             }
         }
     }
-  else if (FRAMEP (display))
+  else if (FRAMEP (device))
     {
-      result = FRAME_DISPLAY (XFRAME (display));
+      result = FRAME_DEVICE (XFRAME (device));
     }
 
   if (result == NULL && throw)
-    wrong_type_argument (Qdisplay_live_p, display);
+    wrong_type_argument (Qdisplay_live_p, device);
 
   return result;
 }
 
-/* Return the tty display object specified by DISPLAY. */
-
-static struct display *
-get_tty_display (Lisp_Object display)
+/* Return the tty display object specified by DEVICE. */
+
+static struct device *
+get_tty_device (Lisp_Object device)
 {
-  struct display *d = get_display (display, 0);
+  struct device *d = get_device (device, 0);
   
   if (d && d->type == output_initial)
     d = NULL;
 
   if (d && d->type != output_termcap)
-    {
-#if 0   /* XXX We need a predicate as the first argument; find one. */
-      wrong_type_argument ("Not a termcap display", display);
-#else /* Until we fix the wrong_type_argument call above, simply throw
-         a dumb error. */
-      error ("DISPLAY is not a termcap display");
-#endif
-    }
+    error ("Device %d is not a termcap display device", d->id);
 
   return d;
 }
 
-/* Return the active termcap display that uses the tty device with the
-   given name.  If NAME is NULL, return the display corresponding to
+/* Return the active termcap device that uses the tty device with the
+   given name.  If NAME is NULL, return the device corresponding to
    our controlling terminal.
 
-   This function ignores suspended displays.
+   This function ignores suspended devices.
 
    Returns NULL if the named terminal device is not opened.  */
  
-struct display *
-get_named_tty_display (name)
+struct device *
+get_named_tty (name)
      char *name;
 {
-  struct display *d;
-
-  for (d = display_list; d; d = d->next_display) {
+  struct device *d;
+
+  for (d = device_list; d; d = d->next_device) {
     if (d->type == output_termcap
         && ((d->display_info.tty->name == 0 && name == 0)
             || (name && d->display_info.tty->name
                 && !strcmp (d->display_info.tty->name, name)))
-        && DISPLAY_ACTIVE_P (d))
+        && DEVICE_ACTIVE_P (d))
       return d;
   };
 
@@ -2206,15 +2200,15 @@
 
 
 DEFUN ("display-name", Fdisplay_name, Sdisplay_name, 0, 1, 0,
-       doc: /* Return the name of the device that DISPLAY uses.
-It is not guaranteed that the returned value is unique among opened displays.
-
-DISPLAY may be a display, a frame, or nil (meaning the selected
-frame's display). */)
-  (display)
-     Lisp_Object display;
+       doc: /* Return the name of the display device DEVICE.
+It is not guaranteed that the returned value is unique among opened devices.
+
+DEVICE may be a display device id, a frame, or nil (meaning the
+selected frame's display device). */)
+  (device)
+     Lisp_Object device;
 {
-  struct display *d = get_display (display, 1);
+  struct device *d = get_device (device, 1);
 
   if (d->name)
     return build_string (d->name);
@@ -2223,14 +2217,14 @@
 }
 
 DEFUN ("display-tty-type", Fdisplay_tty_type, Sdisplay_tty_type, 0, 1, 0,
-       doc: /* Return the type of the TTY device that DISPLAY uses.
-
-DISPLAY may be a display, a frame, or nil (meaning the selected
-frame's display).  */)
-  (display)
-     Lisp_Object display;
+       doc: /* Return the type of the tty device that DEVICE uses.
+
+DEVICE may be a display device id, a frame, or nil (meaning the
+selected frame's display device). */)
+  (device)
+     Lisp_Object device;
 {
-  struct display *d = get_display (display, 1);
+  struct device *d = get_device (device, 1);
 
   if (d->type != output_termcap)
     error ("Display %d is not a termcap display", d->id);
@@ -2242,14 +2236,14 @@
 }
 
 DEFUN ("display-controlling-tty-p", Fdisplay_controlling_tty_p, Sdisplay_controlling_tty_p, 0, 1, 0,
-       doc: /* Return non-nil if DISPLAY is on the controlling tty of the Emacs process.
-
-DISPLAY may be a display, a frame, or nil (meaning the selected
-frame's display).  */)
-  (display)
-     Lisp_Object display;
+       doc: /* Return non-nil if DEVICE is on the controlling tty of the Emacs process.
+
+DEVICE may be a display device id, a frame, or nil (meaning the
+selected frame's display device).  */)
+  (device)
+     Lisp_Object device;
 {
-  struct display *d = get_display (display, 1);
+  struct device *d = get_device (device, 1);
 
   if (d->type != output_termcap || d->display_info.tty->name)
     return Qnil;
@@ -2258,17 +2252,17 @@
 }
 
 DEFUN ("tty-no-underline", Ftty_no_underline, Stty_no_underline, 0, 1, 0,
-       doc: /* Declare that the tty used by DISPLAY does not handle underlining.
+       doc: /* Declare that the tty used by DEVICE does not handle underlining.
 This is used to override the terminfo data, for certain terminals that
 do not really do underlining, but say that they do.  This function has
 no effect if used on a non-tty display.
 
-DISPLAY may be a display, a frame, or nil (meaning the selected
-frame's display).  */)
-  (display)
-     Lisp_Object display;
+DEVICE may be a display device id, a frame, or nil (meaning the
+selected frame's display device).  */)
+  (device)
+     Lisp_Object device;
 {
-  struct display *d = get_display (display, 1);
+  struct device *d = get_device (device, 1);
 
   if (d->type == output_termcap)
     d->display_info.tty->TS_enter_underline_mode = 0;
@@ -2282,36 +2276,36 @@
  ***********************************************************************/
 
 /* Create the bootstrap display device for the initial frame.
-   Returns a display of type output_initial. */
-
-struct display *
-init_initial_display (void)
+   Returns a device of type output_initial.  */
+
+struct device *
+init_initial_device (void)
 {
-  if (initialized || display_list || tty_list)
+  if (initialized || device_list || tty_list)
     abort ();
 
-  initial_display = create_display ();
-  initial_display->type = output_initial;
-  initial_display->name = xstrdup ("initial_display");
-  initial_display->kboard = initial_kboard;
-
-  initial_display->delete_display_hook = &delete_initial_display;
+  initial_device = create_device ();
+  initial_device->type = output_initial;
+  initial_device->name = xstrdup ("initial_device");
+  initial_device->kboard = initial_kboard;
+
+  initial_device->delete_device_hook = &delete_initial_device;
   /* All other hooks are NULL. */
 
-  return initial_display;
+  return initial_device;
 }
 
 /* Deletes the bootstrap display device.
-   Called through delete_display_hook. */
+   Called through delete_device_hook. */
 
 void
-delete_initial_display (struct display *display)
+delete_initial_device (struct device *device)
 {
-  if (display != initial_display)
+  if (device != initial_device)
     abort ();
 
-  delete_display (display);
-  initial_display = NULL;
+  delete_device (device);
+  initial_device = NULL;
 }
 
 /* Drop the controlling terminal if fd is the same device. */
@@ -2357,7 +2351,7 @@
 
    If MUST_SUCCEED is true, then all errors are fatal. */
 
-struct display *
+struct device *
 init_tty (char *name, char *terminal_type, int must_succeed)
 {
   char *area;
@@ -2367,72 +2361,72 @@
   register char *p;
   int status;
   struct tty_display_info *tty;
-  struct display *display;
+  struct device *device;
 
   if (!terminal_type)
     maybe_fatal (must_succeed, 0, 0,
                  "Unknown terminal type",
                  "Unknown terminal type");
 
-  /* If we already have an active display on the given device, use that.
-     If all displays are suspended, create a new one instead.  */
+  /* If we already have a display on the given device, use that.  If
+     all such displays are suspended, create a new one instead.  */
   /* XXX Perhaps this should be made explicit by having init_tty
-     always create a new display and separating display and frame
+     always create a new display and separating device and frame
      creation on Lisp level.  */
-  display = get_named_tty_display (name);
-  if (display)
-    return display;
-
-  display = create_display ();
+  device = get_named_tty (name);
+  if (device)
+    return device;
+
+  device = create_device ();
   tty = (struct tty_display_info *) xmalloc (sizeof (struct tty_display_info));
   bzero (tty, sizeof (struct tty_display_info));
   tty->next = tty_list;
   tty_list = tty;
 
-  display->type = output_termcap;
-  display->display_info.tty = tty;
-  tty->display = display;
+  device->type = output_termcap;
+  device->display_info.tty = tty;
+  tty->device = device;
 
   tty->Wcm = (struct cm *) xmalloc (sizeof (struct cm));
   Wcm_clear (tty);
 
-  display->rif = 0; /* ttys don't support window-based redisplay. */
-
-  display->cursor_to_hook = &tty_cursor_to;
-  display->raw_cursor_to_hook = &tty_raw_cursor_to;
-
-  display->clear_to_end_hook = &tty_clear_to_end;
-  display->clear_frame_hook = &tty_clear_frame;
-  display->clear_end_of_line_hook = &tty_clear_end_of_line;
-
-  display->ins_del_lines_hook = &tty_ins_del_lines;
-
-  display->insert_glyphs_hook = &tty_insert_glyphs;
-  display->write_glyphs_hook = &tty_write_glyphs;
-  display->delete_glyphs_hook = &tty_delete_glyphs;
-
-  display->ring_bell_hook = &tty_ring_bell;
+  device->rif = 0; /* ttys don't support window-based redisplay. */
+
+  device->cursor_to_hook = &tty_cursor_to;
+  device->raw_cursor_to_hook = &tty_raw_cursor_to;
+
+  device->clear_to_end_hook = &tty_clear_to_end;
+  device->clear_frame_hook = &tty_clear_frame;
+  device->clear_end_of_line_hook = &tty_clear_end_of_line;
+
+  device->ins_del_lines_hook = &tty_ins_del_lines;
+
+  device->insert_glyphs_hook = &tty_insert_glyphs;
+  device->write_glyphs_hook = &tty_write_glyphs;
+  device->delete_glyphs_hook = &tty_delete_glyphs;
+
+  device->ring_bell_hook = &tty_ring_bell;
   
-  display->reset_terminal_modes_hook = &tty_reset_terminal_modes;
-  display->set_terminal_modes_hook = &tty_set_terminal_modes;
-  display->update_begin_hook = 0; /* Not needed. */
-  display->update_end_hook = &tty_update_end;
-  display->set_terminal_window_hook = &tty_set_terminal_window;
-
-  display->mouse_position_hook = 0; /* Not needed. */
-  display->frame_rehighlight_hook = 0; /* Not needed. */
-  display->frame_raise_lower_hook = 0; /* Not needed. */
-
-  display->set_vertical_scroll_bar_hook = 0; /* Not needed. */
-  display->condemn_scroll_bars_hook = 0; /* Not needed. */
-  display->redeem_scroll_bar_hook = 0; /* Not needed. */
-  display->judge_scroll_bars_hook = 0; /* Not needed. */
-
-  display->read_socket_hook = &tty_read_avail_input; /* keyboard.c */
-  display->frame_up_to_date_hook = 0; /* Not needed. */
+  device->reset_terminal_modes_hook = &tty_reset_terminal_modes;
+  device->set_terminal_modes_hook = &tty_set_terminal_modes;
+  device->update_begin_hook = 0; /* Not needed. */
+  device->update_end_hook = &tty_update_end;
+  device->set_terminal_window_hook = &tty_set_terminal_window;
+
+  device->mouse_position_hook = 0; /* Not needed. */
+  device->frame_rehighlight_hook = 0; /* Not needed. */
+  device->frame_raise_lower_hook = 0; /* Not needed. */
+
+  device->set_vertical_scroll_bar_hook = 0; /* Not needed. */
+  device->condemn_scroll_bars_hook = 0; /* Not needed. */
+  device->redeem_scroll_bar_hook = 0; /* Not needed. */
+  device->judge_scroll_bars_hook = 0; /* Not needed. */
+
+  device->read_socket_hook = &tty_read_avail_input; /* keyboard.c */
+  device->frame_up_to_date_hook = 0; /* Not needed. */
   
-  display->delete_frame_hook = &delete_tty_output;
-  display->delete_display_hook = &delete_tty;
+  device->delete_frame_hook = &delete_tty_output;
+  device->delete_device_hook = &delete_tty;
   
   if (name)
     {
@@ -2456,7 +2450,7 @@
 
       if (fd < 0)
         {
-          delete_tty (display);
+          delete_tty (device);
           error ("Could not open file: %s", name);
         }
       if (!isatty (fd))
@@ -2469,7 +2463,7 @@
       
       file = fdopen (fd, "w+");
       tty->name = xstrdup (name);
-      display->name = xstrdup (name);
+      device->name = xstrdup (name);
       tty->input = file;
       tty->output = file;
     }
@@ -2482,7 +2476,7 @@
           error ("There is no controlling terminal any more");
         }
       tty->name = 0;
-      display->name = xstrdup (ttyname (0));
+      device->name = xstrdup (ttyname (0));
       tty->input = stdin;
       tty->output = stdout;
     }
@@ -2504,17 +2498,16 @@
   FrameCols (tty) = FRAME_COLS (f);  /* XXX */
   tty->specified_window = FRAME_LINES (f); /* XXX */
 
-  tty->display->delete_in_insert_mode = 1;
+  tty->device->delete_in_insert_mode = 1;
 
   UseTabs (tty) = 0;
-  display->scroll_region_ok = 0;
-
-  /* Seems to insert lines when it's not supposed to, messing
-     up the display.  In doing a trace, it didn't seem to be
-     called much, so I don't think we're losing anything by
-     turning it off.  */
-  display->line_ins_del_ok = 0;
-  display->char_ins_del_ok = 1;
+  device->scroll_region_ok = 0;
+
+  /* Seems to insert lines when it's not supposed to, messing up the
+     device.  In doing a trace, it didn't seem to be called much, so I
+     don't think we're losing anything by turning it off.  */
+  device->line_ins_del_ok = 0;
+  device->char_ins_del_ok = 1;
 
   baud_rate = 19200;
 
@@ -2522,7 +2515,7 @@
   FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none; /* XXX */
   TN_max_colors = 16;  /* Required to be non-zero for tty-display-color-p */
 
-  return display;
+  return device;
 #else  /* not WINDOWSNT */
 
   Wcm_clear (tty);
@@ -2538,11 +2531,11 @@
   if (status < 0)
     {
 #ifdef TERMINFO
-      maybe_fatal (must_succeed, buffer, display,
+      maybe_fatal (must_succeed, buffer, device,
                    "Cannot open terminfo database file",
                    "Cannot open terminfo database file");
 #else
-      maybe_fatal (must_succeed, buffer, display,
+      maybe_fatal (must_succeed, buffer, device,
                    "Cannot open termcap database file",
                    "Cannot open termcap database file");
 #endif
@@ -2550,7 +2543,7 @@
   if (status == 0)
     {
 #ifdef TERMINFO
-      maybe_fatal (must_succeed, buffer, display,
+      maybe_fatal (must_succeed, buffer, device,
                    "Terminal type %s is not defined",
                    "Terminal type %s is not defined.\n\
 If that is not the actual type of terminal you have,\n\
@@ -2559,7 +2552,7 @@
 to do `unset TERMINFO' (C-shell: `unsetenv TERMINFO') as well.",
                    terminal_type);
 #else
-      maybe_fatal (must_succeed, buffer, display,
+      maybe_fatal (must_succeed, buffer, device,
                    "Terminal type %s is not defined",
                    "Terminal type %s is not defined.\n\
 If that is not the actual type of terminal you have,\n\
@@ -2681,9 +2674,9 @@
   /* Since we make MagicWrap terminals look like AutoWrap, we need to have
      the former flag imply the latter.  */
   AutoWrap (tty) = MagicWrap (tty) || tgetflag ("am");
-  display->memory_below_frame = tgetflag ("db");
+  device->memory_below_frame = tgetflag ("db");
   tty->TF_hazeltine = tgetflag ("hz");
-  display->must_write_spaces = tgetflag ("in");
+  device->must_write_spaces = tgetflag ("in");
   tty->meta_key = tgetflag ("km") || tgetflag ("MT");
   tty->TF_insmode_motion = tgetflag ("mi");
   tty->TF_standout_motion = tgetflag ("ms");
@@ -2691,19 +2684,19 @@
   tty->TF_teleray = tgetflag ("xt");
 
 #ifdef MULTI_KBOARD
-  display->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
-  init_kboard (display->kboard);
-  display->kboard->next_kboard = all_kboards;
-  all_kboards = display->kboard;
-  display->kboard->reference_count++;
+  device->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
+  init_kboard (device->kboard);
+  device->kboard->next_kboard = all_kboards;
+  all_kboards = device->kboard;
+  device->kboard->reference_count++;
   /* Don't let the initial kboard remain current longer than necessary.
      That would cause problems if a file loaded on startup tries to
      prompt in the mini-buffer.  */
   if (current_kboard == initial_kboard)
-    current_kboard = display->kboard;
+    current_kboard = device->kboard;
 #endif
 
-  term_get_fkeys (address, display->kboard);
+  term_get_fkeys (address, device->kboard);
 
   /* Get frame size from system, or else from termcap.  */
   {
@@ -2719,13 +2712,13 @@
     FrameRows (tty) = tgetnum ("li");
 
   if (FrameRows (tty) < 3 || FrameCols (tty) < 3)
-    maybe_fatal (must_succeed, NULL, display,
+    maybe_fatal (must_succeed, NULL, device,
                  "Screen size %dx%d is too small"
                  "Screen size %dx%d is too small",
                  FrameCols (tty), FrameRows (tty));
 
 #if 0  /* This is not used anywhere. */
-  tty->display->min_padding_speed = tgetnum ("pb");
+  tty->device->min_padding_speed = tgetnum ("pb");
 #endif
 
   TabWidth (tty) = tgetnum ("tw");
@@ -2803,7 +2796,7 @@
 
   if (!strcmp (terminal_type, "supdup"))
     {
-      display->memory_below_frame = 1;
+      device->memory_below_frame = 1;
       tty->Wcm->cm_losewrap = 1;
     }
   if (!strncmp (terminal_type, "c10", 3)
@@ -2830,7 +2823,7 @@
 	    tty->TS_set_window = "\033v%C %C %C %C ";
 	}
       /* Termcap entry often fails to have :in: flag */
-      display->must_write_spaces = 1;
+      device->must_write_spaces = 1;
       /* :ti string typically fails to have \E^G! in it */
       /* This limits scope of insert-char to one line.  */
       strcpy (area, tty->TS_termcap_modes);
@@ -2852,7 +2845,7 @@
 
   if (Wcm_init (tty) == -1)	/* can't do cursor motion */
     {
-      maybe_fatal (must_succeed, NULL, display,
+      maybe_fatal (must_succeed, NULL, device,
                    "Terminal type \"%s\" is not powerful enough to run Emacs",
 #ifdef VMS
                    "Terminal type \"%s\" is not powerful enough to run Emacs.\n\
@@ -2881,7 +2874,7 @@
     }
 
   if (FrameRows (tty) <= 0 || FrameCols (tty) <= 0)
-    maybe_fatal (must_succeed, NULL, display,
+    maybe_fatal (must_succeed, NULL, device,
                  "Could not determine the frame size",
                  "Could not determine the frame size");
 
@@ -2895,30 +2888,30 @@
 
   UseTabs (tty) = tabs_safe_p (fileno (tty->input)) && TabWidth (tty) == 8;
 
-  display->scroll_region_ok
+  device->scroll_region_ok
     = (tty->Wcm->cm_abs
        && (tty->TS_set_window || tty->TS_set_scroll_region || tty->TS_set_scroll_region_1));
 
-  display->line_ins_del_ok
+  device->line_ins_del_ok
     = (((tty->TS_ins_line || tty->TS_ins_multi_lines)
         && (tty->TS_del_line || tty->TS_del_multi_lines))
-       || (display->scroll_region_ok
+       || (device->scroll_region_ok
            && tty->TS_fwd_scroll && tty->TS_rev_scroll));
 
-  display->char_ins_del_ok
+  device->char_ins_del_ok
     = ((tty->TS_ins_char || tty->TS_insert_mode
         || tty->TS_pad_inserted_char || tty->TS_ins_multi_chars)
        && (tty->TS_del_char || tty->TS_del_multi_chars));
 
-  display->fast_clear_end_of_line = tty->TS_clr_line != 0;
+  device->fast_clear_end_of_line = tty->TS_clr_line != 0;
 
   init_baud_rate (fileno (tty->input));
 
 #ifdef AIXHFT
   /* The HFT system on AIX doesn't optimize for scrolling, so it's
      really ugly at times.  */
-  display->line_ins_del_ok = 0;
-  display->char_ins_del_ok = 0;
+  device->line_ins_del_ok = 0;
+  device->char_ins_del_ok = 0;
 #endif
 
   /* Don't do this.  I think termcap may still need the buffer. */
@@ -2927,26 +2920,26 @@
   /* Init system terminal modes (RAW or CBREAK, etc.).  */
   init_sys_modes (tty);
 
-  return display;
+  return device;
 #endif /* not WINDOWSNT */
 }
 
 /* Auxiliary error-handling function for init_tty.
-   Free BUFFER and delete DISPLAY, then call error or fatal
+   Free BUFFER and delete DEVICE, then call error or fatal
    with str1 or str2, respectively, according to MUST_SUCCEED.  */
 
 static void
-maybe_fatal (must_succeed, buffer, display, str1, str2, arg1, arg2)
+maybe_fatal (must_succeed, buffer, device, str1, str2, arg1, arg2)
      int must_succeed;
      char *buffer;
-     struct display *display;
+     struct device *device;
      char *str1, *str2, *arg1, *arg2;
 {
   if (buffer)
     xfree (buffer);
 
-  if (display)
-    delete_tty (display);
+  if (device)
+    delete_tty (device);
   
   if (must_succeed)
     fatal (str2, arg1, arg2);
@@ -2976,35 +2969,35 @@
 /* Delete the given terminal device, closing all frames on it. */
 
 void
-delete_tty (struct display *display)
+delete_tty (struct device *device)
 {
   struct tty_display_info *tty;
   Lisp_Object tail, frame;
   char *tty_name;
-  int last_display;
+  int last_device;
   
   if (deleting_tty)
     /* We get a recursive call when we delete the last frame on this
-       display. */
+       device. */
     return;
 
-  if (display->type != output_termcap)
+  if (device->type != output_termcap)
     abort ();
 
-  tty = display->display_info.tty;
+  tty = device->display_info.tty;
   
-  last_display = 1;
+  last_device = 1;
   FOR_EACH_FRAME (tail, frame)
     {
       struct frame *f = XFRAME (frame);
       if (FRAME_LIVE_P (f) && (!FRAME_TERMCAP_P (f) || FRAME_TTY (f) != tty))
         {
-          last_display = 0;
+          last_device = 0;
           break;
         }
     }
-  if (last_display)
-      error ("Attempt to delete the sole display with live frames");
+  if (last_device)
+      error ("Attempt to delete the sole display device with live frames");
   
   if (tty == tty_list)
     tty_list = tty->next;
@@ -3033,11 +3026,11 @@
         }
     }
 
-  /* reset_sys_modes needs a valid display, so this call needs to be
-     before delete_display. */
+  /* reset_sys_modes needs a valid device, so this call needs to be
+     before delete_device. */
   reset_sys_modes (tty);
 
-  delete_display (display);
+  delete_device (device);
 
   tty_name = tty->name;
   if (tty->type)
@@ -3068,7 +3061,7 @@
 
 
 /* Initialize the tty-dependent part of frame F.  The frame must
-   already have its display initialized. */
+   already have its device initialized. */
 
 void
 create_tty_output (struct frame *f)
@@ -3081,7 +3074,7 @@
   t = xmalloc (sizeof (struct tty_output));
   bzero (t, sizeof (struct tty_output));
 
-  t->display_info = FRAME_DISPLAY (f)->display_info.tty;
+  t->display_info = FRAME_DEVICE (f)->display_info.tty;
 
   f->output_data.tty = t;
 }
@@ -3117,119 +3110,119 @@
 
 
 
-/* Create a new display object and add it to the display list. */
-
-struct display *
-create_display (void)
+/* Create a new device object and add it to the device list. */
+
+struct device *
+create_device (void)
 {
-  struct display *display = (struct display *) xmalloc (sizeof (struct display));
+  struct device *device = (struct device *) xmalloc (sizeof (struct device));
   
-  bzero (display, sizeof (struct display));
-  display->next_display = display_list;
-  display_list = display;
-
-  display->id = next_display_id++;
-
-  display->keyboard_coding =
+  bzero (device, sizeof (struct device));
+  device->next_device = device_list;
+  device_list = device;
+
+  device->id = next_device_id++;
+
+  device->keyboard_coding =
     (struct coding_system *) xmalloc (sizeof (struct coding_system));
-  display->terminal_coding =
+  device->terminal_coding =
     (struct coding_system *) xmalloc (sizeof (struct coding_system));
   
-  setup_coding_system (Qnil, display->keyboard_coding);
-  setup_coding_system (Qnil, display->terminal_coding);
+  setup_coding_system (Qnil, device->keyboard_coding);
+  setup_coding_system (Qnil, device->terminal_coding);
   
-  return display;
+  return device;
 }
 
-/* Remove a display from the display list and free its memory. */
+/* Remove a device from the device list and free its memory. */
 
 void
-delete_display (struct display *display)
+delete_device (struct device *device)
 {
-  struct display **dp;
+  struct device **dp;
   Lisp_Object tail, frame;
   
   /* Check for and close live frames that are still on this
-     display. */
+     device. */
   FOR_EACH_FRAME (tail, frame)
     {
       struct frame *f = XFRAME (frame);
-      if (FRAME_LIVE_P (f) && f->display == display)
+      if (FRAME_LIVE_P (f) && f->device == device)
         {
           Fdelete_frame (frame, Qt);
         }
     }
 
-  for (dp = &display_list; *dp != display; dp = &(*dp)->next_display)
+  for (dp = &device_list; *dp != device; dp = &(*dp)->next_device)
     if (! *dp)
       abort ();
-  *dp = display->next_display;
-
-  if (display->keyboard_coding)
-    xfree (display->keyboard_coding);
-  if (display->terminal_coding)
-    xfree (display->terminal_coding);
-  if (display->name)
-    xfree (display->name);
+  *dp = device->next_device;
+
+  if (device->keyboard_coding)
+    xfree (device->keyboard_coding);
+  if (device->terminal_coding)
+    xfree (device->terminal_coding);
+  if (device->name)
+    xfree (device->name);
   
 #ifdef MULTI_KBOARD
-  if (display->kboard && --display->kboard->reference_count == 0)
-    delete_kboard (display->kboard);
+  if (device->kboard && --device->kboard->reference_count == 0)
+    delete_kboard (device->kboard);
 #endif
   
-  bzero (display, sizeof (struct display));
-  xfree (display);
+  bzero (device, sizeof (struct device));
+  xfree (device);
 }
 
 DEFUN ("delete-display", Fdelete_display, Sdelete_display, 0, 2, 0,
-       doc: /* Delete DISPLAY by deleting all frames on it and closing the device.
-DISPLAY may be a display id, a frame, or nil for the display
-device of the current frame.
+       doc: /* Delete DEVICE by deleting all frames on it and closing the device.
+DEVICE may be a display device id, a frame, or nil (meaning the
+selected frame's display device).
 
 Normally, you may not delete a display if all other displays are suspended,
 but if the second argument FORCE is non-nil, you may do so. */)
-  (display, force)
-     Lisp_Object display, force;
+  (device, force)
+     Lisp_Object device, force;
 {
-  struct display *d, *p;
-
-  d = get_display (display, 0);
+  struct device *d, *p;
+
+  d = get_device (device, 0);
 
   if (!d)
     return Qnil;
 
-  p = display_list;
-  while (p && (p == d || !DISPLAY_ACTIVE_P (p)))
-    p = p->next_display;
+  p = device_list;
+  while (p && (p == d || !DEVICE_ACTIVE_P (p)))
+    p = p->next_device;
   
   if (NILP (force) && !p)
-    error ("Attempt to delete the sole active display");
-
-  if (d->delete_display_hook)
-    (*d->delete_display_hook) (d);
+    error ("Attempt to delete the sole active display device");
+
+  if (d->delete_device_hook)
+    (*d->delete_device_hook) (d);
   else
-    delete_display (d);
+    delete_device (d);
 
   return Qnil;
 }
 
 DEFUN ("display-live-p", Fdisplay_live_p, Sdisplay_live_p, 1, 1, 0,
-       doc: /* Return non-nil if OBJECT is a display which has not been deleted.
-Value is nil if OBJECT is not a live display.
-If object is a live display, the return value indicates what sort of
-output device it uses.  See the documentation of `framep' for possible
-return values.
-
-Displays are represented by their integer identifiers. */)
+       doc: /* Return non-nil if OBJECT is a device which has not been deleted.
+Value is nil if OBJECT is not a live display device.
+If object is a live display device, the return value indicates what
+sort of output device it uses.  See the documentation of `framep' for
+possible return values.
+
+Display devices are represented by their integer identifiers. */)
   (object)
      Lisp_Object object;
 {
-  struct display *d;
+  struct device *d;
   
   if (!INTEGERP (object))
     return Qnil;
 
-  d = get_display (object, 0);
+  d = get_device (object, 0);
 
   if (!d)
     return Qnil;
@@ -3253,17 +3246,17 @@
 }
 
 DEFUN ("display-list", Fdisplay_list, Sdisplay_list, 0, 0, 0,
-       doc: /* Return a list of all displays.
-Displays are represented by their integer identifiers. */)
+       doc: /* Return a list of all display devices.
+Display devices are represented by their integer identifiers. */)
   ()
 {
-  Lisp_Object displays = Qnil;
-  struct display *d;
-
-  for (d = display_list; d; d = d->next_display)
-    displays = Fcons (make_number (d->id), displays);
-
-  return displays;
+  Lisp_Object devices = Qnil;
+  struct device *d;
+
+  for (d = device_list; d; d = d->next_device)
+    devices = Fcons (make_number (d->id), devices);
+
+  return devices;
 }
 
             
@@ -3291,7 +3284,7 @@
   (tty)
      Lisp_Object tty;
 {
-  struct display *d = get_tty_display (tty);
+  struct device *d = get_tty_device (tty);
   FILE *f;
   
   if (!d)
@@ -3349,7 +3342,7 @@
   (tty)
      Lisp_Object tty;
 {
-  struct display *d = get_tty_display (tty);
+  struct device *d = get_tty_device (tty);
   int fd;
 
   if (!d)
@@ -3357,7 +3350,7 @@
 
   if (!d->display_info.tty->input)
     {
-      if (get_named_tty_display (d->display_info.tty->name))
+      if (get_named_tty (d->display_info.tty->name))
         error ("Cannot resume display while another display is active on the same device");
 
       fd = emacs_open (d->display_info.tty->name, O_RDWR | O_NOCTTY, 0);
--- a/src/termchar.h	Sun Jul 10 22:25:28 2005 +0000
+++ b/src/termchar.h	Mon Jul 11 00:05:55 2005 +0000
@@ -57,7 +57,7 @@
 
   int reference_count;          /* Number of frames that are on this display. */
 
-  struct display *display;      /* Points back to the generic display
+  struct device *device;        /* Points back to the generic display device
                                    structure.  This is sometimes handy. */
   
   /* Info on cursor positioning.  */
@@ -193,7 +193,7 @@
 
 #define FRAME_TTY(f)                            \
   ((f)->output_method == output_termcap         \
-   ? (f)->display->display_info.tty             \
+   ? (f)->device->display_info.tty              \
    : (abort(), (struct tty_display_info *) 0))
 
 #define CURTTY() FRAME_TTY (SELECTED_FRAME())
--- a/src/termhooks.h	Sun Jul 10 22:25:28 2005 +0000
+++ b/src/termhooks.h	Mon Jul 11 00:05:55 2005 +0000
@@ -277,22 +277,22 @@
 #endif /* CONSP */
 
 
-/* Display-local parameters. */
-struct display
+/* Device-local parameters. */
+struct device
 {
-  /* Chain of all displays. */
-  struct display *next_display;
+  /* Chain of all display devices. */
+  struct device *next_device;
 
-  /* Unique id for this display. */
+  /* Unique id for this display device. */
   int id;
 
-  /* The number of frames that are on this display. */
+  /* The number of frames that are on this device. */
   int reference_count;
   
-  /* The type of the display. */
+  /* The type of the display device. */
   enum output_method type;
 
-  /* The name of the display device.  Do not use this to identify the display. */
+  /* The name of the display device.  Do not use this to identify the device. */
   char *name;
 
 #ifdef MULTI_KBOARD
@@ -300,7 +300,7 @@
   struct kboard *kboard;
 #endif
 
-  /* Display-type dependent data shared amongst all frames on this display. */
+  /* Device-type dependent data shared amongst all frames on this display. */
   union display_info
   {
     struct tty_display_info *tty;     /* termchar.h */
@@ -367,8 +367,8 @@
   
   void (*ring_bell_hook) P_ ((struct frame *f));
   
-  void (*reset_terminal_modes_hook) P_ ((struct display *));
-  void (*set_terminal_modes_hook) P_ ((struct display *));
+  void (*reset_terminal_modes_hook) P_ ((struct device *));
+  void (*set_terminal_modes_hook) P_ ((struct device *));
 
   void (*update_begin_hook) P_ ((struct frame *));
   void (*update_end_hook) P_ ((struct frame *));
@@ -498,7 +498,7 @@
 
   /* Called to read input events.
 
-     DISPLAY indicates which display to read from.  Input events
+     DEVICE indicates which display device to read from.  Input events
      should be read into BUF, the size of which is given in SIZE.
      EXPECTED is non-zero if the caller suspects that new input is
      available.
@@ -507,7 +507,7 @@
      where read into BUF.
      Zero means no events were immediately available.
      A value of -1 means a transient read error, while -2 indicates
-     that the display was closed (hangup), and it should be deleted.
+     that the device was closed (hangup), and it should be deleted.
 
      XXX Please note that a non-zero value of EXPECTED only means that
      there is available input on at least one of the currently opened
@@ -515,7 +515,7 @@
      Therefore, in most cases EXPECTED should be simply ignored.
 
      XXX This documentation needs to be updated.  */
-  int (*read_socket_hook) P_ ((struct display *display,
+  int (*read_socket_hook) P_ ((struct device *device,
                                int expected,
                                struct input_event *hold_quit));
 
@@ -524,43 +524,43 @@
 
 
   /* Called to delete the device-specific portions of a frame that is
-     on this display. */
+     on this display device. */
   void (*delete_frame_hook) P_ ((struct frame *));
 
-  /* Called after the last frame on this display is deleted, or when
+  /* Called after the last frame on this device is deleted, or when
      the display device was closed (hangup).
      
-     If this is NULL, then the generic delete_display is called
-     instead.  Otherwise the hook must call delete_display itself.
+     If this is NULL, then the generic delete_device is called
+     instead.  Otherwise the hook must call delete_device itself.
 
      The hook must check for and close any live frames that are still
-     on the display.  Fdelete_frame ensures that there are no live
-     frames on the display when it calls this hook, so infinite
+     on the device.  Fdelete_frame ensures that there are no live
+     frames on the device when it calls this hook, so infinite
      recursion is prevented.  */
-  void (*delete_display_hook) P_ ((struct display *));
+  void (*delete_device_hook) P_ ((struct device *));
 };
 
 
-/* Chain of all displays currently in use. */
-extern struct display *display_list;
+/* Chain of all display devices currently in use. */
+extern struct device *device_list;
 
-#define FRAME_MUST_WRITE_SPACES(f) ((f)->display->must_write_spaces)
-#define FRAME_FAST_CLEAR_END_OF_LINE(f) ((f)->display->fast_clear_end_of_line)
-#define FRAME_LINE_INS_DEL_OK(f) ((f)->display->line_ins_del_ok)
-#define FRAME_CHAR_INS_DEL_OK(f) ((f)->display->char_ins_del_ok)
-#define FRAME_SCROLL_REGION_OK(f) ((f)->display->scroll_region_ok)
-#define FRAME_SCROLL_REGION_COST(f) ((f)->display->scroll_region_cost)
-#define FRAME_MEMORY_BELOW_FRAME(f) ((f)->display->memory_below_frame)
+#define FRAME_MUST_WRITE_SPACES(f) ((f)->device->must_write_spaces)
+#define FRAME_FAST_CLEAR_END_OF_LINE(f) ((f)->device->fast_clear_end_of_line)
+#define FRAME_LINE_INS_DEL_OK(f) ((f)->device->line_ins_del_ok)
+#define FRAME_CHAR_INS_DEL_OK(f) ((f)->device->char_ins_del_ok)
+#define FRAME_SCROLL_REGION_OK(f) ((f)->device->scroll_region_ok)
+#define FRAME_SCROLL_REGION_COST(f) ((f)->device->scroll_region_cost)
+#define FRAME_MEMORY_BELOW_FRAME(f) ((f)->device->memory_below_frame)
 
-#define FRAME_TERMINAL_CODING(f) ((f)->display->terminal_coding)
-#define FRAME_KEYBOARD_CODING(f) ((f)->display->keyboard_coding)
+#define FRAME_TERMINAL_CODING(f) ((f)->device->terminal_coding)
+#define FRAME_KEYBOARD_CODING(f) ((f)->device->keyboard_coding)
 
-#define DISPLAY_TERMINAL_CODING(d) ((d)->terminal_coding)
-#define DISPLAY_KEYBOARD_CODING(d) ((d)->keyboard_coding)
+#define DEVICE_TERMINAL_CODING(d) ((d)->terminal_coding)
+#define DEVICE_KEYBOARD_CODING(d) ((d)->keyboard_coding)
 
-#define FRAME_RIF(f) ((f)->display->rif)
+#define FRAME_RIF(f) ((f)->device->rif)
 
-#define FRAME_DISPLAY(f) ((f)->display)
+#define FRAME_DEVICE(f) ((f)->device)
 
 /* FRAME_WINDOW_P tests whether the frame is a window, and is
    defined to be the predicate for the window system being used.  */
@@ -578,14 +578,14 @@
 #define FRAME_WINDOW_P(f) (0)
 #endif
 
-/* Return true if the display is not suspended. */
-#define DISPLAY_ACTIVE_P(d) ((d)->type != output_termcap || (d)->display_info.tty->input)
+/* Return true if the display device is not suspended. */
+#define DEVICE_ACTIVE_P(d) ((d)->type != output_termcap || (d)->display_info.tty->input)
 
-extern struct display *create_display P_ ((void));
-extern void delete_display P_ ((struct display *));
+extern struct device *create_device P_ ((void));
+extern void delete_device P_ ((struct device *));
 
 /* The initial display device, created by initial_term_init. */
-extern struct display *initial_display;
+extern struct device *initial_device;
 
 /* arch-tag: 33a00ecc-52b5-4186-a410-8801ac9f087d
    (do not change this comment) */
--- a/src/xdisp.c	Sun Jul 10 22:25:28 2005 +0000
+++ b/src/xdisp.c	Mon Jul 11 00:05:55 2005 +0000
@@ -6958,8 +6958,8 @@
       do_pending_window_change (0);
       echo_area_display (1);
       do_pending_window_change (0);
-      if (FRAME_DISPLAY (f)->frame_up_to_date_hook != 0 && ! gc_in_progress)
-	(*FRAME_DISPLAY (f)->frame_up_to_date_hook) (f);
+      if (FRAME_DEVICE (f)->frame_up_to_date_hook != 0 && ! gc_in_progress)
+	(*FRAME_DEVICE (f)->frame_up_to_date_hook) (f);
     }
 }
 
@@ -7051,8 +7051,8 @@
       do_pending_window_change (0);
       echo_area_display (1);
       do_pending_window_change (0);
-      if (FRAME_DISPLAY (f)->frame_up_to_date_hook != 0 && ! gc_in_progress)
-	(*FRAME_DISPLAY (f)->frame_up_to_date_hook) (f);
+      if (FRAME_DEVICE (f)->frame_up_to_date_hook != 0 && ! gc_in_progress)
+	(*FRAME_DEVICE (f)->frame_up_to_date_hook) (f);
     }
 }
 
@@ -10549,16 +10549,16 @@
 
 	      /* Mark all the scroll bars to be removed; we'll redeem
 		 the ones we want when we redisplay their windows.  */
-	      if (FRAME_DISPLAY (f)->condemn_scroll_bars_hook)
-		FRAME_DISPLAY (f)->condemn_scroll_bars_hook (f);
+	      if (FRAME_DEVICE (f)->condemn_scroll_bars_hook)
+		FRAME_DEVICE (f)->condemn_scroll_bars_hook (f);
 
 	      if (FRAME_VISIBLE_P (f) && !FRAME_OBSCURED_P (f))
 		redisplay_windows (FRAME_ROOT_WINDOW (f));
 
 	      /* Any scroll bars which redisplay_windows should have
 		 nuked should now go away.  */
-	      if (FRAME_DISPLAY (f)->judge_scroll_bars_hook)
-		FRAME_DISPLAY (f)->judge_scroll_bars_hook (f);
+	      if (FRAME_DEVICE (f)->judge_scroll_bars_hook)
+		FRAME_DEVICE (f)->judge_scroll_bars_hook (f);
 
 	      /* If fonts changed, display again.  */
 	      /* ??? rms: I suspect it is a mistake to jump all the way
@@ -10610,8 +10610,8 @@
 	    {
 	      struct frame *f = updated[i];
 	      mark_window_display_accurate (f->root_window, 1);
-	      if (FRAME_DISPLAY (f)->frame_up_to_date_hook)
-		FRAME_DISPLAY (f)->frame_up_to_date_hook (f);
+	      if (FRAME_DEVICE (f)->frame_up_to_date_hook)
+		FRAME_DEVICE (f)->frame_up_to_date_hook (f);
 	    }
 	}
     }
@@ -10696,8 +10696,8 @@
 	  /* Say overlay arrows are up to date.  */
 	  update_overlay_arrows (1);
 
-	  if (FRAME_DISPLAY (sf)->frame_up_to_date_hook != 0)
-	    FRAME_DISPLAY (sf)->frame_up_to_date_hook (sf);
+	  if (FRAME_DEVICE (sf)->frame_up_to_date_hook != 0)
+	    FRAME_DEVICE (sf)->frame_up_to_date_hook (sf);
 	}
 
       update_mode_lines = 0;
@@ -11949,8 +11949,8 @@
     start = end = whole = 0;
 
   /* Indicate what this scroll bar ought to be displaying now.  */
-  if (FRAME_DISPLAY (XFRAME (w->frame))->set_vertical_scroll_bar_hook)
-    (*FRAME_DISPLAY (XFRAME (w->frame))->set_vertical_scroll_bar_hook)
+  if (FRAME_DEVICE (XFRAME (w->frame))->set_vertical_scroll_bar_hook)
+    (*FRAME_DEVICE (XFRAME (w->frame))->set_vertical_scroll_bar_hook)
       (w, end - start, whole, start);
 }
 
@@ -12690,8 +12690,8 @@
 
       /* Note that we actually used the scroll bar attached to this
 	 window, so it shouldn't be deleted at the end of redisplay.  */
-      if (FRAME_DISPLAY (f)->redeem_scroll_bar_hook)
-        (*FRAME_DISPLAY (f)->redeem_scroll_bar_hook) (w);
+      if (FRAME_DEVICE (f)->redeem_scroll_bar_hook)
+        (*FRAME_DEVICE (f)->redeem_scroll_bar_hook) (w);
     }
 
   /* Restore current_buffer and value of point in it.  */
--- a/src/xfns.c	Sun Jul 10 22:25:28 2005 +0000
+++ b/src/xfns.c	Mon Jul 11 00:05:55 2005 +0000
@@ -239,17 +239,18 @@
   return f;
 }
 
-/* Let the user specify an X display with a frame.
+/* Let the user specify an X display with a Lisp object.
+   OBJECT may be nil, a frame or a device id.
    nil stands for the selected frame--or, if that is not an X frame,
    the first X display on the list.  */
 
 struct x_display_info *
-check_x_display_info (frame)
-     Lisp_Object frame;
+check_x_display_info (object)
+     Lisp_Object object;
 {
   struct x_display_info *dpyinfo = NULL;
 
-  if (NILP (frame))
+  if (NILP (object))
     {
       struct frame *sf = XFRAME (selected_frame);
 
@@ -260,20 +261,20 @@
       else
 	error ("X windows are not in use or not initialized");
     }
-  else if (INTEGERP (frame))
+  else if (INTEGERP (object))
     {
-      struct display *d = get_display (XINT (frame), 1);
+      struct device *d = get_device (XINT (object), 1);
 
       if (d->type != output_x_window)
-        error ("Display %d is not an X display", XINT (frame));
+        error ("Display %d is not an X display", XINT (object));
 
       dpyinfo = d->display_info.x;
     }
-  else if (STRINGP (frame))
-    dpyinfo = x_display_info_for_name (frame);
+  else if (STRINGP (object))
+    dpyinfo = x_display_info_for_name (object);
   else
     {
-      FRAME_PTR f = check_x_frame (frame);
+      FRAME_PTR f = check_x_frame (object);
       dpyinfo = FRAME_X_DISPLAY_INFO (f);
     }
 
@@ -1444,10 +1445,10 @@
   if (FRAME_X_WINDOW (f) && FRAME_VISIBLE_P (f))
     {
       /* Remove all scroll bars because they have wrong colors.  */
-      if (FRAME_DISPLAY (f)->condemn_scroll_bars_hook)
-	(*FRAME_DISPLAY (f)->condemn_scroll_bars_hook) (f);
-      if (FRAME_DISPLAY (f)->judge_scroll_bars_hook)
-	(*FRAME_DISPLAY (f)->judge_scroll_bars_hook) (f);
+      if (FRAME_DEVICE (f)->condemn_scroll_bars_hook)
+	(*FRAME_DEVICE (f)->condemn_scroll_bars_hook) (f);
+      if (FRAME_DEVICE (f)->judge_scroll_bars_hook)
+	(*FRAME_DEVICE (f)->judge_scroll_bars_hook) (f);
 
       update_face_from_frame_parameter (f, Qscroll_bar_foreground, value);
       redraw_frame (f);
@@ -1493,10 +1494,10 @@
   if (FRAME_X_WINDOW (f) && FRAME_VISIBLE_P (f))
     {
       /* Remove all scroll bars because they have wrong colors.  */
-      if (FRAME_DISPLAY (f)->condemn_scroll_bars_hook)
-	(*FRAME_DISPLAY (f)->condemn_scroll_bars_hook) (f);
-      if (FRAME_DISPLAY (f)->judge_scroll_bars_hook)
-	(*FRAME_DISPLAY (f)->judge_scroll_bars_hook) (f);
+      if (FRAME_DEVICE (f)->condemn_scroll_bars_hook)
+	(*FRAME_DEVICE (f)->condemn_scroll_bars_hook) (f);
+      if (FRAME_DEVICE (f)->judge_scroll_bars_hook)
+	(*FRAME_DEVICE (f)->judge_scroll_bars_hook) (f);
 
       update_face_from_frame_parameter (f, Qscroll_bar_background, value);
       redraw_frame (f);
@@ -3007,14 +3008,14 @@
      until we know if this frame has a specified name.  */
   Vx_resource_name = Vinvocation_name;
 
-  display = x_get_arg (dpyinfo, parms, Qdisplay_id, 0, 0, RES_TYPE_NUMBER);
+  display = x_get_arg (dpyinfo, parms, Qdevice, 0, 0, RES_TYPE_NUMBER);
   if (EQ (display, Qunbound))
     display = x_get_arg (dpyinfo, parms, Qdisplay, 0, 0, RES_TYPE_STRING);
   if (EQ (display, Qunbound))
     display = Qnil;
   dpyinfo = check_x_display_info (display);
 #ifdef MULTI_KBOARD
-  kb = dpyinfo->frame_display->kboard;
+  kb = dpyinfo->device->kboard;
 #else
   kb = &the_only_kboard;
 #endif
@@ -3059,8 +3060,8 @@
   /* Note that X Windows does support scroll bars.  */
   FRAME_CAN_HAVE_SCROLL_BARS (f) = 1;
 
-  f->display = dpyinfo->frame_display;
-  f->display->reference_count++;
+  f->device = dpyinfo->device;
+  f->device->reference_count++;
 
   f->output_method = output_x_window;
   f->output_data.x = (struct x_output *) xmalloc (sizeof (struct x_output));
@@ -3475,10 +3476,10 @@
 
 DEFUN ("xw-display-color-p", Fxw_display_color_p, Sxw_display_color_p, 0, 1, 0,
        doc: /* Internal function called by `display-color-p', which see.  */)
-     (display)
-     Lisp_Object display;
+     (device)
+     Lisp_Object device;
 {
-  struct x_display_info *dpyinfo = check_x_display_info (display);
+  struct x_display_info *dpyinfo = check_x_display_info (device);
 
   if (dpyinfo->n_planes <= 2)
     return Qnil;
@@ -3500,13 +3501,13 @@
        0, 1, 0,
        doc: /* Return t if the X display supports shades of gray.
 Note that color displays do support shades of gray.
-The optional argument DISPLAY specifies which display to ask about.
-DISPLAY should be either a frame or a display name (a string).
-If omitted or nil, that stands for the selected frame's display.  */)
-     (display)
-     Lisp_Object display;
+The optional argument DEVICE specifies which display to ask about.
+DEVICE should be a device id, a frame or a display name (a string).
+If omitted or nil, that stands for the selected frame's display device.  */)
+     (device)
+     Lisp_Object device;
 {
-  struct x_display_info *dpyinfo = check_x_display_info (display);
+  struct x_display_info *dpyinfo = check_x_display_info (device);
 
   if (dpyinfo->n_planes <= 1)
     return Qnil;
@@ -3528,56 +3529,56 @@
 
 DEFUN ("x-display-pixel-width", Fx_display_pixel_width, Sx_display_pixel_width,
        0, 1, 0,
-       doc: /* Returns the width in pixels of the X display DISPLAY.
-The optional argument DISPLAY specifies which display to ask about.
-DISPLAY should be either a frame or a display name (a string).
+       doc: /* Returns the width in pixels of the X display DEVICE.
+The optional argument DEVICE specifies which display to ask about.
+DEVICE should be a device id, a frame or a display name (a string).
 If omitted or nil, that stands for the selected frame's display.  */)
-     (display)
-     Lisp_Object display;
+     (device)
+     Lisp_Object device;
 {
-  struct x_display_info *dpyinfo = check_x_display_info (display);
+  struct x_display_info *dpyinfo = check_x_display_info (device);
 
   return make_number (dpyinfo->width);
 }
 
 DEFUN ("x-display-pixel-height", Fx_display_pixel_height,
        Sx_display_pixel_height, 0, 1, 0,
-       doc: /* Returns the height in pixels of the X display DISPLAY.
-The optional argument DISPLAY specifies which display to ask about.
-DISPLAY should be either a frame or a display name (a string).
+       doc: /* Returns the height in pixels of the X display DEVICE.
+The optional argument DEVICE specifies which display to ask about.
+DEVICE should be a device id, a frame or a display name (a string).
 If omitted or nil, that stands for the selected frame's display.  */)
-     (display)
-     Lisp_Object display;
+     (device)
+     Lisp_Object device;
 {
-  struct x_display_info *dpyinfo = check_x_display_info (display);
+  struct x_display_info *dpyinfo = check_x_display_info (device);
 
   return make_number (dpyinfo->height);
 }
 
 DEFUN ("x-display-planes", Fx_display_planes, Sx_display_planes,
        0, 1, 0,
-       doc: /* Returns the number of bitplanes of the X display DISPLAY.
-The optional argument DISPLAY specifies which display to ask about.
-DISPLAY should be either a frame or a display name (a string).
+       doc: /* Returns the number of bitplanes of the X display DEVICE.
+The optional argument DEVICE specifies which display to ask about.
+DEVICE should be a device id, a frame or a display name (a string).
 If omitted or nil, that stands for the selected frame's display.  */)
-     (display)
-     Lisp_Object display;
+     (device)
+     Lisp_Object device;
 {
-  struct x_display_info *dpyinfo = check_x_display_info (display);
+  struct x_display_info *dpyinfo = check_x_display_info (device);
 
   return make_number (dpyinfo->n_planes);
 }
 
 DEFUN ("x-display-color-cells", Fx_display_color_cells, Sx_display_color_cells,
        0, 1, 0,
-       doc: /* Returns the number of color cells of the X display DISPLAY.
-The optional argument DISPLAY specifies which display to ask about.
-DISPLAY should be either a frame or a display name (a string).
+       doc: /* Returns the number of color cells of the X display DEVICE.
+The optional argument DEVICE specifies which display to ask about.
+DEVICE should be a device id, a frame or a display name (a string).
 If omitted or nil, that stands for the selected frame's display.  */)
-     (display)
-     Lisp_Object display;
+     (device)
+     Lisp_Object device;
 {
-  struct x_display_info *dpyinfo = check_x_display_info (display);
+  struct x_display_info *dpyinfo = check_x_display_info (device);
 
   int nr_planes = DisplayPlanes (dpyinfo->display,
                                  XScreenNumberOfScreen (dpyinfo->screen));
@@ -3595,29 +3596,29 @@
 DEFUN ("x-server-max-request-size", Fx_server_max_request_size,
        Sx_server_max_request_size,
        0, 1, 0,
-       doc: /* Returns the maximum request size of the X server of display DISPLAY.
-The optional argument DISPLAY specifies which display to ask about.
-DISPLAY should be either a frame or a display name (a string).
+       doc: /* Returns the maximum request size of the X server of display DEVICE.
+The optional argument DEVICE specifies which display to ask about.
+DEVICE should be a device id, a frame or a display name (a string).
 If omitted or nil, that stands for the selected frame's display.  */)
-     (display)
-     Lisp_Object display;
+     (device)
+     Lisp_Object device;
 {
-  struct x_display_info *dpyinfo = check_x_display_info (display);
+  struct x_display_info *dpyinfo = check_x_display_info (device);
 
   return make_number (MAXREQUEST (dpyinfo->display));
 }
 
 DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0,
-       doc: /* Returns the "vendor ID" string of the X server of display DISPLAY.
+       doc: /* Returns the "vendor ID" string of the X server of display DEVICE.
 \(Labelling every distributor as a "vendor" embodies the false assumption
 that operating systems cannot be developed and distributed noncommercially.)
-The optional argument DISPLAY specifies which display to ask about.
-DISPLAY should be either a frame or a display name (a string).
+The optional argument DEVICE specifies which display to ask about.
+DEVICE should be a device id, a frame or a display name (a string).
 If omitted or nil, that stands for the selected frame's display.  */)
-     (display)
-     Lisp_Object display;
+     (device)
+     Lisp_Object device;
 {
-  struct x_display_info *dpyinfo = check_x_display_info (display);
+  struct x_display_info *dpyinfo = check_x_display_info (device);
   char *vendor = ServerVendor (dpyinfo->display);
 
   if (! vendor) vendor = "";
@@ -3625,18 +3626,18 @@
 }
 
 DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0,
-       doc: /* Returns the version numbers of the X server of display DISPLAY.
+       doc: /* Returns the version numbers of the X server of display DEVICE.
 The value is a list of three integers: the major and minor
 version numbers of the X Protocol in use, and the distributor-specific release
 number.  See also the function `x-server-vendor'.
 
-The optional argument DISPLAY specifies which display to ask about.
-DISPLAY should be either a frame or a display name (a string).
+The optional argument DEVICE specifies which display to ask about.
+DEVICE should be a device id, a frame or a display name (a string).
 If omitted or nil, that stands for the selected frame's display.  */)
-     (display)
-     Lisp_Object display;
+     (device)
+     Lisp_Object device;
 {
-  struct x_display_info *dpyinfo = check_x_display_info (display);
+  struct x_display_info *dpyinfo = check_x_display_info (device);
   Display *dpy = dpyinfo->display;
 
   return Fcons (make_number (ProtocolVersion (dpy)),
@@ -3645,55 +3646,55 @@
 }
 
 DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0,
-       doc: /* Return the number of screens on the X server of display DISPLAY.
-The optional argument DISPLAY specifies which display to ask about.
-DISPLAY should be either a frame or a display name (a string).
+       doc: /* Return the number of screens on the X server of display DEVICE.
+The optional argument DEVICE specifies which display to ask about.
+DEVICE should be a device id, a frame or a display name (a string).
 If omitted or nil, that stands for the selected frame's display.  */)
-     (display)
-     Lisp_Object display;
+     (device)
+     Lisp_Object device;
 {
-  struct x_display_info *dpyinfo = check_x_display_info (display);
+  struct x_display_info *dpyinfo = check_x_display_info (device);
 
   return make_number (ScreenCount (dpyinfo->display));
 }
 
 DEFUN ("x-display-mm-height", Fx_display_mm_height, Sx_display_mm_height, 0, 1, 0,
-       doc: /* Return the height in millimeters of the X display DISPLAY.
-The optional argument DISPLAY specifies which display to ask about.
-DISPLAY should be either a frame or a display name (a string).
+       doc: /* Return the height in millimeters of the X display DEVICE.
+The optional argument DEVICE specifies which display to ask about.
+DEVICE should be a device id, a frame or a display name (a string).
 If omitted or nil, that stands for the selected frame's display.  */)
-     (display)
-     Lisp_Object display;
+     (device)
+     Lisp_Object device;
 {
-  struct x_display_info *dpyinfo = check_x_display_info (display);
+  struct x_display_info *dpyinfo = check_x_display_info (device);
 
   return make_number (HeightMMOfScreen (dpyinfo->screen));
 }
 
 DEFUN ("x-display-mm-width", Fx_display_mm_width, Sx_display_mm_width, 0, 1, 0,
-       doc: /* Return the width in millimeters of the X display DISPLAY.
-The optional argument DISPLAY specifies which display to ask about.
-DISPLAY should be either a frame or a display name (a string).
+       doc: /* Return the width in millimeters of the X display DEVICE.
+The optional argument DEVICE specifies which display to ask about.
+DEVICE should be a device id, a frame or a display name (a string).
 If omitted or nil, that stands for the selected frame's display.  */)
-     (display)
-     Lisp_Object display;
+     (device)
+     Lisp_Object device;
 {
-  struct x_display_info *dpyinfo = check_x_display_info (display);
+  struct x_display_info *dpyinfo = check_x_display_info (device);
 
   return make_number (WidthMMOfScreen (dpyinfo->screen));
 }
 
 DEFUN ("x-display-backing-store", Fx_display_backing_store,
        Sx_display_backing_store, 0, 1, 0,
-       doc: /* Returns an indication of whether X display DISPLAY does backing store.
+       doc: /* Returns an indication of whether X display DEVICE does backing store.
 The value may be `always', `when-mapped', or `not-useful'.
-The optional argument DISPLAY specifies which display to ask about.
-DISPLAY should be either a frame or a display name (a string).
+The optional argument DEVICE specifies which display to ask about.
+DEVICE should be a device id, a frame or a display name (a string).
 If omitted or nil, that stands for the selected frame's display.  */)
-     (display)
-     Lisp_Object display;
+     (device)
+     Lisp_Object device;
 {
-  struct x_display_info *dpyinfo = check_x_display_info (display);
+  struct x_display_info *dpyinfo = check_x_display_info (device);
   Lisp_Object result;
 
   switch (DoesBackingStore (dpyinfo->screen))
@@ -3720,17 +3721,17 @@
 
 DEFUN ("x-display-visual-class", Fx_display_visual_class,
        Sx_display_visual_class, 0, 1, 0,
-       doc: /* Return the visual class of the X display DISPLAY.
+       doc: /* Return the visual class of the X display DEVICE.
 The value is one of the symbols `static-gray', `gray-scale',
 `static-color', `pseudo-color', `true-color', or `direct-color'.
 
-The optional argument DISPLAY specifies which display to ask about.
-DISPLAY should be either a frame or a display name (a string).
+The optional argument DEVICE specifies which display to ask about.
+DEVICE should a device id, a frame or a display name (a string).
 If omitted or nil, that stands for the selected frame's display.  */)
-     (display)
-     Lisp_Object display;
+     (device)
+     Lisp_Object device;
 {
-  struct x_display_info *dpyinfo = check_x_display_info (display);
+  struct x_display_info *dpyinfo = check_x_display_info (device);
   Lisp_Object result;
 
   switch (dpyinfo->visual->class)
@@ -3763,14 +3764,14 @@
 
 DEFUN ("x-display-save-under", Fx_display_save_under,
        Sx_display_save_under, 0, 1, 0,
-       doc: /* Returns t if the X display DISPLAY supports the save-under feature.
-The optional argument DISPLAY specifies which display to ask about.
-DISPLAY should be either a frame or a display name (a string).
+       doc: /* Returns t if the X display DEVICE supports the save-under feature.
+The optional argument DEVICE specifies which display to ask about.
+DEVICE should be a device id, a frame or a display name (a string).
 If omitted or nil, that stands for the selected frame's display.  */)
-     (display)
-     Lisp_Object display;
+     (device)
+     Lisp_Object device;
 {
-  struct x_display_info *dpyinfo = check_x_display_info (display);
+  struct x_display_info *dpyinfo = check_x_display_info (device);
 
   if (DoesSaveUnders (dpyinfo->screen) == True)
     return Qt;
@@ -4050,7 +4051,7 @@
   if (dpyinfo->reference_count > 0)
     error ("Display still has frames on it");
 
-  x_delete_frame_display (dpyinfo->frame_display);
+  x_delete_device (dpyinfo->device);
 
   return Qnil;
 }
@@ -4627,8 +4628,8 @@
   FRAME_CAN_HAVE_SCROLL_BARS (f) = 0;
   record_unwind_protect (unwind_create_tip_frame, frame);
 
-  f->display = dpyinfo->frame_display;
-  f->display->reference_count++;
+  f->device = dpyinfo->device;
+  f->device->reference_count++;
 
   /* By setting the output method, we're essentially saying that
      the frame is live, as per FRAME_LIVE_P.  If we get a signal
--- a/src/xselect.c	Sun Jul 10 22:25:28 2005 +0000
+++ b/src/xselect.c	Mon Jul 11 00:05:55 2005 +0000
@@ -1010,7 +1010,7 @@
      to see if this Emacs job now owns the selection
      through that display.  */
   for (t_dpyinfo = x_display_list; t_dpyinfo; t_dpyinfo = t_dpyinfo->next)
-    if (t_dpyinfo->frame_display->kboard == dpyinfo->frame_display->kboard)
+    if (t_dpyinfo->device->kboard == dpyinfo->device->kboard)
       {
 	Window owner_window
 	  = XGetSelectionOwner (t_dpyinfo->display, selection);
--- a/src/xterm.c	Sun Jul 10 22:25:28 2005 +0000
+++ b/src/xterm.c	Mon Jul 11 00:05:55 2005 +0000
@@ -337,15 +337,15 @@
 void x_set_window_size P_ ((struct frame *, int, int, int));
 void x_wm_set_window_state P_ ((struct frame *, int));
 void x_wm_set_icon_pixmap P_ ((struct frame *, int));
-struct display *x_create_frame_display P_ ((struct x_display_info *));
-void x_delete_frame_display P_ ((struct display *));
+struct device *x_create_device P_ ((struct x_display_info *));
+void x_delete_device P_ ((struct device *));
 void x_initialize P_ ((void));
 static void x_font_min_bounds P_ ((XFontStruct *, int *, int *));
 static int x_compute_min_glyph_bounds P_ ((struct frame *));
 static void x_update_end P_ ((struct frame *));
 static void XTframe_up_to_date P_ ((struct frame *));
-static void XTset_terminal_modes P_ ((struct display *));
-static void XTreset_terminal_modes P_ ((struct display *));
+static void XTset_terminal_modes P_ ((struct device *));
+static void XTreset_terminal_modes P_ ((struct device *));
 static void x_clear_frame P_ ((struct frame *));
 static void frame_highlight P_ ((struct frame *));
 static void frame_unhighlight P_ ((struct frame *));
@@ -805,7 +805,7 @@
    rarely happens).  */
 
 static void
-XTset_terminal_modes (struct display *display)
+XTset_terminal_modes (struct device *device)
 {
 }
 
@@ -813,7 +813,7 @@
    the X-windows go away, and suspending requires no action.  */
 
 static void
-XTreset_terminal_modes (struct display *display)
+XTreset_terminal_modes (struct device *device)
 {
 }
 
@@ -6966,8 +6966,8 @@
    EXPECTED is nonzero if the caller knows input is available.  */
 
 static int
-XTread_socket (display, expected, hold_quit)
-     struct display *display;
+XTread_socket (device, expected, hold_quit)
+     struct device *device;
      int expected;
      struct input_event *hold_quit;
 {
@@ -7677,7 +7677,7 @@
       /* Protect display from being closed when we delete the last
          frame on it. */
       dpyinfo->reference_count++;
-      dpyinfo->frame_display->reference_count++;
+      dpyinfo->device->reference_count++;
     }
   
   /* First delete frames whose mini-buffers are on frames
@@ -7745,7 +7745,7 @@
       dpyinfo->display = 0;
 
       dpyinfo->reference_count--;
-      dpyinfo->frame_display->reference_count--;
+      dpyinfo->device->reference_count--;
       if (dpyinfo->reference_count != 0)
         /* We have just closed all frames on this display. */
         abort ();
@@ -7755,7 +7755,7 @@
 
   x_uncatch_errors (dpy, count);
 
-  if (display_list == 0)
+  if (device_list == 0)
     {
       fprintf (stderr, "%s\n", error_msg);
       shut_down_emacs (0, 0, Qnil);
@@ -10136,7 +10136,7 @@
 {
   int connection;
   Display *dpy;
-  struct display *display;
+  struct device *device;
   struct x_display_info *dpyinfo;
   XrmDatabase xrdb;
 
@@ -10271,7 +10271,7 @@
   dpyinfo = (struct x_display_info *) xmalloc (sizeof (struct x_display_info));
   bzero (dpyinfo, sizeof *dpyinfo);
 
-  display = x_create_frame_display (dpyinfo);
+  device = x_create_device (dpyinfo);
 
 #ifdef MULTI_KBOARD
   {
@@ -10284,30 +10284,30 @@
 			 SDATA (display_name)))
 	break;
     if (share)
-      display->kboard = share->frame_display->kboard;
+      device->kboard = share->device->kboard;
     else
       {
-	display->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
-	init_kboard (display->kboard);
+	device->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
+	init_kboard (device->kboard);
 	if (!EQ (XSYMBOL (Qvendor_specific_keysyms)->function, Qunbound))
 	  {
 	    char *vendor = ServerVendor (dpy);
 	    UNBLOCK_INPUT;
-	    display->kboard->Vsystem_key_alist
+	    device->kboard->Vsystem_key_alist
 	      = call1 (Qvendor_specific_keysyms,
 		       build_string (vendor ? vendor : ""));
 	    BLOCK_INPUT;
 	  }
 
-	display->kboard->next_kboard = all_kboards;
-	all_kboards = display->kboard;
+	device->kboard->next_kboard = all_kboards;
+	all_kboards = device->kboard;
 	/* Don't let the initial kboard remain current longer than necessary.
 	   That would cause problems if a file loaded on startup tries to
 	   prompt in the mini-buffer.  */
 	if (current_kboard == initial_kboard)
-	  current_kboard = display->kboard;
+	  current_kboard = device->kboard;
       }
-    display->kboard->reference_count++;
+    device->kboard->reference_count++;
   }
 #endif
 
@@ -10322,10 +10322,10 @@
 
   dpyinfo->display = dpy;
 
-  /* Set the name of the display. */
-  display->name = (char *) xmalloc (SBYTES (display_name) + 1);
-  strncpy (display->name, SDATA (display_name), SBYTES (display_name));
-  display->name[SBYTES (display_name)] = 0;
+  /* Set the name of the device. */
+  device->name = (char *) xmalloc (SBYTES (display_name) + 1);
+  strncpy (device->name, SDATA (display_name), SBYTES (display_name));
+  device->name[SBYTES (display_name)] = 0;
   
 #if 0
   XSetAfterFunction (x_current_display, x_trace_wire);
@@ -10632,13 +10632,13 @@
      struct x_display_info *dpyinfo;
 {
   int i;
-  struct display *d;
-
-  /* Delete the generic struct display for this X display. */
-  for (d = display_list; d; d = d->next_display)
+  struct device *d;
+
+  /* Delete the generic struct device for this X display. */
+  for (d = device_list; d; d = d->next_device)
     if (d->type == output_x_window && d->display_info.x == dpyinfo)
       {
-        delete_display (d);
+        delete_device (d);
         break;
       }
     
@@ -10773,9 +10773,9 @@
 
 /* This function is called when the last frame on a display is deleted. */
 void
-x_delete_frame_display (struct display *display)
-{
-  struct x_display_info *dpyinfo = display->display_info.x;
+x_delete_device (struct device *device)
+{
+  struct x_display_info *dpyinfo = device->display_info.x;
   int i;
 
   BLOCK_INPUT;
@@ -10804,50 +10804,50 @@
 }
 
 
-struct display *
-x_create_frame_display (struct x_display_info *dpyinfo)
-{
-  struct display *display;
+struct device *
+x_create_device (struct x_display_info *dpyinfo)
+{
+  struct device *device;
   
-  display = create_display ();
-
-  display->type = output_x_window;
-  display->display_info.x = dpyinfo;
-  dpyinfo->frame_display = display;
+  device = create_device ();
+
+  device->type = output_x_window;
+  device->display_info.x = dpyinfo;
+  dpyinfo->device = device;
 
   /* kboard is initialized in x_term_init. */
   
-  display->clear_frame_hook = x_clear_frame;
-  display->ins_del_lines_hook = x_ins_del_lines;
-  display->delete_glyphs_hook = x_delete_glyphs;
-  display->ring_bell_hook = XTring_bell;
-  display->reset_terminal_modes_hook = XTreset_terminal_modes;
-  display->set_terminal_modes_hook = XTset_terminal_modes;
-  display->update_begin_hook = x_update_begin;
-  display->update_end_hook = x_update_end;
-  display->set_terminal_window_hook = XTset_terminal_window;
-  display->read_socket_hook = XTread_socket;
-  display->frame_up_to_date_hook = XTframe_up_to_date;
-  display->mouse_position_hook = XTmouse_position;
-  display->frame_rehighlight_hook = XTframe_rehighlight;
-  display->frame_raise_lower_hook = XTframe_raise_lower;
-  display->set_vertical_scroll_bar_hook = XTset_vertical_scroll_bar;
-  display->condemn_scroll_bars_hook = XTcondemn_scroll_bars;
-  display->redeem_scroll_bar_hook = XTredeem_scroll_bar;
-  display->judge_scroll_bars_hook = XTjudge_scroll_bars;
-
-  display->delete_frame_hook = x_destroy_window;
-  display->delete_display_hook = x_delete_frame_display;
+  device->clear_frame_hook = x_clear_frame;
+  device->ins_del_lines_hook = x_ins_del_lines;
+  device->delete_glyphs_hook = x_delete_glyphs;
+  device->ring_bell_hook = XTring_bell;
+  device->reset_terminal_modes_hook = XTreset_terminal_modes;
+  device->set_terminal_modes_hook = XTset_terminal_modes;
+  device->update_begin_hook = x_update_begin;
+  device->update_end_hook = x_update_end;
+  device->set_terminal_window_hook = XTset_terminal_window;
+  device->read_socket_hook = XTread_socket;
+  device->frame_up_to_date_hook = XTframe_up_to_date;
+  device->mouse_position_hook = XTmouse_position;
+  device->frame_rehighlight_hook = XTframe_rehighlight;
+  device->frame_raise_lower_hook = XTframe_raise_lower;
+  device->set_vertical_scroll_bar_hook = XTset_vertical_scroll_bar;
+  device->condemn_scroll_bars_hook = XTcondemn_scroll_bars;
+  device->redeem_scroll_bar_hook = XTredeem_scroll_bar;
+  device->judge_scroll_bars_hook = XTjudge_scroll_bars;
+
+  device->delete_frame_hook = x_destroy_window;
+  device->delete_device_hook = x_delete_device;
   
-  display->rif = &x_redisplay_interface;
-  display->scroll_region_ok = 1;    /* We'll scroll partial frames. */
-  display->char_ins_del_ok = 1;
-  display->line_ins_del_ok = 1;         /* We'll just blt 'em. */
-  display->fast_clear_end_of_line = 1;  /* X does this well. */
-  display->memory_below_frame = 0;   /* We don't remember what scrolls
+  device->rif = &x_redisplay_interface;
+  device->scroll_region_ok = 1;    /* We'll scroll partial frames. */
+  device->char_ins_del_ok = 1;
+  device->line_ins_del_ok = 1;         /* We'll just blt 'em. */
+  device->fast_clear_end_of_line = 1;  /* X does this well. */
+  device->memory_below_frame = 0;   /* We don't remember what scrolls
                                         off the bottom. */
 
-  return display;
+  return device;
 }
 
 void
--- a/src/xterm.h	Sun Jul 10 22:25:28 2005 +0000
+++ b/src/xterm.h	Mon Jul 11 00:05:55 2005 +0000
@@ -388,7 +388,7 @@
     } wm_type;
 
   /* The generic display parameters corresponding to this X display. */
-  struct display *frame_display;
+  struct device *device;
 };
 
 #ifdef HAVE_X_I18N