1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-04 02:51:31 -08:00
Commit graph

140 commits

Author SHA1 Message Date
Dan Nicolaescu
8da7067c1a *** empty log message *** 2007-07-03 05:00:41 +00:00
Miles Bader
36ab861205 Rudimentary fix for environment variable handling.
* lisp/env.el (getenv): Restore David Kastrup's fix.
(environment): Add optional frame parameter.

* lisp/mule-cmds.el (set-locale-environment): Fix getenv call.
* lisp/term/rxvt.el (rxvt-set-background-mode): Ditto.
* lisp/x-win.el (x-initialize-window-system, terminal-init-xterm): Ditto.

* lisp/server.el (server-with-environment): Restore the original environment.

Revision: emacs@sv.gnu.org/emacs--multi-tty--0--patch-6
Creator:  Karoly Lorentey <karoly@lorentey.hu>
2007-05-16 07:12:33 +00:00
Jason Rumney
471f1044df Updated w32 progress 2007-05-15 23:32:55 +00:00
Karoly Lorentey
6bccb6c592 Remove superfluous properties from the mode-line-client indicator. (Reported by Kalle Olavi Niemitalo)
* lisp/bindings.el (mode-line-client): Don't set the local-map and
  mouse-face properties.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-578
2006-07-29 21:30:46 +00:00
Karoly Lorentey
d7a0175d42 Let frames on new terminals inherit 'environment and 'client.
* lisp/frame.el (make-frame): Always inherit 'environment and 'client
  parameters.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-575
2006-07-29 10:51:50 +00:00
Karoly Lorentey
a13f8f50d4 Rework environment variable support. (Reported by Kalle Olavi Niemitalo and Noah Friedman.)
* src/callproc.c (Vglobal_environment, Vlocal_environment_variables): Remove.
  (getenv_internal, child_setup): Don't look at global-environment or
  local-environment-variables.
  (Fgetenv_internal): Update docs.
  (set_initial_environment): Rename from set_global_environment.  Store
  Emacs environment in initial frame parameter.
  (syms_of_callproc): Remove obsolete defvars.  Update docs.

* lisp/env.el (read-envvar-name): Remove reference to global-environment.
  (setenv-internal): New function.
  (setenv): Use it.  Always set process-environment.  Update docs.
  (getenv): Update docs.
  (environment): Rewrite for the new environment design.  Update docs.

* lisp/frame.el (frame-initialize): Copy the environment from the initial frame.

* src/emacs.c (main): Call set_initial_environment, not set_global_environment.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-569
2006-05-26 17:37:25 +00:00
Karoly Lorentey
8cbd7bed2d Fix and/or simplify terminal initialization files.
* lisp/faces.el (tty-create-frame-with-faces): Set up faces and
  background mode only after the terminal has been initialized.
  (frame-set-background-mode): Handle the 'background-mode terminal
  parameter.
  (tty-run-terminal-initialization): Add type option.

* lisp/term/README: Update.
* lisp/term/rxvt.el: Simplify.
* lisp/term/xterm.el: Simplify and fix.
* lisp/term/*.el: Simplify and fix.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-564
2006-05-20 17:02:47 +00:00
Karoly Lorentey
3fde2acf6a Fix `vc-annotate' under X. (Reported by Dan Nicolaescu.)
* lisp/vc.el (vc-annotate-color-map): Call `tty-display-color-p' only on
  ttys.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-551
2006-04-20 12:37:41 +00:00
Karoly Lorentey
ce593f6e6b Fix tooltip border color.
* src/xterm.h (x_output): Remove background_pixel and foreground_pixel
  fields.

* src/widget.c (update_from_various_frame_slots): Use
  FRAME_BACKGROUND_PIXEL and FRAME_FOREGROUND_PIXEL.

* src/xfns.c (x_set_foreground_color): Ditto.
* src/xfns.c (x_set_background_color): Ditto.
* src/xfns.c (x_set_mouse_color): Ditto.
* src/xfns.c (x_set_cursor_color): Ditto.
* src/xfns.c (x_make_gc): Ditto.
* src/xfns.c (Fx_create_frame): Ditto.
* src/xfns.c (x_create_tip_frame): Ditto.
* src/xfns.c (build_string): Ditto.
* src/xterm.c (XTflash): Ditto.
* src/xterm.c (x_free_frame_resources): Ditto.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-544
2006-04-01 16:11:29 +00:00
Karoly Lorentey
2828d5f9d4 Set `default-directory' in *scratch* to the current directory of emacsclient.
* lib-src/emacsclient.c (get_current_dir_name): New function, copied here
  from sysdep.c.
  (main): Use it to send over the current directory.

* lisp/server.el (server-process-filter): Accept `-dir' command.  Set
  `default-directory' of the *scratch* buffer on connect, if applicable.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-539
2006-03-26 16:34:35 +00:00
Karoly Lorentey
6a5af08f8d Fix tool-bar and menu-bar toggles in Show/Hide menu to reflect the state of the current frame.
* lisp/tool-bar.el (toggle-tool-bar-mode-from-frame): New function.

* lisp/menu-bar.el (toggle-menu-bar-mode-from-frame): New function.
  (menu-bar-showhide-menu): Use them to change "Menu-bar" and
  "Tool-bar" toggles to reflect the state of the current frame.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-537
2006-03-26 14:20:01 +00:00
Karoly Lorentey
095fe28140 Fix toolbars on X frames when Emacs is started on a tty. (Reported by Richard Lewis.)
* lisp/faces.el (x-create-frame-with-faces): Remove bogus check for first
  frame.  Call `tool-bar-setup'.

* lisp/frame.el (window-system-default-frame-alist): Enhance doc string.

* lisp/frame.el (frame-notice-user-settings): Don't put 'tool-bar-lines
  in `default-frame-alist' when initial frame is on a tty.

* lisp/frame.el (modify-all-frames-parameters): Simplify using
  `assq-delete-all'.  Remove specified parameters from
  `window-system-default-frame-alist'.

* lisp/fringe.el (set-fringe-mode): Simplify and fix using
  `modify-all-frames-parameters'.
* lisp/menu-bar.el (menu-bar-mode): Ditto.
* lisp/scroll-bar.el (set-scroll-bar-mode): Ditto.
* lisp/tool-bar.el (tool-bar-mode): Ditto.  Remove 'tool-bar-map length
  check before calling `tool-bar-setup'.

* lisp/tool-bar.el (tool-bar-setup): New variable.

* lisp/tool-bar.el (tool-bar-setup): Use it to guard against multiple
  calls.  Add optional frame parameter, and select that frame before
  adding items.

* src/frame.c (syms_of_frame): Enhance doc string of `default-frame-alist'.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-536
2006-03-26 13:57:43 +00:00
Karoly Lorentey
db9d7d9a54 Fix segfault by `C-x 5 2' on the controlling tty. (Reported by Suresh Madhu.)
* src/frame.c (Fmake_terminal_frame): Handle NULL tty names correctly.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-526
2006-03-08 16:47:48 +00:00
Karoly Lorentey
5f3c1a63f3 Fix server-delete-client' behavior when the user quits kill-buffer'. (Reported by Han Boetes.)
* lisp/server.el (server-buffer-clients): Doc update.
(server-delete-client): Handle quits in kill-buffer.  Don't kill modified
buffers.  Add extra logging.
(server-visit-files): Don't set `server-existing-buffer' if the buffer
already has other clients.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-517
2006-02-23 02:59:27 +00:00
Karoly Lorentey
6213d5b33c Fix tty state problem after error in `set-quit-char'.
* src/keyboard.c (Fset_quit_char): Don't leave tty state uninitialized
  after an error.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-512
2006-02-14 12:32:39 +00:00
Karoly Lorentey
89121f9543 Fix permissions. (Reported by Han Boetes.)
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-511
2006-02-13 14:38:07 +00:00
Karoly Lorentey
911650d26b Fix bootstrapping problem. (Reported by "mace".)
* lisp/loadup.el: Delay loading env; mule-conf gets confused by cl during
  bootstrap.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-505
2006-02-03 14:44:51 +00:00
Karoly Lorentey
9688ff5345 Eliminate wrong_kboard_jmpbuf.
* src/keyboard.c (read_char, read_char_minibuf_menu_prompt)
  (read_key_sequence, read_filtered_event): Eliminate wrong_kboard_jmpbuf.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-500
2006-01-29 00:17:11 +00:00
Karoly Lorentey
6bbba5a627 Fix C-g during `make-network-process'. (Reported by Mark Plaksin.)
* src/process.c (Fmake_network_process): Don't unrequest_sigio on modern
  systems.

* src/keyboard.c (Fset_input_interrupt_mode): Cosmetic change.

* src/sysdep.c (request_sigio): Make it a no-op if noninteractive.
  (unrequest_sigio): Make it a no-op if noninteractive.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-494
2006-01-11 14:51:51 +00:00
Karoly Lorentey
b3e6f69c10 Overhaul and simplify single_kboard API. Allow calls to `recursive-edit' in process filters. Small fixes.
* lisp/server.el (server-process-filter): Protect `display-splash-screen'
  call in a condition-case.  Explain why.

* src/callint.c (Fcall_interactively): Update call to
  `temporarily_switch_to_single_kboard'.

* src/fns.c (Fy_or_n_p): Ditto.

* src/frame.c (Fdelete_frame): Remove unused variable `count'.

* src/keyboard.c (wrong_kboard_jmpbuf): Remove global variable.

* src/keyboard.c (read_char): Add wrong_kboard_jmpbuf parameter to allow
  for recursive calls.  Update longjmp invocations.  Remember the
  original current_kboard, and longjmp to `wrong_kboard_jmpbuf' when a
  filter, timer or sentinel changes it.  Comment out unnecessary calls to
  `record_single_kboard_state' and `any_kboard_state'.  Update recursive
  calls.

* src/keyboard.c (read_key_sequence): Add `wrong_kboard_jmpbuf' local
  variable.  Update setjmp and read_char calls.  Abort if
  interrupted_kboard died in read_char.

* src/keyboard.c (any_kboard_state, single_kboard_state)
  (record_single_kboard_state): Comment out obsolete functions.
  (push_frame_kboard): Remove function.
  (pop_kboard): Switch out of single_kboard mode if the
  kboard has been deleted.
  (temporarily_switch_to_single_kboard): Change first
  parameter to a frame pointer.  Throw an error when caller wants to
  change kboards while in single_kboard mode.
  (restore_kboard_configuration): Abort if pop_kboard changed
  the kboard in single_kboard mode.
  (Frecursive_edit): Switch to single_kboard mode only in
  nested command loops.
  (cmd_error, command_loop, command_loop_1, timer_check):
  Comment out unnecessary call to `any_kboard_state' and
  `record_single_kboard_state'.

* src/keyboard.c (delete_kboard): Exit single_kboard mode if we have just
  deleted that kboard.

* src/keyboard.c (interrupt_signal): Use `Fkill_emacs' to exit Emacs, not
  `fatal_error_signal'.

* src/keyboard.h (read_char, single_kboard_state)
  (record_single_kboard_state): Remove.
  (temporarily_switch_to_single_kboard): Update.

* src/lread.c: Include setjmp.h.  Update declaration of `read_char'.
  (read_filtered_event): Call `read_char' with a local
  `wrong_kboard_jmpbuf'.

* src/minibuf.c (read_minibuf): Update call to
  `temporarily_switch_to_single_kboard'.

* src/termchar.h (tty_display_info): Rename `previous_terminal_frame'
  member to `previous_frame'.

* src/xdisp.c (redisplay_internal): Update references to
  `previous_terminal_frame'.
  (display_mode_line, Fformat_mode_line): Replace calls to
  `push_frame_kboard' with `push_kboard'.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-489
2006-01-03 01:50:46 +00:00
Karoly Lorentey
d290c55440 Fix splash screen loosing input events on Emacsclient frames.
* lisp/startup.el (fancy-splash-screens): Use `overriding-local-map'
  instead of `overriding-terminal-local-map' for now; the latter doesn't
  work right, it looses keypresses to another terminal.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-478
2005-12-30 06:15:47 +00:00
Karoly Lorentey
526039df1c Enhance splash screens to work better with emacsclient.
* lisp/startup.el (fancy-splash-screens): Use
  `overriding-terminal-local-map' to set up keymap.  Install a
  `delete-frame-functions' hook to catch `delete-frame' events.  Ignore
  `select-window' events to cope better with `focus-follows-mouse'.
  Don't switch back to the original buffer if the splash frame has been
  killed.  
  (normal-splash-screen): Don't let-bind `mode-line-format'; it changes
  the global binding---setq it instead.  
  (display-splash-screen): Don't do anything if the splash screen is
  already displayed elsewhere.
  (fancy-splash-exit, fancy-splash-delete-frame): New functions.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-477
2005-12-30 05:30:57 +00:00
Karoly Lorentey
6ed8eeffb3 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
2005-12-29 18:20:26 +00:00
Karoly Lorentey
da8e8fc14f Store local environment in frame (not terminal) parameters.
* src/callproc.c (child_setup, getenv_internal, Fgetenv_internal):
  Store the local environment in a frame (not terminal) parameter.
  Update doc strings.
  (syms_of_callproc): Update doc strings.
  (Qenvironment): Moved to frame.c. 

* lisp/env.el (read-envvar-name, setenv, getenv, environment): Use frame
  parameters to store the local environment, not terminal parameters.

* server.el (server-process-filter): Store the local environment in a
  frame (not terminal) parameter.  Do not try to decode environment
  strings.

* lisp/frame.el (make-frame): Set up the 'environment frame parameter,
  when needed.

* src/frame.c (Qenvironment): Move here from callproc.c.
  (Fdelete_frame): Don't allow other frames to refer to a deleted frame
  in their 'environment parameter.
  (Fframe_with_environment): New function.
  (syms_of_frame): Defsubr it.  Initialize and staticpro Qenvironment.

* frame.h (Qenvironment): Declare.
* lisp.h (Fframe_with_environment): EXFUN it.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-467
2005-12-29 04:31:04 +00:00
Karoly Lorentey
30663b475e Fix compilation errors in previous commit.
* src/callproc.c (getenv_internal): Fix get_terminal_param call.

* dispextern.h (get_device): Move declaration to termhooks.h.
* termhooks.h (get_device): Move here.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-462
2005-12-26 02:21:31 +00:00
Karoly Lorentey
f105f403d2 Implement automatic terminal-local environment variables via `local-environment-variables'.
* lisp/env.el (setenv, getenv): Add optional terminal parameter.  Update docs.
  (setenv): Handle `local-environment-variables'.
  (read-envvar-name): Also allow (and complete) local
  environment variables on the current terminal.

* src/callproc.c: Include frame.h and termhooks.h, for terminal parameters.
  (Qenvironment): New constant.
  (Vlocal_environment_variables): New variable.
  (syms_of_callproc): Register and initialize them.
  (child_setup): Handle Vlocal_environment_variables.
  (getenv_internal): Add terminal parameter.  Handle
  Vlocal_environment_variables.
  (Fgetenv_internal): Add terminal parameter.

* src/termhooks.h (get_terminal_param): Declare.

* src/Makefile.in (callproc.o): Update dependencies.
* mac/makefile.MPW (callproc.c.x): Update dependencies.

* lisp/termdev.el (terminal-id): Make parameter optional.
  (terminal-getenv, terminal-setenv, with-terminal-environment): 
  Disable functions.

* lisp/mule-cmds.el (set-locale-environment): Convert `terminal-getenv' calls
  to `getenv'.
* lisp/rxvt.el (rxvt-set-background-mode): Ditto.
* lisp/x-win.el (x-initialize-window-system): Ditto.
* lisp/xterm.el (terminal-init-xterm): Ditto.

* lisp/server.el (server-process-filter): Fix reference to the 'display frame
  parameter.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-461
2005-12-26 02:14:10 +00:00
Karoly Lorentey
ed8dad6b61 Reimplement terminal parameters in C; clean up term.c, create terminal.c.
* lisp/termdev.el (terminal-parameter-alist, terminal-parameters, terminal-parameter-p)
  (terminal-parameter, set-terminal-parameter, terminal-handle-delete-frame): Remove.

* src/term.c (Vring_bell_function, device_list, initial_device)
  (next_device_id, 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_device, Fdisplay_name, create_device, delete_device)
  (Fdelete_display, Fdisplay_live_p, Fdisplay_list)
  Move to terminal.c.
  (syms_of_term): Move their initialization to terminal.c.

* src/terminal.c: New file.
  (device_list, next_device_id, initial_device, Vring_bell_function)
  (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_device, create_device, delete_device)
  (Fdelete_display, Fdisplay_live_p, Fdisplay_list, Fdisplay_name): Move here.
  (mark_devices, get_terminal_param, store_terminal_param)
  (Fterminal_parameters, Fterminal_parameter)
  (Fmodify_terminal_parameters, Fset_terminal_parameter)
  (init_initial_device, delete_initial_device)
  (syms_of_terminal): New functions.

* lisp/simple.el (normal-erase-is-backspace-setup-frame)
  (normal-erase-is-backspace-mode): Rephrase things
  without terminal-parameter-p.

* lisp/termdev.el (terminal-getenv, terminal-setenv)
  (with-terminal-environment): Ditto.

* mac/makefile.MPW (EmacsObjects): Add terminal.c.x.
  ({Src}terminal.c.x): Add dependencies.

* src/Makefile.in (obj): Add terminal.o.
  (terminal.o): Add dependencies.
  [HAVE_CARBON]: Make terminal.o depend on macgui.h.

* src/alloc.c (mark_devices): Declare.
  (Fgarbage_collect): Call `mark_devices'.

* src/dispextern.h  (set_scroll_region, turn_off_insert)
  (turn_off_highlight, background_highlight, clear_end_of_line_raw)
  (tty_clear_end_of_line, tty_setup_colors, delete_tty): Remove.
  (raw_cursor_to, clear_to_end, tty_turn_off_insert)
  (tty_turn_off_highlight): Add declaration.

* src/emacs.c (main): Call `syms_of_terminal'.

* src/frame.c (get_future_frame_param): New function.
  (Fmake_terminal_frame): Use it.

* src/keyboard.c (pop_kboard): Remove unused variable.
  (Fset_output_flow_control): Return nil.

* src/keymap.h (Fset_keymap_parent): Add EXFUN.

* src/lisp.h (syms_of_terminal): Declare it.

* src/sysdep.c (reset_sys_modes): Update for renames.

* src/term.c (set_scroll_region): Rename to `tty_set_scroll_region'.
  (turn_on_insert): Rename to `tty_turn_on_insert'.
  (turn_off_insert): Rename to `tty_turn_off_insert'.
  (turn_off_highlight): Rename to `tty_turn_off_highlight'.
  (turn_on_highlight): Rename to `tty_turn_on_highlight'.
  (toggle_highligh): Rename to `tty_toggle_highlight'.
  (background_highlight): Rename to `tty_background_highlight'.
  (highlight_if_desired): Rename to `tty_highlight_if_desired'.

  (tty_ring_bell, tty_update_end, tty_set_terminal_window)
  (tty_set_scroll_region, tty_background_highlight)
  (tty_cursor_to, tty_raw_cursor_to, tty_clear_to_end)
  (tty_clear_frame, tty_clear_end_of_line, tty_write_glyphs)
  (tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines)
  (term_get_fkeys, tty_setup_colors, dissociate_if_controlling_tty)
  (delete_tty): Add static modifier.

  (tty_reset_terminal_modes, tty_set_terminal_window)
  (tty_set_scroll_region, tty_background_highlight)
  (tty_highlight_if_desired, tty_cursor_to)
  (tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame)
  (tty_clear_end_of_line, tty_write_glyphs, tty_insert_glyphs)
  (tty_delete_glyphs, tty_ins_del_lines, turn_on_face): 
  Update for renames.

* src/termhooks.h (param_alist): New member to struct device.

* src/xterm.h (x_delete_device): Declare.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-460
2005-12-25 20:06:58 +00:00
Karoly Lorentey
a712a8c33b Don't let x_initialize break 8-bit input on ttys. (Reported by Joakim Verona.) Split `set-input-mode'.
* lisp/international/encoded-kb.el (encoded-kbd-setup-display): Use `set-input-meta-mode'.
* lisp/linux.el (terminal-init-linux): Ditto.

* src/keyboard.c (Fset_input_interrupt_mode, Fset_output_flow_control)
  (syms_of_keyboard): Defsubr them.
  (Fset_input_meta_mode, Fset_quit_char): New functions.
  (Fset_input_mode): Split to above functions.

* lisp.h: EXFUN the new functions.

* xterm.c (x_initialize): Use Fset_input_interrupt_mode.
* macterm.c (mac_initialize): Ditto.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-457
2005-12-23 03:00:55 +00:00
Karoly Lorentey
f35ca2fe35 Reimplement and extend support for terminal-local environment variables.
* lisp/termdev.el: New file.  Move terminal parameter-related functions
  here from frame.el.
  (terminal-getenv, with-terminal-environment): Reimplement and extend.
  (terminal-setenv, terminal-setenv-internal): New functions.

* lisp/frame.el (make-frame-on-tty, framep-on-display, suspend-frame):
  Extend doc string, update parameter names.
  (terminal-id, terminal-parameter-alist, terminal-parameters)
  (terminal-parameter-p, terminal-parameter, set-terminal-parameter)
  (terminal-handle-delete-frame, terminal-getenv, terminal-getenv)
  (with-terminal-environment): Move to termdev.el.

* lisp/loadup.el: Load termdev as well.
* lisp/Makefile.in (lisp, shortlisp): Add termdev.elc.
* lisp/makefile.MPW (shortlisp): Ditto.

* lisp/ebuff-menu.el (electric-buffer-menu-mode-map): Bind C-z to
  `suspend-frame', not `suspend-emacs'.
* lisp/echistory.el (electric-history-map): Ditto.
* lisp/ebrowse.el (ebrowse-electric-list-mode-map): Ditto.
* lisp/ebrowse.el (ebrowse-electric-position-mode-map): Ditto.

* lisp/startup.el (normal-splash-screen): Use `save-buffers-kill-display'
  instead of `save-buffers-kill-emacs'.

* lisp/x-win.el (x-initialize-window-system): Add 'global-ok option to
  `terminal-getenv'.

* src/term.c (suspend-tty): Update doc string.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-456
2005-12-22 21:02:45 +00:00
Karoly Lorentey
bedeffcffb Work around Emacs crash on Konsole detach. (Tom Schutzer-Weissmann)
* src/dispnew.c (window_change_signal): Don't believe width/height values
  that are impossibly small.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-452
2005-12-13 19:03:29 +00:00
Karoly Lorentey
f369f10bdc README updates.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-451
2005-12-12 03:32:16 +00:00
Karoly Lorentey
5f6a587f30 Prevent core dumps with GTK by disabling secondary X connections there.
* src/xterm.c (x_term_init) [!HAVE_GTK_MULTIDISPLAY]:
  Refuse to create secondary X connections.

* configure.in (HAVE_GTK_MULTIDISPLAY): Disable test, unconditionally undefine.
* configure: Regenerate.


git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-450
2005-12-12 03:15:52 +00:00
Karoly Lorentey
d68058039e Fix "first non-ASCII character on new tty frames" problem.
* src/keyboard.c (kbd_buffer_store_event_hold): Simplify condition.
  (read_key_sequence): Reinitialize fkey and keytran at each replay.

* src/coding.c (Fkeyboard_coding_system): Update doc.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-449
2005-12-12 02:37:01 +00:00
Karoly Lorentey
9684e4c92f Update frames-on-display-list to accept terminal id numbers.
* lisp/frame.el (frames-on-display-list): Use terminal-id to get the
  display id.
  (terminal-id): Also accept X display strings and tty device names.


git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-436
2005-11-07 14:17:18 +00:00
Karoly Lorentey
2e4782930a Change `keyboard-translate-table' to be terminal-local.
* lisp/subr.el (keyboard-translate): Use `terminal-local-value' to access `keyboard-translate-table'.
* lisp/obsolete/keyswap.el: Ditto.

* src/keyboard.c (Vkeyboard_translate_table): Moved to struct kboard.
* src/keyboard.h (Vkeyboard_translate_table): Moved to struct kboard.

* src/keyboard.c (read_char): Use current_kboard to access Vkeyboard_translate_table.
* src/keymap.c (Fdescribe_buffer_bindings): Ditto.

* src/keyboard.c (init_kboard): Initialize Vkeyboard_translate_table.

* src/keyboard.c (syms_of_keyboard): Use DEFVAR_KBOARD to define
  Vkeyboard_translate_table. Update doc strings.






git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-431
2005-10-28 14:29:24 +00:00
Karoly Lorentey
30a2fded2e Fix Delete key on X by adapting normal-erase-is-backspace-mode for multi-tty. (Reported by Dan Waber and Dan Nicolaescu.)
* lisp/frame.el (terminal-parameter-p): New function.
  (terminal-parameter): Use it.

* lisp/simple.el (normal-erase-is-backspace): Add 'maybe option, set it as default.
  (normal-erase-is-backspace-mode): Rewrite for multiple display support.
  (normal-erase-is-backspace-setup-frame): New function.

* lisp/frame.el (make-frame): Call it.
* lisp/startup.el (command-line): Call it.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-427
2005-10-23 22:11:22 +00:00
Karoly Lorentey
3fb8e5d73e Fix assertion on kboard->kbd_queue and other such crashes.
* src/keyboard.c (pop_kboard): Set current_kboard to the kboard of the
  selected frame when the stored kboard object has been deleted before
  pop_kboard.  
  (restore_kboard_configuration): Call pop_kboard only after setting up
  single_kboard mode.


git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-418
2005-09-11 09:34:22 +00:00
Karoly Lorentey
256c9c3a61 Fix crash after y-or-n-p prompt triggered by emacsclient. (Reported by Han Boetes, analysis by Kalle Olavi Niemitalo.)
* src/keyboard.c (temporarily_switch_to_single_kboard)
  (record_single_kboard_state, restore_kboard_configuration):  New functions.
  (timer_check): Use record_single_kboard_state instead of
  naive single_kboard state management.

* src/fns.c: Include termhooks.h.
  (Fy_or_n_p): Use temporarily_switch_to_single_kboard to prevent crashes
  caused by bogus longjmps in read_char.

* src/callint.c (Fcall_interactively): Use
  temporarily_switch_to_single_kboard instead of single_kboard_state.
  Make sure it is correctly unwinded.

* src/keyboard.c (recursive_edit_unwind): Remove single_kboard stuff.
  (Frecursive_edit): Use temporarily_switch_to_single_kboard for
  single_kboard state management.

* src/minibuf.c (read_minibuf): Use temporarily_switch_to_single_kboard
  instead of simply calling single_kboard_state.

* src/keyboard.c (push_device_kboard): Remove function.
  (push_kboard): New function.
  (push_frame_kboard): Use it.
  (pop_frame_kboard): Rename to pop_kboard.

* src/xdisp.c (display_mode_line, Fformat_mode_line): Update uses.

* src/data.c: Include termhooks.h.
  (Fterminal_local_value, Fset_terminal_local_value): Update.

* src/Makefile.in (data.o, fns.o): Add termhooks.h dependency.

* src/keyboard.h (push_device_kboard, pop_frame_kboard): Remove declarations.
  (push_kboard, pop_kboard, temporarily_switch_to_single_kboard)
  (record_single_kboard_state): New declarations.


git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-414
2005-09-11 06:42:03 +00:00
Karoly Lorentey
ee0bcfbce6 Set Emacs version number to 22.0.51 to allow parallel installations of CVS trunk and the multi-tty branch.
* README: Set Emacs version to 22.0.51.
* lispref/elisp.texi (EMACSVER): Set to 22.0.51.
* man/emacs.texi (EMACSVER): Set to 22.0.51.
* lisp/version.el (emacs-version): Set to 22.0.51.


git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-413
2005-09-11 04:10:45 +00:00
Karoly Lorentey
b8ccaf6fb3 Make `emacsclient -n <filename>' open new X frames when possible. (Reported by Bas Kok.)
* lib-src/emacsclient.c (decode_options): Change --no-wait to imply
  --current-frame only on ttys and only when there are extra arguments.


git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-411
2005-09-11 03:49:47 +00:00
Karoly Lorentey
6bac161607 Make xt-mouse.el multi-tty-compatible.
* lisp/xt-mouse.el (xterm-mouse-x, xterm-mouse-y): Convert to terminal parameters.
  (xterm-mouse-position-function, xterm-mouse-event): Update.
  (xterm-mouse-mode): Don't depend on current value of window-system.
  (turn-on-xterm-mouse-tracking, turn-off-xterm-mouse-tracking): Update
  for multi-tty.
  (turn-on-xterm-mouse-tracking-on-terminal) 
  (turn-off-xterm-mouse-tracking-on-terminal) 
  (xterm-mouse-handle-delete-frame): New functions.
  (delete-frame-functions, after-make-frame-functions) 
  (suspend-tty-functions, resume-tty-functions): Install extra hooks for multi-tty.


git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-409
2005-09-11 03:06:33 +00:00
Karoly Lorentey
92071250fa Fix `emacsclient -ne '(+ 2 2)'' (reported by Han Boetes), and clean up some corner cases in Emacs server.
* lib-src/emacsclient.c (decode_options): Make --no-wait imply
  --current-frame, except when it is the only option given.  Make sure no
  frame is opened when --current-frame is set.  
  (main): Pass --current-frame to server.el.

* lisp/server.el (server-process-filter): Handle -current-frame command.
  Don't create frames when it is given.  Don't bind X frames to the
  client when we are in -no-wait mode.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-407
2005-09-10 23:51:08 +00:00
Karoly Lorentey
01c6298238 README update.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-405
2005-09-09 20:53:18 +00:00
Karoly Lorentey
af520c4a4e Fix function-key-map massaging vs `C-x 5 2' in lisp/term/*.el. (Submitted by Dan Nicolaescu.)
* term/lk201.el (terminal-init-lk201): 
* term/iris-ansi.el (terminal-init-iris-ansi): 
* term/rxvt.el (terminal-init-rxvt): Protect function-key-map
  against multiple invocations from the same terminal.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-403
2005-09-09 19:04:34 +00:00
Karoly Lorentey
5b65d888a6 Enforce the presence of window-system' and tty-type' frame parameters in all frames.
* src/dispnew.c (init_display): Set up `window-system' and `tty-type'
  frame parameters in the initial tty frame.

* src/frame.c (Fmake_terminal_frame): Look up the `tty-type' frame
  parameter, not `tty' when discovering the tty type of the new frame.
  Initialize `tty' and `tty-type' frame parameters in the new frame.


git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-402
2005-09-07 23:28:54 +00:00
Karoly Lorentey
b8c89bf638 Prevent resource allocation explosion when C-x 5 2 is used on xterms.
* lisp/term/xterm.el (terminal-init-xterm): Protect function-key-map
  against multiple invocations on the same terminal.


git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-401
2005-09-07 23:17:07 +00:00
Karoly Lorentey
cd85984a2d Slightly refactor the terminal initialization code for simplicity.
* lisp/faces.el (tty-run-terminal-initialization): New function.
  (tty-create-frame-with-faces): Use it.

* lisp/startup.el (command-line): Replace duplicated code with a call to
  tty-run-terminal-initialization.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-399
2005-09-07 02:29:18 +00:00
Karoly Lorentey
f0caabd962 Add two pending bugs to README.multi-tty.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-392
2005-08-25 12:03:34 +00:00
Karoly Lorentey
d51abf2262 Work around crashes in X session management after normal shutdown of X server.
* src/xsmfns.c (x_session_close): New function.
* src/xterm.h: Declare it.

* src/xterm.c (XTread_socket): Don't call x_session_check_input for
  secondary displays.
  (x_term_init): Do not initialize X session management when the initial
  display was a tty frame.
  (x_delete_display): Close X session management when we close its display.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-390
2005-08-04 00:46:55 +00:00
Karoly Lorentey
a9d63618b0 README update.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-385
2005-07-11 00:21:10 +00:00