summaryrefslogtreecommitdiff
path: root/lisp/talk.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1995-07-01 19:40:13 +0000
committerRichard M. Stallman <rms@gnu.org>1995-07-01 19:40:13 +0000
commitc2bef98549811f2146cd9cbd5b34ad125ba4ddfb (patch)
tree058e34e4277088330c72fa0f27e8bb1bd569cb9e /lisp/talk.el
parent19deb21efeb9fca0a97e9d33dad19c1eb827c689 (diff)
downloademacs-c2bef98549811f2146cd9cbd5b34ad125ba4ddfb.tar.gz
(talk-disconnect): Make it interactive.
(talk-add-display): Ignore dead buffers and deleted frames.
Diffstat (limited to 'lisp/talk.el')
-rw-r--r--lisp/talk.el18
1 files changed, 10 insertions, 8 deletions
diff --git a/lisp/talk.el b/lisp/talk.el
index a4d3d1cfd58..74ed9ba0bef 100644
--- a/lisp/talk.el
+++ b/lisp/talk.el
@@ -43,17 +43,19 @@ Each element has the form (DISPLAY FRAME BUFFER).")
(talk-update-buffers))
(defun talk-add-display (display)
- (or (assoc display talk-display-alist)
- (let* ((name (concat "*talk-" display "*"))
- (buffer (get-buffer-create name))
- (frame (make-frame-on-display display
- (list (cons 'name name)))))
- (setq talk-display-alist
- (cons (list display frame buffer)
- talk-display-alist)))))
+ (let* ((elt (assoc display talk-display-alist))
+ (name (concat "*talk-" display "*"))
+ buffer frame)
+ (if (not (and elt (frame-live-p (setq frame (nth 1 elt)))))
+ (setq frame (make-frame-on-display display (list (cons 'name name)))))
+ (if (not (and elt (buffer-name (get-buffer (setq buffer (nth 2 elt))))))
+ (setq buffer (get-buffer-create name)))
+ (setq talk-display-alist
+ (cons (list display frame buffer) (delq elt talk-display-alist)))))
(defun talk-disconnect ()
"Disconnect this display from the Emacs talk group."
+ (interactive)
(let* ((mydisp (cdr (assq 'display (frame-parameters (selected-frame)))))
(elt (assoc mydisp talk-display-alist)))
(delete-frame (nth 1 elt))