aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2007-09-20 21:57:23 +0000
committerStefan Monnier2007-09-20 21:57:23 +0000
commit371fed4ea49cb23061a39549c0e74aeed85e84df (patch)
tree31ffd502dc12c3c5098b9a3b2fb66901f779e43d
parentd3615887a6bfcae39f08e79483dd25062d13e441 (diff)
downloademacs-371fed4ea49cb23061a39549c0e74aeed85e84df.tar.gz
emacs-371fed4ea49cb23061a39549c0e74aeed85e84df.zip
(get-device-terminal): New function. Moved from termdev.el.
(frames-on-display-list): Use it.
-rw-r--r--lisp/frame.el38
1 files changed, 28 insertions, 10 deletions
diff --git a/lisp/frame.el b/lisp/frame.el
index 8da6c508a2d..7f5cdbe19dc 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -31,9 +31,8 @@
31 (list (cons nil 31 (list (cons nil
32 (if (fboundp 'tty-create-frame-with-faces) 32 (if (fboundp 'tty-create-frame-with-faces)
33 'tty-create-frame-with-faces 33 'tty-create-frame-with-faces
34 (function 34 (lambda (parameters)
35 (lambda (parameters) 35 (error "Can't create multiple frames without a window system")))))
36 (error "Can't create multiple frames without a window system"))))))
37 "Alist of window-system dependent functions to call to create a new frame. 36 "Alist of window-system dependent functions to call to create a new frame.
38The window system startup file should add its frame creation 37The window system startup file should add its frame creation
39function to this list, which should take an alist of parameters 38function to this list, which should take an alist of parameters
@@ -757,16 +756,35 @@ setup is for focus to follow the pointer."
757 (lambda (frame) 756 (lambda (frame)
758 (eq frame (window-frame (minibuffer-window frame)))))) 757 (eq frame (window-frame (minibuffer-window frame))))))
759 758
760(defun frames-on-display-list (&optional terminal) 759;; Used to be called `terminal-id' in termdev.el.
761 "Return a list of all frames on TERMINAL. 760(defun get-device-terminal (device)
762 761 "Return the terminal corresponding to DEVICE.
763TERMINAL should be a terminal, a frame, 762DEVICE can be a terminal, a frame, nil (meaning the selected frame's terminal),
764or a name of an X display (a string of the form 763the name of an X display device (HOST.SERVER.SCREEN) or a tty device file."
764 (cond
765 ((or (null device) (framep device))
766 (frame-terminal device))
767 ((stringp device)
768 (let ((f (car (filtered-frame-list
769 (lambda (frame)
770 (or (equal (frame-parameter frame 'display) device)
771 (equal (frame-parameter frame 'tty) device)))))))
772 (or f (error "Display %s does not exist" device))
773 (frame-terminal f)))
774 ((terminal-live-p device) device)
775 (t
776 (error "Invalid argument %s in `get-device-terminal'" device))))
777
778(defun frames-on-display-list (&optional device)
779 "Return a list of all frames on DEVICE.
780
781DEVICE should be a terminal, a frame,
782or a name of an X display or tty (a string of the form
765HOST:SERVER.SCREEN). 783HOST:SERVER.SCREEN).
766 784
767If TERMINAL is omitted or nil, it defaults to the selected 785If DEVICE is omitted or nil, it defaults to the selected
768frame's terminal device." 786frame's terminal device."
769 (let* ((terminal (terminal-id terminal)) 787 (let* ((terminal (get-device-terminal device))
770 (func #'(lambda (frame) 788 (func #'(lambda (frame)
771 (eq (frame-terminal frame) terminal)))) 789 (eq (frame-terminal frame) terminal))))
772 (filtered-frame-list func))) 790 (filtered-frame-list func)))