summaryrefslogtreecommitdiff
path: root/lisp/frame.el
diff options
context:
space:
mode:
authorKaroly Lorentey <lorentey@elte.hu>2005-11-07 14:17:18 +0000
committerKaroly Lorentey <lorentey@elte.hu>2005-11-07 14:17:18 +0000
commit9684e4c92f12f7c31f5e6fda7742960b403395f6 (patch)
tree7dd95b31d3bfecc050a31d791c654e8d3b9669fc /lisp/frame.el
parentcd0cf71c4f41023a8d9c20b3a26e44b980992b5a (diff)
downloademacs-9684e4c92f12f7c31f5e6fda7742960b403395f6.tar.gz
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
Diffstat (limited to 'lisp/frame.el')
-rw-r--r--lisp/frame.el33
1 files changed, 22 insertions, 11 deletions
diff --git a/lisp/frame.el b/lisp/frame.el
index 8342d8e6aac..fb494429fea 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -696,17 +696,18 @@ setup is for focus to follow the pointer."
(function (lambda (frame)
(eq frame (window-frame (minibuffer-window frame)))))))
-(defun frames-on-display-list (&optional display)
- "Return a list of all frames on DISPLAY.
+(defun frames-on-display-list (&optional terminal)
+ "Return a list of all frames on TERMINAL.
-DISPLAY should be a display identifier (an integer), but it may
-also be a name of a display, a string of the form HOST:SERVER.SCREEN.
+TERMINAL should be a terminal identifier (an integer), a frame,
+or a name of an X display (a string of the form
+HOST:SERVER.SCREEN).
-If DISPLAY is omitted or nil, it defaults to the selected frame's display."
- (let* ((display (or display (frame-display)))
+If TERMINAL is omitted or nil, it defaults to the selected
+frame's terminal device."
+ (let* ((terminal (terminal-id terminal))
(func #'(lambda (frame)
- (or (eq (frame-display frame) display)
- (equal (frame-parameter frame 'display) display)))))
+ (eq (frame-display frame) terminal))))
(filtered-frame-list func)))
(defun framep-on-display (&optional display)
@@ -1430,13 +1431,23 @@ Use Custom to set this variable to get the display updated."
(defun terminal-id (terminal)
"Return the numerical id of terminal TERMINAL.
-TERMINAL can be a terminal id, a frame, or nil (meaning the
-selected frame's terminal)."
+TERMINAL can be a terminal id (an integer), a frame, or
+nil (meaning the selected frame's terminal). Alternatively,
+TERMINAL may be the name of an X display
+device (HOST.SERVER.SCREEN) or a tty device file."
(cond
((integerp terminal)
- terminal)
+ (if (display-live-p terminal)
+ terminal
+ (signal 'wrong-type-argument (list 'display-live-p terminal))))
((or (null terminal) (framep terminal))
(frame-display 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)))
(t
(error "Invalid argument %s in `terminal-id'" terminal))))