Commit 6ed8eeff authored by Karoly Lorentey's avatar Karoly Lorentey

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
parent 17ccbd91
......@@ -9,7 +9,7 @@ Some use cases:
Emacs is notoriously slow at startup, so most people use another
editor or emacsclient for quick editing jobs from the console.
Unfortunately, emacsclient was very awkward to use, because it did not
support opening a new Emacs frame on the current virtual console.
support opening a new Emacs frame on the current virtual tty.
Now, with multi-tty support, it can do that. (Emacsclient starts up
faster than vi!)
......@@ -86,7 +86,7 @@ major problems have been fixed, only a few minor issues remain. (It
still needs to be ported to Windows/Mac/DOS, though.) Both multiple
tty device support and simultaneous X and tty frame support works
fine. Emacsclient has been extended to support opening new tty and X
frames. It has been changed open new Emacs frames by default.
frames. It has been changed to open new Emacs frames by default.
The multi-tty branch has been scheduled for inclusion in the next
major release of Emacs (version 23). I expect the merge into the
......@@ -250,9 +250,8 @@ also works. Of course, you can create frames on more than two tty
devices.
Creating new frames on the same tty with C-x 5 2 (make-frame-command)
works, and they behave the same way as in previous Emacs versions. If
you exit emacs, all terminals should be restored to their previous
states.
works, and behaves the same way as in previous Emacs versions. If you
exit emacs, all terminals should be restored to their previous states.
This is work in progress, and probably full of bugs. It is a good
idea to run emacs from gdb, so that you'll have a live instance to
......@@ -350,49 +349,50 @@ NEWS
For the NEWS file: (Needs much, much work)
** Support for multiple terminal devices has been added.
** Support for multiple terminal devices and simultaneous graphical
and tty frames has been added. You can test for the presence of
this feature in your Lisp code by testing for the `multi-tty'
feature.
*** The `window-system' variable has been made frame-local. The new
`initial-window-system' variable contains the `window-system'
value for the first frame.
*** You can specify a terminal device (`tty' parameter) and a terminal
type (`tty-type' parameter) to `make-terminal-frame'.
*** You can test for the presence of multiple terminal support by
testing for the `multi-tty' feature.
*** The new function `make-frame-on-tty' allows you to create a new
frame on another tty device interactively.
*** The function `make-frame-on-display' now works during a tty
session, and `make-frame-on-tty' works during a graphical session.
*** Emacsclient has been extended to support opening a new terminal
frame. Its behaviour has been changed to open a new Emacs frame by
default. Use the -c option to get the old behavior of opening
files in the currently selected Emacs frame.
*** A make-frame-on-tty function has been added to make it easier to
create frames on new terminals.
*** C-z now invokes `suspend-frame', C-x C-c now invokes
`save-buffers-kill-terminal'.
*** New functions: frame-tty-name, frame-tty-type, delete-tty,
terminal-local-value, set-terminal-local-value
suspend-tty, resume-tty, terminal-id, terminal-parameters,
terminal-parameter, set-terminal-parameter,
modify-terminal-parameters, environment, let-environment
terminal-id, terminal-parameters, terminal-parameter,
set-terminal-parameter
*** New variables: local-key-translation-map, local-function-key-map
*** New variables: global-key-translation-map
*** The `keyboard-translate-table' variable and the terminal and
keyboard coding systems have been made terminal-local.
*** The keymaps key-translation-map and function-key-map are now
terminal-local.
** Support for simultaneous graphical and terminal frames has been
added.
*** The function `make-frame-on-display' now works during a terminal
session, and `make-frame-on-tty' works during a graphical session.
*** The `window-system' variable has been made frame-local.
*** The new `initial-window-system' variable contains the
`window-system' value for the first frame.
*** In addition to the global key-translation-map and
function-key-map, Emacs has terminal-local
local-key-translation-map and local-function-key-map variables,
and uses them instead of the global keymaps to set up translations
and function key sequences relevant to a specific terminal device.
*** talk.el has been extended for multiple tty support.
*** C-z now invokes `suspend-frame', C-x C-c now invokes
`save-buffers-kill-frame'.
* * *
(The rest of this file consists of my development notes and as such it
......@@ -518,15 +518,16 @@ THINGS TO DO
frames-on-display-list frames-on-terminal-list
The following functions were introduced in the multi-tty branch, and
can be renamed without aliases:
were renamed without aliases:
display-controlling-tty-p terminal-controlling-tty-p
delete-display delete-terminal
display-controlling-tty-p controlling-tty-p
display-list terminal-list
display-live-p terminal-live-p
display-name terminal-name
display-tty-type terminal-tty-type
frame-display terminal-of-frame
delete-display delete-terminal
display-tty-type tty-type
frame-display frame-terminal
selected-display selected-terminal
** The single-keyboard mode of MULTI_KBOARD is extremely confusing
sometimes; Emacs does not respond to stimuli from other keyboards.
......
......@@ -4879,7 +4879,7 @@ With prefix arg, silently save all file-visiting buffers, then kill."
(funcall confirm-kill-emacs "Really exit Emacs? "))
(kill-emacs)))
(defun save-buffers-kill-display (&optional arg)
(defun save-buffers-kill-terminal (&optional arg)
"Offer to save each buffer, then kill the current connection.
If the current frame has no client, kill Emacs itself.
......@@ -4892,7 +4892,7 @@ only these files will be asked to be saved."
(frame (selected-frame)))
(if (null proc)
(save-buffers-kill-emacs)
(server-save-buffers-kill-display proc arg))))
(server-save-buffers-kill-terminal proc arg))))
;; We use /: as a prefix to "quote" a file name
......@@ -4991,7 +4991,7 @@ only these files will be asked to be saved."
(define-key ctl-x-map "i" 'insert-file)
(define-key esc-map "~" 'not-modified)
(define-key ctl-x-map "\C-d" 'list-directory)
(define-key ctl-x-map "\C-c" 'save-buffers-kill-display)
(define-key ctl-x-map "\C-c" 'save-buffers-kill-terminal)
(define-key ctl-x-map "\C-q" 'toggle-read-only)
(define-key ctl-x-4-map "f" 'find-file-other-window)
......
......@@ -651,7 +651,7 @@ You cannot specify either `width' or `height', you must use neither or both.
(window-system . nil) The frame should be displayed on a terminal device.
(window-system . x) The frame should be displayed in an X window.
(device . ID) The frame should use the display device identified by ID.
(terminal . ID) The frame should use the terminal identified by ID.
Before the frame is created (via `frame-creation-function-alist'), functions on the
hook `before-make-frame-hook' are run. After the frame is created, functions
......@@ -664,11 +664,11 @@ instance if the frame appears under the mouse pointer and your
setup is for focus to follow the pointer."
(interactive)
(let* ((w (cond
((assq 'device parameters)
(let ((type (display-live-p (cdr (assq 'device parameters)))))
((assq 'terminal parameters)
(let ((type (terminal-live-p (cdr (assq 'terminal parameters)))))
(cond
((eq type t) nil)
((eq type nil) (error "Display %s does not exist" (cdr (assq 'device parameters))))
((eq type nil) (error "Terminal %s does not exist" (cdr (assq 'terminal parameters))))
(t type))))
((assq 'window-system parameters)
(cdr (assq 'window-system parameters)))
......@@ -682,7 +682,7 @@ setup is for focus to follow the pointer."
(setq frame (funcall frame-creation-function (append parameters (cdr (assq w window-system-default-frame-alist)))))
(normal-erase-is-backspace-setup-frame frame)
;; Set up the frame-local environment, if needed.
(when (eq (frame-display frame) (frame-display oldframe))
(when (eq (frame-terminal frame) (frame-terminal oldframe))
(let ((env (frame-parameter oldframe 'environment)))
(if (not (framep env))
(setq env oldframe))
......@@ -718,7 +718,7 @@ If TERMINAL is omitted or nil, it defaults to the selected
frame's terminal device."
(let* ((terminal (terminal-id terminal))
(func #'(lambda (frame)
(eq (frame-display frame) terminal))))
(eq (frame-terminal frame) terminal))))
(filtered-frame-list func)))
(defun framep-on-display (&optional terminal)
......@@ -727,7 +727,7 @@ TERMINAL may be a terminal id, a display name or a frame. If it
is a frame, its type is returned. If TERMINAL is omitted or nil,
it defaults to the selected frame's terminal device. All frames
on a given display are of the same type."
(or (display-live-p terminal)
(or (terminal-live-p terminal)
(framep terminal)
(framep (car (frames-on-display-list terminal)))))
......@@ -815,7 +815,7 @@ Calls `suspend-emacs' if invoked from the controlling tty device,
(cond
((eq type 'x) (iconify-or-deiconify-frame))
((eq type t)
(if (display-controlling-tty-p)
(if (controlling-tty-p)
(suspend-emacs)
(suspend-tty)))
(t (suspend-emacs)))))
......@@ -1068,9 +1068,9 @@ bars (top, bottom, or nil)."
(cons vert hor)))
;;;; Frame/display capabilities.
(defun selected-display ()
"Return the display that is now selected."
(frame-display (selected-frame)))
(defun selected-terminal ()
"Return the terminal that is now selected."
(frame-terminal (selected-frame)))
(defun display-mouse-p (&optional display)
"Return non-nil if DISPLAY has a mouse available.
......
......@@ -247,7 +247,7 @@ ENV should be in the same format as `process-environment'."
(setenv (car ,pair) (cdr ,pair)))))))
(defun server-delete-client (client &optional noframe)
"Delete CLIENT, including its buffers, devices and frames.
"Delete CLIENT, including its buffers, terminals and frames.
If NOFRAME is non-nil, let the frames live. (To be used from
`delete-frame-functions'."
;; Force a new lookup of client (prevents infinite recursion).
......@@ -271,9 +271,9 @@ If NOFRAME is non-nil, let the frames live. (To be used from
(kill-buffer (current-buffer))))))
;; Delete the client's tty.
(let ((device (server-client-get client 'device)))
(when (eq (display-live-p device) t)
(delete-display device)))
(let ((terminal (server-client-get client 'terminal)))
(when (eq (terminal-live-p terminal) t)
(delete-terminal terminal)))
;; Delete the client's frames.
(unless noframe
......@@ -323,18 +323,18 @@ message."
;; there are other frames on it.
(< 0 (let ((frame-num 0))
(mapc (lambda (f)
(when (eq (frame-display f)
(frame-display frame))
(when (eq (frame-terminal f)
(frame-terminal frame))
(setq frame-num (1+ frame-num))))
(frame-list))
frame-num))))
(server-log (format "server-handle-delete-frame, frame %s" frame) proc)
(server-delete-client proc 'noframe)))) ; Let delete-frame delete the frame later.
(defun server-handle-suspend-tty (device)
(defun server-handle-suspend-tty (terminal)
"Notify the emacsclient process to suspend itself when its tty device is suspended."
(dolist (proc (server-clients-with 'device device))
(server-log (format "server-handle-suspend-tty, device %s" device) proc)
(dolist (proc (server-clients-with 'terminal terminal))
(server-log (format "server-handle-suspend-tty, terminal %s" terminal) proc)
(condition-case err
(server-send-string proc "-suspend \n")
(file-error (condition-case nil (server-delete-client proc) (error nil))))))
......@@ -618,7 +618,7 @@ The following commands are accepted by the client:
;; Flag frame as client-created, but use a dummy client.
;; This will prevent the frame from being deleted when
;; emacsclient quits while also preventing
;; `server-save-buffers-kill-display' from unexpectedly
;; `server-save-buffers-kill-terminal' from unexpectedly
;; killing emacs on that frame.
(list (cons 'client 'nowait) (cons 'environment env))
(list (cons 'client proc) (cons 'environment env)))))
......@@ -636,7 +636,7 @@ The following commands are accepted by the client:
(modify-frame-parameters frame params)
(select-frame frame)
(server-client-set client 'frame frame)
(server-client-set client 'device (frame-display frame))
(server-client-set client 'terminal (frame-terminal frame))
(setq dontkill t))
;; This emacs does not support X.
(server-log "Window system unsupported" proc)
......@@ -645,19 +645,19 @@ The following commands are accepted by the client:
;; -resume: Resume a suspended tty frame.
((equal "-resume" arg)
(let ((device (server-client-get client 'device)))
(let ((terminal (server-client-get client 'terminal)))
(setq dontkill t)
(when (eq (display-live-p device) t)
(resume-tty device))))
(when (eq (terminal-live-p terminal) t)
(resume-tty terminal))))
;; -suspend: Suspend the client's frame. (In case we
;; get out of sync, and a C-z sends a SIGTSTP to
;; emacsclient.)
((equal "-suspend" arg)
(let ((device (server-client-get client 'device)))
(let ((terminal (server-client-get client 'terminal)))
(setq dontkill t)
(when (eq (display-live-p device) t)
(suspend-tty device))))
(when (eq (terminal-live-p terminal) t)
(suspend-tty terminal))))
;; -ignore COMMENT: Noop; useful for debugging emacsclient.
;; (The given comment appears in the server log.)
......@@ -687,8 +687,8 @@ The following commands are accepted by the client:
(environment . ,env)))))
(select-frame frame)
(server-client-set client 'frame frame)
(server-client-set client 'tty (display-name frame))
(server-client-set client 'device (frame-display frame))
(server-client-set client 'tty (terminal-name frame))
(server-client-set client 'terminal (frame-terminal frame))
;; Reply with our pid.
(server-send-string proc (concat "-emacs-pid " (number-to-string (emacs-pid)) "\n"))
......@@ -1037,8 +1037,8 @@ done that."
(get-window-with-predicate
(lambda (w)
(and (not (window-dedicated-p w))
(equal (frame-parameter (window-frame w) 'device)
(frame-parameter (selected-frame) 'device))))
(equal (frame-terminal (window-frame w))
(frame-terminal (selected-frame)))))
'nomini 'visible (selected-window))))
(condition-case nil
(switch-to-buffer next-buffer)
......@@ -1047,7 +1047,7 @@ done that."
(error (pop-to-buffer next-buffer)))))))))
;;;###autoload
(defun server-save-buffers-kill-display (proc &optional arg)
(defun server-save-buffers-kill-terminal (proc &optional arg)
"Offer to save each buffer, then kill PROC.
With prefix arg, silently save all file-visiting buffers, then kill.
......
......@@ -1430,7 +1430,7 @@ Copyright (C) 2005 Free Software Foundation, Inc."))
;; use precomputed string to save lots of time.
(if (and (eq (key-binding "\C-h") 'help-command)
(eq (key-binding "\C-xu") 'advertised-undo)
(eq (key-binding "\C-x\C-c") 'save-buffers-kill-display)
(eq (key-binding "\C-x\C-c") 'save-buffers-kill-terminal)
(eq (key-binding "\C-ht") 'help-with-tutorial)
(eq (key-binding "\C-hi") 'info)
(eq (key-binding "\C-hr") 'info-emacs-manual)
......@@ -1447,7 +1447,7 @@ Browse manuals C-h i")
Get help %s
Emacs manual \\[info-emacs-manual]
Emacs tutorial \\[help-with-tutorial]\tUndo changes\t\\[advertised-undo]
Buy manuals \\[view-order-manuals]\tExit Emacs\t\\[save-buffers-kill-display]
Buy manuals \\[view-order-manuals]\tExit Emacs\t\\[save-buffers-kill-terminal]
Browse manuals \\[info]"
(let ((where (where-is-internal
'help-command nil t)))
......
......@@ -50,22 +50,22 @@ Each element has the form (DISPLAY FRAME BUFFER).")
"Connect to the Emacs talk group from the current X display or tty frame."
(interactive)
(let ((type (frame-live-p (selected-frame)))
(display (frame-display (selected-frame))))
(display (frame-terminal (selected-frame))))
(cond
((eq type t)
(talk-add-display (selected-frame)))
((eq type 'x)
(talk-add-display (frame-display (selected-frame))))
(talk-add-display (frame-terminal (selected-frame))))
(t
(error "Unknown frame type"))))
(talk-update-buffers))
(defun talk-add-display (frame)
(let* ((display (if (frame-live-p frame)
(frame-display frame)
(frame-terminal frame)
frame))
(elt (assoc display talk-display-alist))
(name (concat "*talk-" (display-name display) "*"))
(name (concat "*talk-" (terminal-name display) "*"))
buffer)
(unless (frame-live-p frame)
(setq frame (make-frame-on-display display (list (cons 'name name)))))
......
......@@ -34,17 +34,17 @@ TERMINAL may be the name of an X display
device (HOST.SERVER.SCREEN) or a tty device file."
(cond
((integerp terminal)
(if (display-live-p terminal)
(if (terminal-live-p terminal)
terminal
(signal 'wrong-type-argument (list 'display-live-p terminal))))
(signal 'wrong-type-argument (list 'terminal-live-p terminal))))
((or (null terminal) (framep terminal))
(frame-display terminal))
(frame-terminal terminal))
((stringp terminal)
(let ((f (car (filtered-frame-list (lambda (frame)
(or (equal (frame-parameter frame 'display) terminal)
(equal (frame-parameter frame 'tty) terminal)))))))
(or f (error "Display %s does not exist" terminal))
(frame-display f)))
(frame-terminal f)))
(t
(error "Invalid argument %s in `terminal-id'" terminal))))
......
......@@ -197,18 +197,18 @@ down the SHIFT key while pressing the mouse button."
(defun turn-on-xterm-mouse-tracking-on-terminal (terminal)
"Enable xterm mouse tracking on TERMINAL."
(when (and xterm-mouse-mode (eq t (display-live-p terminal)))
(when (and xterm-mouse-mode (eq t (terminal-live-p terminal)))
(send-string-to-terminal "\e[?1000h" terminal)))
(defun turn-off-xterm-mouse-tracking-on-terminal (terminal)
"Disable xterm mouse tracking on TERMINAL."
(when (and xterm-mouse-mode (eq t (display-live-p terminal)))
(when (and xterm-mouse-mode (eq t (terminal-live-p terminal)))
(send-string-to-terminal "\e[?1000l" terminal)))
(defun xterm-mouse-handle-delete-frame (frame)
"Turn off xterm mouse tracking if FRAME is the last frame on its device."
(when (and (eq t (frame-live-p frame))
(<= 1 (length (frames-on-display-list (frame-display frame)))))
(<= 1 (length (frames-on-display-list (frame-terminal frame)))))
(turn-off-xterm-mouse-tracking-on-terminal frame)))
;; Frame creation and deletion.
......
......@@ -324,7 +324,7 @@ Lisp_Object Vgc_elapsed; /* accumulated elapsed time in GC */
EMACS_INT gcs_done; /* accumulated GCs */
static void mark_buffer P_ ((Lisp_Object));
extern void mark_devices P_ ((void));
extern void mark_terminals P_ ((void));
extern void mark_kboards P_ ((void));
extern void mark_ttys P_ ((void));
extern void mark_backtrace P_ ((void));
......@@ -4938,7 +4938,7 @@ returns nil, because real GC can't be done. */)
mark_object (bind->symbol);
mark_object (bind->old_value);
}
mark_devices ();
mark_terminals ();
mark_kboards ();
mark_ttys ();
......
......@@ -7351,11 +7351,11 @@ Return the corresponding character code in Big5. */)
DEFUN ("set-terminal-coding-system-internal", Fset_terminal_coding_system_internal,
Sset_terminal_coding_system_internal, 1, 2, 0,
doc: /* Internal use only. */)
(coding_system, device)
(coding_system, terminal)
Lisp_Object coding_system;
Lisp_Object device;
Lisp_Object terminal;
{
struct coding_system *terminal_coding = DEVICE_TERMINAL_CODING (get_device (device, 1));
struct coding_system *terminal_coding = TERMINAL_TERMINAL_CODING (get_terminal (terminal, 1));
CHECK_SYMBOL (coding_system);
setup_coding_system (Fcheck_coding_system (coding_system), terminal_coding);
/* We had better not send unsafe characters to terminal. */
......@@ -7389,41 +7389,41 @@ DEFUN ("set-safe-terminal-coding-system-internal", Fset_safe_terminal_coding_sys
DEFUN ("terminal-coding-system", Fterminal_coding_system,
Sterminal_coding_system, 0, 1, 0,
doc: /* Return coding system specified for terminal output on the given device.
DEVICE may be a display device id, a frame, or nil for the selected
frame's display device. */)
(device)
Lisp_Object device;
doc: /* Return coding system specified for terminal output on the given terminal.
TERMINAL may be a terminal id, a frame, or nil for the selected
frame's terminal device. */)
(terminal)
Lisp_Object terminal;
{
return DEVICE_TERMINAL_CODING (get_device (device, 1))->symbol;
return TERMINAL_TERMINAL_CODING (get_terminal (terminal, 1))->symbol;
}
DEFUN ("set-keyboard-coding-system-internal", Fset_keyboard_coding_system_internal,
Sset_keyboard_coding_system_internal, 1, 2, 0,
doc: /* Internal use only. */)
(coding_system, device)
(coding_system, terminal)
Lisp_Object coding_system;
Lisp_Object device;
Lisp_Object terminal;
{
struct device *d = get_device (device, 1);
struct terminal *t = get_terminal (terminal, 1);
CHECK_SYMBOL (coding_system);
setup_coding_system (Fcheck_coding_system (coding_system),
DEVICE_KEYBOARD_CODING (d));
TERMINAL_KEYBOARD_CODING (t));
/* Character composition should be disabled. */
DEVICE_KEYBOARD_CODING (d)->composing = COMPOSITION_DISABLED;
TERMINAL_KEYBOARD_CODING (t)->composing = COMPOSITION_DISABLED;
return Qnil;
}
DEFUN ("keyboard-coding-system", Fkeyboard_coding_system,
Skeyboard_coding_system, 0, 1, 0,
doc: /* Return coding system for decoding keyboard input on DEVICE.
DEVICE may be a display device id, a frame, or nil for the selected
frame's display device. */)
(device)
Lisp_Object device;
doc: /* Return coding system for decoding keyboard input on TERMINAL.
TERMINAL may be a terminal id, a frame, or nil for the selected
frame's terminal device. */)
(terminal)
Lisp_Object terminal;
{
return DEVICE_KEYBOARD_CODING (get_device (device, 1))->symbol;
return TERMINAL_KEYBOARD_CODING (get_terminal (terminal, 1))->symbol;
}
......
......@@ -1900,41 +1900,41 @@ If the current binding is global (the default), the value is nil. */)
/* This code is disabled now that we use the selected frame to return
keyboard-local-values. */
#if 0
extern struct device *get_device P_ ((Lisp_Object display, int));
extern struct terminal *get_terminal P_ ((Lisp_Object display, int));
DEFUN ("terminal-local-value", Fterminal_local_value, Sterminal_local_value, 2, 2, 0,
doc: /* Return the terminal-local value of SYMBOL on DEVICE.
doc: /* Return the terminal-local value of SYMBOL on TERMINAL.
If SYMBOL is not a terminal-local variable, then return its normal
value, like `symbol-value'.
DEVICE may be a display device id, a frame, or nil (meaning the
selected frame's display device). */)
(symbol, device)
TERMINAL may be a terminal id, a frame, or nil (meaning the
selected frame's terminal device). */)
(symbol, terminal)
Lisp_Object symbol;
Lisp_Object device;
Lisp_Object terminal;
{
Lisp_Object result;
struct device *d = get_device (device, 1);
push_kboard (d->kboard);
struct terminal *t = get_terminal (terminal, 1);
push_kboard (t->kboard);
result = Fsymbol_value (symbol);
pop_kboard ();
return result;
}
DEFUN ("set-terminal-local-value", Fset_terminal_local_value, Sset_terminal_local_value, 3, 3, 0,
doc: /* Set the terminal-local binding of SYMBOL on DEVICE to VALUE.
doc: /* Set the terminal-local binding of SYMBOL on TERMINAL to VALUE.
If VARIABLE is not a terminal-local variable, then set its normal
binding, like `set'.
DEVICE may be a display device id, a frame, or nil (meaning the
selected frame's display device). */)
(symbol, device, value)
TERMINAL may be a terminal id, a frame, or nil (meaning the
selected frame's terminal device). */)
(symbol, terminal, value)
Lisp_Object symbol;
Lisp_Object device;
Lisp_Object terminal;
Lisp_Object value;
{
Lisp_Object result;
struct device *d = get_device (device, 1);
struct terminal *t = get_terminal (terminal, 1);
push_kboard (d->kboard);
result = Fset (symbol, value);
pop_kboard ();
......
......@@ -1350,7 +1350,7 @@ struct glyph_string
DESCENT = FONT->descent
HEIGHT = FONT_HEIGHT (FONT)
F_DESCENT = (FRAME_FONT (F)->descent
- F->device->output_data.x->baseline_offset)
- F->terminal->output_data.x->baseline_offset)
F_HEIGHT = FRAME_LINE_HEIGHT (F)
*/
......@@ -2927,11 +2927,8 @@ extern void update_begin P_ ((struct frame *));
extern void update_end P_ ((struct frame *));
extern void set_terminal_window P_ ((struct frame *, int));
extern void cursor_to P_ ((struct frame *, int, int));
/* Was not declared before: */
extern void raw_cursor_to P_ ((struct frame *, int, int));
extern void clear_to_end P_ ((struct frame *));
extern void clear_frame P_ ((struct frame *));
extern void clear_end_of_line P_ ((struct frame *, int));
extern void write_glyphs P_ ((struct frame *, struct glyph *, int));
......@@ -2939,13 +2936,13 @@ extern void insert_glyphs P_ ((struct frame *, struct glyph *, int));
extern void delete_glyphs P_ ((struct frame *, int));
extern void ins_del_lines P_ ((struct frame *, int, int));
extern struct device *init_initial_device P_ ((void));
extern struct terminal *init_initial_terminal P_ ((void));
/* Defined in term.c */
extern void tty_set_terminal_modes P_ ((struct device *));
extern void tty_reset_terminal_modes P_ ((struct device *));
extern void tty_set_terminal_modes P_ ((struct terminal *));
extern void tty_reset_terminal_modes P_ ((struct terminal *));
extern void tty_turn_off_insert P_ ((struct tty_display_info *));
extern void tty_turn_off_highlight P_ ((struct tty_display_info *));
extern int string_cost P_ ((char *));
......@@ -2955,11 +2952,11 @@ extern void produce_glyphs P_ ((struct it *));
extern void produce_special_glyphs P_ ((struct it *, enum display_element_type));
extern int tty_capable_p P_ ((struct tty_display_info *, unsigned, unsigned long, unsigned long));
extern void set_tty_color_mode P_ ((struct frame *, Lisp_Object));
extern struct device *get_tty_device P_ ((Lisp_Object terminal));
extern struct device *get_named_tty P_ ((char *));
EXFUN (Fdisplay_tty_type, 1);
extern struct terminal *get_tty_terminal P_ ((Lisp_Object terminal));
extern struct terminal *get_named_tty P_ ((char *));
EXFUN (Ftty_type, 1);
extern void create_tty_output P_ ((struct frame *));
extern struct device *init_tty P_ ((char *, char *, int));
extern struct terminal *init_tty P_ ((char *, char *, int));
/* Defined in scroll.c */
......
......@@ -3345,7 +3345,7 @@ DEFUN ("redraw-frame", Fredraw_frame, Sredraw_frame, 1, 1, 0,
update_begin (f);
#ifdef MSDOS
if (FRAME_MSDOS_P (f))
set_terminal_modes (FRAME_DEVICE (f));
set_terminal_modes (FRAME_TERMINAL (f));
#endif
clear_frame (f);
clear_current_matrices (f);
......@@ -6304,23 +6304,23 @@ DEFUN ("send-string-to-terminal", Fsend_string_to_terminal,
doc: /* Send STRING to the terminal without alteration.
Control characters in STRING will have terminal-dependent effects.