Commit c2bef985 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(talk-disconnect): Make it interactive.

(talk-add-display): Ignore dead buffers and deleted frames.
parent 19deb21e
......@@ -43,17 +43,19 @@ Each element has the form (DISPLAY FRAME BUFFER).")
(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)))))
(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)
(cons (list display frame buffer) (delq elt talk-display-alist)))))
(defun talk-disconnect ()
"Disconnect this display from the Emacs talk group."
(let* ((mydisp (cdr (assq 'display (frame-parameters (selected-frame)))))
(elt (assoc mydisp talk-display-alist)))
(delete-frame (nth 1 elt))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment