core-popups: remove :noclone; just don't clone unreal buffers

This commit is contained in:
Henrik Lissner 2017-05-14 14:35:58 +02:00
parent 6f6680489a
commit 17409e174d

View file

@ -57,12 +57,9 @@ is enabled/disabled.'")
;; to fetch a modeline config. Set in `doom-popup-mode'.
;; :autokill If non-nil, the buffer in these popups will be killed
;; when their popup is closed. Used by
;; `doom*delete-popup-window'
;; `doom*delete-popup-window'. NOTE This will render
;; `doom/popup-restore' unusable for this buffer.
;; :autoclose If non-nil, close popup if ESC is pressed from any buffer.
;; :noclone If non-nil, don't try to clone the buffer. This helps with
;; buffers with buttons/links that, when followed, should
;; open within the popup, rather than outside of it. Like
;; help buffers or eshell-term buffers.
shackle-rules
'(("^ ?\\*doom:.+\\*$" :size 25 :modeline minimal :regexp t :noesc t)
("^ ?\\*doom .+\\*$" :size 10 :noselect t :regexp t)
@ -75,7 +72,7 @@ is enabled/disabled.'")
("*Apropos*" :size 0.3)
("*Backtrace*" :size 25 :noselect t)
("*Buffer List*" :size 20 :autokill t)
("*Help*" :size 16 :noclone t)
("*Help*" :size 16)
("*Messages*" :size 10 :noselect t)
("*Warnings*" :size 10 :noselect t :autokill t)
("*command-log*" :size 28 :noselect t :align right)
@ -197,9 +194,10 @@ and setting `doom-popup-rules' within it. Returns the window."
(shackle-match (window-buffer (car args))))
((bufferp (car args))
(shackle-match (car args))))))
(buffer (get-buffer (car args)))
window)
(when (and (not (plist-get plist :noclone))
(get-buffer-window-list (get-buffer (car args)) nil t))
(when (and (doom-real-buffer-p buffer)
(get-buffer-window-list buffer nil t))
(setq plist (append (list :autokill t) plist))
(setcar args (clone-indirect-buffer (buffer-name (car args)) nil t)))
(unless (setq window (apply orig-fn args))