core-popups: clone buffer if visible elsewhere

Allows us to modify the buffer in the pop up window indepdently from the
rest.
This commit is contained in:
Henrik Lissner 2017-05-12 12:11:40 +02:00
parent 29d01756ea
commit ed6941e8ae
3 changed files with 8 additions and 4 deletions

View file

@ -192,7 +192,11 @@ and setting `doom-popup-rules' within it. Returns the window."
(shackle-match (window-buffer (car args))))
((bufferp (car args))
(shackle-match (car args))))))
(window (apply orig-fn args)))
window)
(when (get-buffer-window-list (car args) nil t)
(setq plist (append (list :autokill t) plist))
(setcar args (clone-indirect-buffer (buffer-name (car args)) nil t)))
(setq window (apply orig-fn args))
(unless window
(error "No popup window was found for %s: %s" (car args) plist))
(with-selected-window window