Function: get-device-terminal
get-device-terminal is a byte-compiled function defined in
frame.el.gz.
Signature
(get-device-terminal DEVICE)
Documentation
Return the terminal corresponding to DEVICE.
DEVICE can be a terminal, a frame, nil (meaning the selected frame's terminal), the name of an X display device (HOST.SERVER.SCREEN) or a tty device file.
Probably introduced at or before Emacs version 23.1.
Source Code
;; Defined in /usr/src/emacs/lisp/frame.el.gz
;; Used to be called `terminal-id' in termdev.el.
(defun get-device-terminal (device)
"Return the terminal corresponding to DEVICE.
DEVICE can be a terminal, a frame, nil (meaning the selected frame's terminal),
the name of an X display device (HOST.SERVER.SCREEN) or a tty device file."
(cond
((or (null device) (framep device))
(frame-terminal device))
((stringp device)
(let ((f (car (filtered-frame-list
(lambda (frame)
(or (equal (frame-parameter frame 'display) device)
(equal (frame-parameter frame 'tty) device)))))))
(or f (error "Display %s does not exist" device))
(frame-terminal f)))
((terminal-live-p device) device)
(t
(error "Invalid argument %s in `get-device-terminal'" device))))