1. 27 Dec, 2003 2 commits
    • Karoly Lorentey's avatar
      Fully eliminated global tty state variables. · fca177d4
      Karoly Lorentey authored
      lib-src/emacsclient.c (main.c): Fix error message.
      
      lisp/frame.el (make-frame-on-tty): New function.
      
      lisp/server.el (server-process-filter): Notify emacsclient if there
      was on error during evaluation.
      
      src/cm.c: Fix remaining cases of direct Wcm references.
      
      src/dispextern.h: Updated prototypes.
      
      src/dispnew.c (Fredraw_frame): Fix set_terminal_modes call.
      (init_display): Remove reference to meta_key.
      
      src/frame.c (make_terminal_frame): Renamed first parameter to
      tty_name.  Call term_init before creating the frame.
      (Fmake_terminal_frame): Look up the `tty' and `tty-type' frame
      parameters from the currently selected terminal before the global
      default.
      (Fdelete_frame): Make sure that the new selected frame is live.
      
      src/keyboard.c (meta_key): Moved to struct tty_output.
      (read_avail_input): Fix C syntax.  Update references to meta_key.
      (Fsuspend_emacs): pass current tty to init_sys_modes via
      record_unwind_protect.
      (Fset_input_mode): Update references to meta_key.
      (Fcurrent_input_mode): Ditto.
      
      src/sysdep.c (init_sys_modes): Updated old_tty and meta_key
      references.  Don't call set_terminal_modes, it needs termcap strings.
      (reset_sys_modes): Call tty_reset_terminal_modes instead of
      reset_terminal_modes.  Updated old_tty references.
      
      src/term.c: Massive updates throuout the file.
      (TS_*, TN_*): Moved to struct tty_output.
      (RPov, delete_in_insert_mode se_is_so, costs_set, insert_mode): Ditto.
      (standout_mode, specified_window, tty_cursor_hidden): Ditto.
      (tty_set_terminal_modes, tty_reset_terminal_modes): New functions.
      (turn_on_insert, turn_off_insert): Added tty parameter.
      (turn_on_highlight, turn_off_highlight, toggle_highlight): Added tty parameter.
      (tty_hide_cursor, tty_show_cursor): Ditto.
      (background_highlight, highlight_if_desired): Ditto.
      (tty_capable_p): Changed first parameter to tty_output.
      (term_init): Make sure top_frame is initialized.  Don't exit on errors
      if this would have been a secondary terminal.  Call set_terminal_modes
      on the end.
      (delete_tty): New function.
      (delete_tty_1): New function.
      (print_all_frames): New function, marginally useful for debugging.
      
      src/termchar.h (struct tty_output): Changed old_tty to be a pointer.
      Removed old_tty_valid member.  Added tty-specific variables from term.c.
      
      src/xfaces.c (Ftty_supports_face_attributes_p): Update for new
      tty_capable_p.
      
      git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-9
      fca177d4
    • Karoly Lorentey's avatar
      Full support for multiple terminal I/O (with some rough edges). · 6548cf00
      Karoly Lorentey authored
      lib-src/emacsclient.c (emacs_pid): New variable.  
      (window_change): Forward the SIGWINCH signal to the Emacs process
      after copying the size parameters to the proxy terminal.
      (copy_from_to): New parameter (sigio), kill Emacs with SIGIO if it is
      nonzero.
      (main): Set emacs_pid.
      
      lisp/server.el (server-process-filter): Send the pid of Emacs to emacsclient.
      
      src/cm.c: Added tty parameters to all functions and all Wcm macro calls.
      
      src/cm.h: Added tty parameters to all macros.   Updated function prototypes.
      (Wcm): Moved to struct tty_output.
      
      src/dispextern.h: Updated function prototypes.
      
      src/dispnew.c: Added tty parameters to all Wcm macro calls.
      (do_switch_frame): Make old frame obscured, not invisible, to solve
      problems with other-frame.
      (Wcm): Moved to struct tty_output.
      
      src/keyboard.c (read_avail_input): Select the frame corresponding to
      the tty that was read.  Slight rearrangement of tty loop.
      
      src/lisp.h (tabs_safe_p): Removed duplicate prototype.
      
      src/sysdep.c (hft_init, hft_reset): Added tty_output parameter.
      (discard_tty_input): Discard input from all ttys on APOLLO, too.
      Whatever it is.
      (narrow_foreground_group, widen_foreground_group): Added tty parameter
      (not really useful, the functions only work on the controlling tty.)
      (tabs_safe_p): Added tty parameter.
      
      src/term.c Added tty parameters to all Wcm macro calls.
      Standardised updating_frame vs. selected frame and tty_output access.
      (term_init): Allocate Wcm.
      (syms_of_term): Provide the `multi-tty' feature.
      
      src/termchar.h (struct tty_output): Added Wcm.
      
      src/xdisp.c (try_window_id): Make sure we use the tty device
      corresponding to the current frame.
      
      git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-8
      6548cf00
  2. 26 Dec, 2003 1 commit
    • Karoly Lorentey's avatar
      lib-src/emacsclient.c: Implemented --here option (open a new Emacs tty). Needs more work. · 9628b887
      Karoly Lorentey authored
      (here): New variable.
      (decode_options): Use it.
      (ec_get_tty, ec_set_tty, init_tty, window_change, hang_up_signal): New functions.
      (window_change_signal, init_signals, reset_tty, init_pty, copy_from_to): Ditto.
      (pty_conversation): Ditto.
      (main): Use them.
      (master, pty_name, old_tty, tty, old_tty_valid, tty_erase_char): New variables.
      (flow_control, meta_key, _sobuf, in_conversation, quit_conversation): Ditto.
      
      lisp/server.el (server-process-filter): Added support for opening a new terminal frame.
      
      dispextern.h (get_frame_size): Renamed to get_tty_size, added tty_output parameter.
      
      dispnew.c (Fredraw_frame): fflush the current terminal instead of stdout.
      (direct_output_for_insert, direct_output_forward_char, update_frame_1): Ditto.
      (Fding, bitch_at_user): Ditto.
      (update_frame_1): Count pending output for current terminal instead of stdout.
      (window_change_signal): Resize all terminals.
      (change_frame_size): Don't resize all terminals to the same size.
      
      frame.c (Vterminal_frame): Removed.
      (syms_of_frame): Removed declaration of Vterminal_frame.
      (make_terminal_frame): Set the top frame of the terminal to the new frame.
      (Fmake_terminal_frame): Get a new frame size from get_tty_size, don't copy it.
      (do_switch_frame): Handle terminal frame visibility.
      (next_frame, prev_frame): Skip over frames on different terminals.
      
      frame.h (Vterminal_frame): Removed.
      
      keyboard.c (input_fd): Removed.
      (read_avail_input): Removed first argument from read_socket_hook.
      Try to read from each available tty, until one succeeds.
      (Fsuspend_emacs): Don't suspend if there are multiple terminals.
      
      lisp.h (get_frame_size): Removed superflous declaration.
      
      xterm.c (Xtread_socket): Removed first parameter.
      macterm.h (XTread_socket): Ditto.
      w32inevt.c (w32_console_read_socket): Ditto.
      w32term.c (w32_read_socket): Ditto.
      
      sysdep.c (input_fd): Removed.
      (change_input_fd): Removed.
      (discard_tty_input): Discard pending input on _all_ input descriptors.
      (stuff_char, tabs_safe_p): Use current terminal instead of input_fd.
      (init_baud_rate, request_sigio, unrequest_sigio): Ditto.
      (init_sys_modes, reset_sys_modes): Ditto.
      (narrow_foreground_group, widen_foreground_group): Use stdin.
      (init_sys_modes, reset_sys_modes): otty parameter renamed to tty_out.
      (get_frame_size): Renamed to get_tty_size, added tty_out parameter.
      
      term.c (read_socket_hook): Removed first parameter.
      (clear_end_of_line): Use updating_frame, if possible.
      (write_glyphs, insert_glyphs, ins_del_lines): Ditto.
      (term_init): Renamed get_frame_size to get_tty_size.
      
      termchar.h (struct tty_output): New entries: top_frame,
      previous_terminal_frame.
      
      termhooks.h (read_socket_hook): Removed first parameter.
      
      window.c (init_window_once): Removed reference to Vterminal_frame.
      
      xdisp.c (previous_terminal_frame): Moved to struct tty_output.
      (redisplay_internal): Updated to use previous_terminal_frame in tty_output.
      Allow for simultaneous refresh of multiple ttys.
      
      
      git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-5
      9628b887
  3. 25 Dec, 2003 2 commits
    • Karoly Lorentey's avatar
      Updating_frame vs. selected_frame in term.c. · ed02974b
      Karoly Lorentey authored
      * src/term.c (clear_end_of_line): Use updating_frame instead of selected_frame.
      (set_scroll_region, clear_to_end, clear_frame, tty_show_cursor): Ditto.
      (tty_hide_cursor, turn_on_highlight, turn_off_highlight): Ditto.
      (turn_on_insert, turn_off_insert): Ditto.
      
      git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-3
      ed02974b
    • Karoly Lorentey's avatar
      Implemented multiple tty support. · 28d440ab
      Karoly Lorentey authored
      README.multi-tty: New file.
      
      src/termchar.h (struct terminal): Renamed to struct tty_output.  Added name, type,
      input, output, termscript, old_tty, term_initted, old_tty_valid,
      background_pixel, foreground_pixel, next fields.
      (TERMINAL_*): Renamed to TTY_* for brevity.
      (CURRENT_TERMINAL): Renamed to CURTTY for brevity.
      (tty_list): New variable.
      (TERMINAL_PTR): Removed.
      (FRAME_TTY): New function.
      (TTY_NAME, TTY_TYPE): New macros.
      
      src/term.c (current_terminal): Removed.  (_current_terminal): Removed.  (tty_list):
      New variable.  (OUTPUT, OUTPUT1, OUTPUTL, OUTPUT_IF, OUTPUT1_IF): Added tty
      parameter.  (set_terminal_modes): Added tty parameter.  (reset_terminal_modes):
      Added tty parameter.  (cursor_to, raw_cursor_to): Updated cmgoto() calls.
      (clear_end_of_line, write_glyphs): Add indirection to terminal output, updated
      cmcheckmagic() calls.  (get_named_tty): New function.  (term_dummy_init): New
      function.  (term_init): Added name parameter, added tty_output return value.
      Changed algorithm to update tty_list.  Call init_sys_modes() to set up tty
      mode on the newly opened terminal device.
      (get_current_tty): New function, intended for debugging.
      
      src/termhooks.h (termscript): Removed.
      
      src/w32term.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Removed redundant
      definition.
      src/macterm.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Ditto.
      
      
      src/window.c (init_window_once): Call make_terminal_frame with two zero parameters.
      
      src/cm.h (emacs_tputs): New macro to set current_tty, and then call tputs().
      (current_tty): New variable, for cmputc().
      (cmcheckmagic, cmputc, cmgoto): Added prototypes.
      
      src/cm.c (current_tty): New variable, for cmputc().
      (cmputc): Use it.
      (cmcheckmagic): Added tty parameter, look up terminal streams there.
      (calccost): Added tty parameter.  Use emacs_tputs() instead of tputs().
      (cmgoto): Added tty parameter.  Pass it on to calccost().  Use emacs_tputs()
      instead of tputs().
      
      
      src/dispextern.h (set_terminal_modes, reset_terminal_modes): Added tty parameter.
      (term_init): Added name parameter (the filename of the terminal device). Added
      return value (struct tty_output).
      
      src/dispnew.c: Replace CURTTY() with local variables throughout the file (where applicable).
      (termscript): Moved to struct tty_output.
      (terminal_type): Removed.
      
      src/emacs.c (main): Don't call init_sys_modes(), the new term_init() already does that
      during init_display().
      (shut_down_emacs): Call reset_all_sys_modes() instead of reset_sys_modes().
      
      src/frame.c (Qtty, Qtty_type): New variables.
      (syms_of_frame): Initialize them.
      (tty_display): Removed.
      (make_terminal_frame): New parameters (tty filename and type).
      Initialize output_data.tty field instead of output_data.x.  Use term_init() to
      find the right tty_output.  (Use term_dummy_init() during bootstrap.)
      (Fmake_terminal_frame): Get device filename and type from frame parameters.
      
      src/frame.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): Do the right thing
      if the frame is a tty.
      (struct frame): New member in output_data: tty.
      (make_terminal_frame): Updated of prototype.
      
      src/keyboard.c (Fset_input_mode): Call reset_all_sys_modes(), not
      reset_sys_modes().  Ditto with init_sys_modes().
      
      src/lisp.h (tty_output): Added forward declaration.
      (init_sys_modes, reset_sys_modes): Updated prototype.
      (init_all_sys_modes, reset_all_sys_modes): New prototypes.
      
      src/scroll.c: Replace CURTTY() with local variables throughout the file (where applicable).
      
      src/sysdep.c (old_tty, term_initted, old_tty_valid): Moved to struct tty_output.(
      (init_all_sys_modes): New function.
      (init_sys_modes): Added tty_output parameter.  Use it.
      (reset_all_sys_modes): New function.
      (reset_sys_modes): Added tty_output parameter.  Use it.
      
      src/Makefile.in: Update dependencies.
      
      git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-2
      28d440ab
  4. 24 Dec, 2003 1 commit
    • Karoly Lorentey's avatar
      Add a level of indirection to terminal characteristics. · 8a56675d
      Karoly Lorentey authored
      * src/termchar.h (struct terminal): New struct.
      (must_write_spaces, min_padding_speed, line_ins_del_ok)
      (char_ins_del_ok, scroll_region_ok, scroll_region_cost)
      (memory_below_frame, fast_clear_end_of_line): Moved to struct
      terminal.
      (current_terminal): New variable.
      (CURRENT_TERMINAL, TERMINAL_*): New accessor macros.
      (min_padding_speed, dont_calculate_costs): Commented out (unused).
      
      * src/term.c (_current_terminal): New variable.  Will be removed when
      true multi-tty support is implemented.
      
      * src/termopts.h (no_redraw_on_reenter): Moved here.
      
      * src/term.c (set_terminal_window, ins_del_lines, calculate_costs)
      (term_init): Use the accessor macros for terminal characteristics.
      * src/dispnew.c (line_hash_code, line_draw_cost)
      (direct_output_for_insert, update_frame_1, scrolling)
      (update_frame_line): Ditto.
      * src/macterm.c (mac_initialize): Ditto.
      * src/msdos.c (internal_terminal_init): Ditto.
      * src/scroll.c (calculate_scrolling, calculate_direct_scrolling)
      (scrolling_1, scroll_cost): Ditto.
      * src/sysdep.c (hft_init): Ditto.
      * src/w32term.c (w32_initialize): Ditto.
      * src/xdisp.c (try_window_id): Ditto.
      * src/xterm.c (x_initialize): Ditto.
      
      * etc/TODO: Add pointer to my tla archive.
      
      git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-1
      8a56675d
  5. 30 Sep, 2003 1 commit
  6. 28 Sep, 2003 1 commit
  7. 22 Sep, 2003 1 commit
  8. 01 Sep, 2003 1 commit
  9. 24 Aug, 2003 1 commit
  10. 21 Aug, 2003 2 commits
  11. 19 Aug, 2003 1 commit
  12. 24 May, 2003 1 commit
  13. 21 Mar, 2003 1 commit
  14. 04 Feb, 2003 1 commit
  15. 19 Jul, 2002 1 commit
  16. 01 Jul, 2002 1 commit
  17. 28 May, 2002 1 commit
  18. 26 May, 2002 1 commit
  19. 26 Apr, 2002 1 commit
  20. 03 Apr, 2002 1 commit
  21. 02 Feb, 2002 1 commit
  22. 25 Jan, 2002 2 commits
  23. 17 Jan, 2002 1 commit
  24. 14 Jan, 2002 1 commit
  25. 18 Dec, 2001 1 commit
  26. 20 Oct, 2001 2 commits
    • Miles Bader's avatar
      (TN_standout_width, TF_xs, TN_magic_cookie_glitch_ul): Variables removed. · 54800acb
      Miles Bader authored
      (term_init): Don't set them.
      Turn off any standout/underline modes that require magic cookies.
      (ins_del_lines, highlight_if_desired, background_highlight)
      (turn_on_highlight, turn_off_highlight, reset_terminal_modes):
      Remove special processing for magic-cookie standout modes.
      (turn_off_face, turn_on_face): Remove special processing for
      underline magic-cookie glitch.
      54800acb
    • Miles Bader's avatar
      (reassert_line_highlight_hook, change_line_highlight_hook): Variables removed. · 8ede64a5
      Miles Bader authored
      (reassert_line_highlight, change_line_highlight): Functions removed.
      (standout_requested): Variable removed.
      (update_end, highlight_if_desired): Don't use it.
      (chars_wasted, copybuf): Variables removed.
      (write_standout_marker): Function removed.
      (cursor_to, clear_to_end, clear_frame, clear_end_of_line_raw)
      (clear_end_of_line_raw, write_glyphs, ins_del_lines):
      Don't use `chars_wasted' or `copybuf'.
      (calculate_costs): Don't allocate `chars_wasted' or `copybuf'.
      Set `costs_set' to true.
      (cursor_to, clear_end_of_line): Test `costs_set' instead of `chars_wasted'.
      (clear_end_of_line): Function removed.
      (clear_end_of_line_raw): Renamed to `clear_end_of_line'.
      (clear_to_end): Call `clear_end_of_line' instead of `clear_end_of_line_raw'.
      8ede64a5
  27. 17 Oct, 2001 1 commit
  28. 14 Oct, 2001 1 commit
  29. 08 Oct, 2001 2 commits
  30. 31 May, 2001 1 commit
    • Gerd Moellmann's avatar
      (tty_cursor_hidden): New variable. · d284f58f
      Gerd Moellmann authored
      (update_begin): Don't call tty_hide_cursor.  Clean up.
      (update_end, set_terminal_window, set_scroll_region): Clean up.
      (ring_bell, reset_terminal_modes): Clean up.
      (tty_hide_cursor, tty_show_cursor): Hide/show cursor depending
      on tty_cursor_hidden.
      (write_glyphs): Call tty_hide_cursor.
      d284f58f
  31. 27 Apr, 2001 1 commit
  32. 25 Apr, 2001 1 commit
  33. 20 Jan, 2001 1 commit
  34. 05 Jan, 2001 1 commit