Fix: (ement-view-room) Use existing room buffer

This commit is contained in:
Adam Porter 2021-08-01 01:06:04 -05:00
parent 9bc7712540
commit 91618dacae

View file

@ -222,11 +222,15 @@ Calls `pop-to-buffer-same-window'. Interactively, with prefix,
call `pop-to-buffer'." call `pop-to-buffer'."
(interactive (list (car ement-sessions) (interactive (list (car ement-sessions)
(ement-complete-room (car ement-sessions)))) (ement-complete-room (car ement-sessions))))
;; FIXME: There must be a better way to handle this. (pcase-let* (((cl-struct ement-room (local (map buffer))) room))
(funcall (if current-prefix-arg (unless (buffer-live-p buffer)
#'pop-to-buffer #'pop-to-buffer-same-window) (setf (alist-get 'buffer (ement-room-local room))
(ement-room--buffer session room (ement--room-buffer-name room))) (ement-room--buffer session room (ement--room-buffer-name room))
(goto-char (point-max))) buffer (alist-get 'buffer (ement-room-local room))))
;; FIXME: There must be a better way to handle this.
(funcall (if current-prefix-arg
#'pop-to-buffer #'pop-to-buffer-same-window)
buffer)))
(cl-defun ement-upload (session &key data filename then else (cl-defun ement-upload (session &key data filename then else
(content-type "application/octet-stream")) (content-type "application/octet-stream"))