1. 30 Dec, 2003 1 commit
    • Karoly Lorentey's avatar
      Major bugfixes and slight enhancements. · 16c290d8
      Karoly Lorentey authored
      src/dispextern.h (get_tty_size, tabs_safe_p, init_baud_rate): Update
      prototypes.
      
      src/dispnew.c (window_change_signal): Update call to get_tty_size.
      src/frame.c (Fmake_terminal_frame): Ditto.
      src/keyboard.c (Fsuspend_emacs): Ditto.
      
      src/sysdep.c: Eliminate tty_outputs, wherever possible.  (The
      exceptions are init_sys_modes and reset_sys_modes, which need access
      to tty-local parameters).
      (init_baud_rate): Change tty_output parameter to a simple file descriptor.
      (narrow_foreground_group, widen_foreground_group): Ditto.
      (tabs_safe_p, get_tty_size): Ditto.
      (init_sys_modes): Update narrow_foreground_group invocation.
      (reset_sys_modes): Update widen_foreground_group invocation.
      (request_sigio)[!FASYNC && STRIDE]: Fix function signature.
      
      src/term.c (delete_tty): Only close output file handle if it is
      different from input.  Re-enable freeing of Wcm.
      (term_init): Update get_tty_size, tabs_safe_p and init_baud_rate
      invocations.
      
      lib-src/emacsclient.c (here): Renamed to frame.
      (longopts): Change --here to --frame.  The -h short option may be
      confused with --help.
      (decode_options, print_help_and_exit): Update to reflect above changes.
      (main): Ditto.
      
      lisp/server.el (server-start): Fix frame-live-p call syntax.
      (server-process-filter): Handle 'emacsclient -f' without file
      arguments.  Don't return any values to emacsclient when 'emacsclient
      -f -e'.
      (server-switch-buffer): Prevent infinite recursion when there are no
      files to edit.
      
      
      git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-27
      16c290d8
  2. 29 Dec, 2003 1 commit
    • Karoly Lorentey's avatar
      Bugfix festival. · 0a125897
      Karoly Lorentey authored
      lib-src/emacsclient.c (main_argc, main_argv): New variables.
      (main): Initialize them.
      (fail): Use them.
      (window_change, copy_from_to): Don't kill if emacs_pid is zero.
      (pty_conversation): Watch the command socket, too.  Read emacs_pid
      here.  Emacs and emacsclient could deadlock if Emacs tried to do a
      reset_sys_modes before sending its pid.
      
      lisp/server.el: Automatically delete the client frame when done editing.
      (server-frames): New variable.
      (server-process-filter, server-sentinel, server-buffer-done): Use it.
      (server-process-filter): Do a redisplay before evaluating other
      parameters.  (Prevents "emacsclient -h -e '(delete-frame)'" from
      messing up the system.
      
      src/dispextern.h: Update prototypes.
      
      src/dispnew.c (window_change_signal): Do nothing if !term_initted.
      (init_display): Set the frame size from the tty data after term_init.
      
      src/emacs.c (main): Make sure things that init_sys_modes needs are 
      initialized before init_display (which calls init_sys_modes now).
      (sort_args): Use xfree, not free.
      (shut_down_emacs) [!EMACS_HAVE_TTY_PGRP]: Use reset_all_sys_modes
      instead of reset_sys_modes.
      
      src/frame.c (make_terminal_frame): Sigh. Move terminal initialization
      back to the middle of frame setup.  Handle errors by making sure that
      the delete_tty() called from term_init() will see and delete this
      frame.
      (Fdelete_frame): Kill the frame before calling delete_tty().  Fix
      condition for tty deletion.
      
      src/keyboard.c (Fset_input_mode): Use reset_sys_modes on the current
      terminal only.
      
      src/lisp.h: Remove duplicate prototypes.
      
      src/msdos.c (croak): use reset_all_sys_modes().
      
      src/sysdeps.c (init_baud_rate): Added tty parameter, use it instead of CURTTY.
      (child_setup_tty): Reset sigio on stdin, not CURTTY().
      (reset_sigio): Added fd parameter, put explicit fcntl there.
      (request_sigio, unrequest_sigio)[FASYNC]: Simply block/unblock the
      SIGIO signal, don't touch the file params.  There are multiple ttys
      now, and we can't disable the SIGIO from emacsclient.
      (get_tty_size)[VMS]: Use tty_out instead of CURTTY().
      (reset_sys_modes): Don't call cursor_to, clear_end_of_line; call
      cmgoto and tty_clear_end_of_line instead.  The frame may already be
      dead.  Updated reset_sigio call.
      
      src/term.c (clear_and_of_line): Separate tty-dependent stuff to
      tty_clear_end_of_line() for reset_sys_modes.
      (tty_clear_end_of_line): New function.
      (term_init): Added frame parameter, don't use selected_frame.
      Set the frame's output_data.tty value (in case there is an error
      later).  Set the frame size in Wcm, not in the frame.  Only free the
      termcap buffer if there is a termcap-related error.  Call
      init_sys_modes last, not first.
      (deleting_tty): New variable.
      (delete_tty): Use it for handling recursive calls.  Free deleted tty,
      except its Wcm (there is still a dangling reference somewhere).
      
      git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-19
      0a125897
  3. 27 Dec, 2003 3 commits
    • Karoly Lorentey's avatar
      Implemented automatic deletion of terminals. · 8303ba32
      Karoly Lorentey authored
      lisp/server.el (server-process-filter): Switch to the new terminal frame.
      
      src/frame.c (Fdelete_frame): Delete the tty if this was its the last frame.
      
      git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-12
      8303ba32
    • 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
  4. 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
  5. 25 Dec, 2003 1 commit
    • 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
  6. 16 Nov, 2003 1 commit
  7. 05 Oct, 2003 3 commits
  8. 20 Sep, 2003 1 commit
  9. 01 Sep, 2003 1 commit
  10. 26 Jun, 2003 1 commit
  11. 25 May, 2003 1 commit
  12. 24 May, 2003 1 commit
    • Kim F. Storm's avatar
      Make (many) trivial substitutions for renamed and · 5af5757b
      Kim F. Storm authored
      new macros in dispextern.h, frame.h and window.h.
      (make_frame): Initialize left_fringe_width, right_fringe_width,
      fringe_cols, scroll_bar_actual_width, border_width,
      internal_border_width, column_width, line_height, x_pixels_diff,
      y_pixels_diff, want_fullscreen, size_hint_flags, and win_gravity
      members with values suitable for a non-window frames.
      5af5757b
  13. 19 May, 2003 1 commit
  14. 17 May, 2003 1 commit
  15. 01 Apr, 2003 1 commit
  16. 31 Mar, 2003 3 commits
    • Juanma Barranquero's avatar
    • Kim F. Storm's avatar
      Fix compilation for --with-x=no. · 2731a0ad
      Kim F. Storm authored
      2731a0ad
    • Kim F. Storm's avatar
      Include blockinput.h. · 972f4259
      Kim F. Storm authored
      (Vx_resource_name, Vx_resource_class, Qx_frame_parameter)
      (Qx_resource_name, Qface_set_after_frame_default): Define vars here.
      (Qauto_raise, Qauto_lower, ...): Define all frame parameter
      related vars here.
      (struct frame_parm_table, frame_parms): New table for describing
      frame parameters and their associated Q-variable.
      The order of the parameters corresponds to the sequence of the
      frame_parm_handlers table in redisplay_interface.
      (x_fullscreen_move, x_set_frame_parameters)
      (x_report_frame_params, x_set_fullscreen, x_set_line_spacing)
      (x_set_screen_gamma, x_set_font, x_set_fringe_width)
      (x_set_border_width, x_set_internal_border_width, x_set_visibility)
      (x_set_autoraise, x_set_autolower, x_set_unsplittable)
      (x_set_vertical_scroll_bars, x_set_scroll_bar_width, x_icon_type):
      Generic functions for processing of frame parameters.
      (validate_x_resource_name, xrdb_get_resource, Fx_get_resource)
      (display_x_get_resource, x_get_resource_string): Functions for
      generic access to X resources.
      (x_get_arg, x_frame_get_arg, x_frame_get_and_record_arg)
      (x_default_parameter, Fx_parse_geometry): Functions for generic
      access to frame parameters.
      (x_figure_window_size): Generic calculation of frame size. Fixed
      to add space needed for tool bar.  Also setup size_hint_flags.
      (syms_of_frame): Intern and staticpro frame parameter variables.
      Defvar_lisp Vx_resource_class and Vx_resource_name here.
      Defsubr Sx_get_resource and Sx_parse_geometry.
      972f4259
  17. 04 Feb, 2003 1 commit
  18. 02 Oct, 2002 1 commit
    • John Paul Wallington's avatar
      * frame.c (Vdelete_frame_functions): New variable. · cd1d850f
      John Paul Wallington authored
      (syms_of_frame): Initialize and defvar it.
      (Fdelete_frame): Use it instead of delete-frame-hook.  Don't run
      it when frame's `tooltip' parameter is non-nil.
      
      * xfns.c (x_create_tip_frame): Set `tooltip' frame parameter to t.
      
      * w32fns.c (x_create_tip_frame): Likewise
      
      * macfns.c (x_create_tip_frame): Likewise.
      cd1d850f
  19. 26 Aug, 2002 1 commit
  20. 16 Jul, 2002 1 commit
  21. 15 Jul, 2002 1 commit
  22. 10 Jul, 2002 1 commit
  23. 26 Jun, 2002 1 commit
  24. 26 Apr, 2002 1 commit
  25. 05 Mar, 2002 2 commits
  26. 20 Feb, 2002 1 commit
  27. 16 Feb, 2002 1 commit
  28. 14 Jan, 2002 1 commit
  29. 01 Dec, 2001 1 commit
  30. 19 Nov, 2001 1 commit
  31. 18 Nov, 2001 1 commit
  32. 02 Nov, 2001 1 commit
  33. 31 Oct, 2001 1 commit