I use to have diferent frames for diferent tasks... I'd like to get new private message windows open in the same frame that the rest of the ERC stuff, not in the current focused frame. I'm searching for a long time, and I can't find any way to get this... Any idea?
Does this work?
(defun my-major-mode-frame-p (mode frame) "Return non-nil if FRAME displays any buffer in major mode MODE." (catch 'window (walk-windows (lambda (w) (and (window-live-p w) (eq mode (buffer-local-value 'major-mode (window-buffer w))) (throw 'window w))) 'nomini frame))) ;; Always display ERC buffers in the same frame. (let ((ercframep (apply-partially #'my-major-mode-frame-p 'erc-mode))) (add-to-list 'display-buffer-alist (cons (lambda (buffer alist) (with-current-buffer buffer (derived-mode-p 'erc-mode))) (cons #'display-buffer-use-some-frame `((inhibit-switch-frame . nil) (inhibit-same-window . nil) (frame-predicate . ,ercframep))))))