diff src/keyboard.c @ 83431:76396de7f50a

Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly. * src/termhooks.h (struct device): Rename to `terminal'. Rename member `next_device' to `next_terminal'. (device_list): Rename to `terminal_list'. (FRAME_DEVICE): Rename to `FRAME_TERMINAL'. (DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'. (TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'. (DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'. Update declarations and macro definitions. * src/termchar.h (tty_display_info): Rename member `device' to `terminal'. (FRAME_TTY): Update for renames. * src/xterm.h (x_display_info): Rename member `device' to `terminal'. * src/frame.h (frame): Rename `device' member to `terminal'. (FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p): Update for renames. * src/lisp.h (set_process_environment): Rename to `set_global_environment'. (device): Rename to `terminal'. * src/dispextern.h: Update declarations and macro definitions. * src/terminal.c (device_list): Rename to `terminal_list'. (next_device_id): Rename to `next_terminal_id'. (initial_device): Rename to `initial_terminal'. (get_device): Rename to `get_terminal'. (create_device): Rename to `create_terminal'. (mark_devices): Rename to `mark_terminals'. (delete_device): Rename to `delete_terminal'. (Fdelete_display): Rename to `Fdelete_terminal'. (Fframe_terminal): Move here from frame.c. (Fdisplay_live_p): Rename to `Fterminal_live_p'. (Fdisplay_list): Rename to `Fterminal_list'. (Fdisplay_name): Rename to `Fterminal_name'. (init_initial_device): Rename to `init_initial_terminal'. (delete_initial_device): Rename to `delete_initial_terminal'. (ring_bell, update_begin, update_end, set_terminal_window) (cursor_to, raw_cursor_to, clear_to_end, clear_frame) (clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs) (ins_del_lines, get_terminal_param, store_terminal_param) (Fterminal_parameters, Fterminal_parameter) (Fmodify_terminal_parameters, Fset_terminal_parameter) (syms_of_terminal): Update for renames. * src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update. (Fdisplay_tty_type): Rename to `Ftty_type'. (Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'. (delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes) (Ftty_display_color_p, Ftty_display_color_cells, get_named_tty) (Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output) (init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename. * src/frame.c (Qdevice): Rename to `Qterminal'. (Qdisplay_live_p): Rename to `Qterminal_live_p'. (terminal_frame_count): Rename to `tty_frame_count'. (Fframe_display): Move to terminal.c, rename to `Fframe_terminal'. (make_frame_without_minibuffer, make_initial_frame) (make_terminal_frame, Fmodify_frame_parameters) (do_switch_frame, Fdelete_frame, Fmouse_position) (Fmouse_pixel_position, Fraise_frame, Flower_frame) (Fredirect_frame_focus, set_term_frame_name, syms_of_frame): Update for renames. * src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal) (set_vertical_scroll_bar, redisplay_window, check_x_display_info) (x_set_scroll_bar_foreground, x_set_scroll_bar_background) (Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p) (Fx_display_pixel_width, Fx_display_pixel_height) (Fx_display_planes, Fx_display_color_cells) (Fx_server_max_request_size, Fx_server_vendor, Fx_server_version) (Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width) (Fx_display_backing_store, Fx_display_visual_class) (Fx_display_save_under, Fx_close_connection, x_create_tip_frame): Update for renames. * xterm.c (handle_one_xevent): Initialize `f' to NULL. (x_delete_device): Rename to `x_delete_terminal'. (x_create_device): Rename to `x_create_terminal'. (XTset_terminal_modes, XTreset_terminal_modes) (XTread_socket, x_connection_closed, x_term_init) (x_term_init, x_delete_display): Update for renames. * src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal) (Fsend_string_to_terminal, init_display): Update for renames. * src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard) (kbd_buffer_get_event, read_avail_input, tty_read_avail_input) (interrupt_signal, Fset_output_flow_control) (Fset_input_meta_mode, Fset_quit_char, delete_kboard) (syms_of_keyboard): Update for renames. * src/alloc.c (mark_devices): Update declaration. (Fgarbage_collect): Update for renames. * src/coding.c (Fset_terminal_coding_system_internal) (Fterminal_coding_system4) (Fset_keyboard_coding_system_internal) (Fkeyboard_coding_system): Update for renames. * src/data.c (Fterminal_local_value, Fset_terminal_local_value): Update for renames. * src/minibuf.c (read_minibuf): Update for renames. * src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames. * xselect.c (x_handle_selection_clear): Update for renames. * lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'. (save-buffers-kill-terminal, ctl-x-map): Update for renames. * frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update. (frames-on-display-list, framep-on-display, suspend-frame): Update for renames. (selected-display): Rename to `selected-terminal'. * server.el (server-save-buffers-kill-display): Rename to `server-save-buffers-kill-terminal'. (server-delete-client, server-handle-delete-frame) (server-handle-suspend-tty, server-process-filter) (server-switch-buffer): Update for renames. * startup.el (normal-splash-screen, normal-splash-screen): Update for renames. * talk.el (talk): Update for renames. * termdev.el (terminal-id): Update for renames. * xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal) (turn-off-xterm-mouse-tracking-on-terminal) (xterm-mouse-handle-delete-frame): Update for renames. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
author Karoly Lorentey <lorentey@elte.hu>
date Thu, 29 Dec 2005 18:20:26 +0000
parents ec395f552d45
children 1b1b0cb2e2a8
line wrap: on
line diff
--- a/src/keyboard.c	Thu Dec 29 04:57:14 2005 +0000
+++ b/src/keyboard.c	Thu Dec 29 18:20:26 2005 +0000
@@ -1130,19 +1130,19 @@
 push_frame_kboard (f)
      FRAME_PTR f;
 {
-  push_kboard (f->device->kboard);
+  push_kboard (f->terminal->kboard);
 }
 
 void
 pop_kboard ()
 {
 #ifdef MULTI_KBOARD
-  struct device *d;
+  struct terminal *t;
   struct kboard_stack *p = kboard_stack;
   current_kboard = NULL;
-  for (d = device_list; d; d = d->next_device)
-    {
-      if (d->kboard == p->kboard)
+  for (t = terminal_list; t; t = t->next_terminal)
+    {
+      if (t->kboard == p->kboard)
         {
           current_kboard = p->kboard;
           break;
@@ -1150,7 +1150,7 @@
     }
   if (current_kboard == NULL)
     {
-      /* The display we remembered has been deleted.  */
+      /* The terminal we remembered has been deleted.  */
       current_kboard = FRAME_KBOARD (SELECTED_FRAME ());
     }
   kboard_stack = p->next;
@@ -4205,15 +4205,15 @@
       unsigned long time;
 
       *kbp = current_kboard;
-      /* Note that this uses F to determine which display to look at.
+      /* Note that this uses F to determine which terminal to look at.
 	 If there is no valid info, it does not store anything
 	 so x remains nil.  */
       x = Qnil;
 
       /* XXX Can f or mouse_position_hook be NULL here? */
-      if (f && FRAME_DEVICE (f)->mouse_position_hook)
-        (*FRAME_DEVICE (f)->mouse_position_hook) (&f, 0, &bar_window,
-                                                  &part, &x, &y, &time);
+      if (f && FRAME_TERMINAL (f)->mouse_position_hook)
+        (*FRAME_TERMINAL (f)->mouse_position_hook) (&f, 0, &bar_window,
+                                                    &part, &x, &y, &time);
 
       obj = Qnil;
 
@@ -6749,15 +6749,15 @@
 {
   int nread = 0;
   int err = 0;
-  struct device *d;
-
-  /* Loop through the available devices, and call their input hooks. */
-  d = device_list;
-  while (d)
-    {
-      struct device *next = d->next_device;
-
-      if (d->read_socket_hook)
+  struct terminal *t;
+
+  /* Loop through the available terminals, and call their input hooks. */
+  t = terminal_list;
+  while (t)
+    {
+      struct terminal *next = t->next_terminal;
+
+      if (t->read_socket_hook)
         {
           int nr;
           struct input_event hold_quit;
@@ -6766,7 +6766,7 @@
           hold_quit.kind = NO_EVENT;
 
           /* No need for FIONREAD or fcntl; just say don't wait.  */
-          while (nr = (*d->read_socket_hook) (d, expected, &hold_quit), nr > 0)
+          while (nr = (*t->read_socket_hook) (t, expected, &hold_quit), nr > 0)
             {
               nread += nr;
               expected = 0;
@@ -6778,10 +6778,10 @@
             }
           else if (nr == -2)          /* Non-transient error. */
             {
-              /* The display device terminated; it should be closed. */
+              /* The terminal device terminated; it should be closed. */
               
-              /* Kill Emacs if this was our last display. */
-              if (! device_list->next_device)
+              /* Kill Emacs if this was our last terminal. */
+              if (!terminal_list->next_terminal)
                 /* 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
@@ -6792,18 +6792,18 @@
                    alone in its group.  */
                 kill (getpid (), SIGHUP);
               
-              /* XXX Is calling delete_device safe here?  It calls Fdelete_frame. */
-              if (d->delete_device_hook)
-                (*d->delete_device_hook) (d);
+              /* XXX Is calling delete_terminal safe here?  It calls Fdelete_frame. */
+              if (t->delete_terminal_hook)
+                (*t->delete_terminal_hook) (t);
               else
-                delete_device (d);
+                delete_terminal (t);
             }
 
           if (hold_quit.kind != NO_EVENT)
             kbd_buffer_store_event (&hold_quit);
         }
 
-      d = next;
+      t = next;
     }
 
   if (err && !nread)
@@ -6814,12 +6814,12 @@
 
 /* This is the tty way of reading available input.
 
-   Note that each terminal device has its own `struct device' object,
+   Note that each terminal device has its own `struct terminal' object,
    and so this function is called once for each individual termcap
-   display.  The first parameter indicates which device to read from.  */
+   terminal.  The first parameter indicates which terminal to read from.  */
 
 int
-tty_read_avail_input (struct device *device,
+tty_read_avail_input (struct terminal *terminal,
                       int expected,
                       struct input_event *hold_quit)
 {
@@ -6828,10 +6828,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 = device->display_info.tty;
+  struct tty_display_info *tty = terminal->display_info.tty;
   int nread = 0;
 
-  if (device->type != output_termcap)
+  if (terminal->type != output_termcap)
     abort ();
 
   /* XXX I think the following code should be moved to separate hook
@@ -6861,7 +6861,7 @@
   if (ioctl (fileno (tty->input), FIONREAD, &n_to_read) < 0)
     {
       if (! noninteractive)
-        return -2;          /* Close this device. */
+        return -2;          /* Close this terminal. */
       else
         n_to_read = 0;
     }
@@ -6890,14 +6890,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 device. */
+        return -2;          /* Close this terminal. */
 #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 device. */
+        return -2;          /* Close this terminal. */
 #endif
     }
   while (
@@ -10440,7 +10440,7 @@
 {
   /* Must preserve main program's value of errno.  */
   int old_errno = errno;
-  struct device *device;
+  struct terminal *terminal;
 
 #if defined (USG) && !defined (POSIX_SIGNALS)
   /* USG systems forget handlers when they are used;
@@ -10451,9 +10451,9 @@
 
   SIGNAL_THREAD_CHECK (signalnum);
 
-  /* See if we have an active display on our controlling terminal. */
-  device = get_named_tty (NULL);
-  if (!device)
+  /* See if we have an active terminal on our controlling tty. */
+  terminal = get_named_tty (NULL);
+  if (!terminal)
     {
       /* If there are no frames there, let's pretend that we are a
          well-behaving UN*X program and quit. */
@@ -10467,7 +10467,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 = device->display_info.tty->top_frame;
+      internal_last_event_frame = terminal->display_info.tty->top_frame;
 
       handle_interrupt ();
     }
@@ -10710,18 +10710,18 @@
 If FLOW is non-nil, flow control is enabled and you cannot use C-s or
 C-q in key sequences.
 
-This setting only has an effect on tty display devices and only when
+This setting only has an effect on tty terminals and only when
 Emacs reads input in CBREAK mode; see `set-input-interrupt-mode'.
 
 See also `current-input-mode'.  */)
        (flow, terminal)
        Lisp_Object flow, terminal;
 {
-  struct device *d = get_device (terminal, 1);
+  struct terminal *t = get_terminal (terminal, 1);
   struct tty_display_info *tty;
-  if (d == NULL || d->type != output_termcap)
+  if (t == NULL || t->type != output_termcap)
     return Qnil;
-  tty = d->display_info.tty;
+  tty = t->display_info.tty;
 
   if (tty->flow_control != !NILP (flow))
     {
@@ -10750,9 +10750,9 @@
 Otherwise, Emacs will accept and pass through 8-bit input without
 specially interpreting the top bit.
 
-This setting only has an effect on tty display devices.
-
-Optional parameter TERMINAL specifies the tty display device to use.
+This setting only has an effect on tty terminal devices.
+
+Optional parameter TERMINAL specifies the tty terminal device to use.
 It may be a terminal id, a frame, or nil for the terminal used by the
 currently selected frame.
 
@@ -10760,13 +10760,13 @@
        (meta, terminal)
        Lisp_Object meta, terminal;
 {
-  struct device *d = get_device (terminal, 1);
+  struct terminal *t = get_terminal (terminal, 1);
   struct tty_display_info *tty;
   int new_meta;
   
-  if (d == NULL || d->type != output_termcap)
+  if (t == NULL || t->type != output_termcap)
     return Qnil;
-  tty = d->display_info.tty;
+  tty = t->display_info.tty;
 
   if (NILP (meta))
     new_meta = 0;
@@ -10795,18 +10795,18 @@
        doc: /* Specify character used for quitting.
 QUIT must be an ASCII character.
 
-This function only has an effect on the tty display on the controlling
+This function only has an effect on the terminal on the controlling
 tty of the Emacs process.
 
 See also `current-input-mode'.  */)
        (quit)
        Lisp_Object quit;
 {
-  struct device *d = get_named_tty (NULL);
+  struct terminal *t = get_named_tty (NULL);
   struct tty_display_info *tty;
-  if (d == NULL || d->type != output_termcap)
+  if (t == NULL || t->type != output_termcap)
     return Qnil;
-  tty = d->display_info.tty;
+  tty = t->display_info.tty;
 
 #ifndef DOS_NT
   /* this causes startup screen to be restored and messes with the mouse */
@@ -11025,7 +11025,7 @@
       && FRAMEP (selected_frame)
       && FRAME_LIVE_P (XFRAME (selected_frame)))
     {
-      current_kboard = XFRAME (selected_frame)->device->kboard;
+      current_kboard = XFRAME (selected_frame)->terminal->kboard;
       if (current_kboard == kb)
 	abort ();
     }
@@ -11463,7 +11463,7 @@
 The value `kill-region' is special; it means that the previous command
 was a kill command.
 
-`last-command' has a separate binding for each display device.
+`last-command' has a separate binding for each terminal device.
 See Info node `(elisp)Multiple displays'.  */);
 
   DEFVAR_KBOARD ("real-last-command", Vreal_last_command,
@@ -11589,8 +11589,8 @@
 This is applied to the characters supplied to input methods, not their
 output.  See also `translation-table-for-input'.
 
-`local-keyboard-translate-table' has a separate binding for each
-terminal.  See Info node `(elisp)Multiple displays'.  */);
+This variable has a separate binding for each terminal.  See Info node
+`(elisp)Multiple displays'.  */);
 
   DEFVAR_BOOL ("cannot-suspend", &cannot_suspend,
 	       doc: /* Non-nil means to always spawn a subshell instead of suspending.
@@ -11677,7 +11677,8 @@
 This variable is intended to let commands such as `universal-argument'
 set up a different keymap for reading the next command.
 
-`overriding-terminal-local-map' has a separate binding for each display device.
+`overriding-terminal-local-map' has a separate binding for each
+terminal device.
 See Info node `(elisp)Multiple displays'.  */);
 
   DEFVAR_LISP ("overriding-local-map", &Voverriding_local_map,
@@ -11705,7 +11706,7 @@
 numeric keysym code (sans the \"system-specific\" bit 1<<28)
 and SYMBOL is its name.
 
-`system-key-alist' has a separate binding for each display device.
+`system-key-alist' has a separate binding for each terminal device.
 See Info node `(elisp)Multiple displays'.  */);
 
   DEFVAR_KBOARD ("local-function-key-map", Vlocal_function_key_map,
@@ -11731,15 +11732,15 @@
 `C-x ESC O P' would return [?\\C-x f1].  If [f1] were a prefix key,
 typing `ESC O P x' would return [f1 x].
 
-`local-function-key-map' has a separate binding for each display
+`local-function-key-map' has a separate binding for each terminal
 device.  See Info node `(elisp)Multiple displays'.  If you need to
-define a binding on all display devices, change `function-key-map'
+define a binding on all terminals, change `function-key-map'
 instead.  Initially, `local-function-key-map' is an empty keymap that
-has `function-key-map' as its parent on all display devices.  */);
+has `function-key-map' as its parent on all terminal devices.  */);
 
   DEFVAR_LISP ("function-key-map", &Vfunction_key_map,
                doc: /* The parent keymap of all `local-function-key-map' instances.
-Function key definitions that apply to all display devices should go
+Function key definitions that apply to all terminal devices should go
 here.  If a mapping is defined in both the current
 `local-function-key-map' binding and this variable, then the local
 definition will take precendence.  */);
@@ -11750,13 +11751,13 @@
 This keymap works like `function-key-map', but comes after that,
 and its non-prefix bindings override ordinary bindings.
 
-`key-translation-map' has a separate binding for each display device.
+`key-translation-map' has a separate binding for each terminal device.
 (See Info node `(elisp)Multiple displays'.)  If you need to set a key
-translation on all devices, change `global-key-translation-map' instead.  */);
+translation on all terminals, change `global-key-translation-map' instead.  */);
 
   DEFVAR_LISP ("key-translation-map", &Vkey_translation_map,
                doc: /* The parent keymap of all `local-key-translation-map' instances.
-Key translations that apply to all display devices should go here.  */);
+Key translations that apply to all terminal devices should go here.  */);
   Vkey_translation_map = Fmake_sparse_keymap (Qnil);
 
   DEFVAR_LISP ("deferred-action-list", &Vdeferred_action_list,