mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-05 12:37:33 -05:00
Fix save-buffer prompt occurring after buffer is buried
This commit is contained in:
@ -554,15 +554,18 @@ windows, switch to `doom-fallback-buffer'. Otherwise, delegate to original
|
|||||||
((eq buf (doom-fallback-buffer))
|
((eq buf (doom-fallback-buffer))
|
||||||
(message "Can't kill the fallback buffer."))
|
(message "Can't kill the fallback buffer."))
|
||||||
((doom-real-buffer-p buf)
|
((doom-real-buffer-p buf)
|
||||||
(when (or ;; if there aren't more real buffers than visible buffers,
|
(if (and (buffer-modified-p buf)
|
||||||
;; then there are no real, non-visible buffers left.
|
(not (y-or-n-p "Buffer %s is modified; kill anyway?")))
|
||||||
(not (cl-set-difference (doom-real-buffer-list)
|
(message "Aborted")
|
||||||
(doom-visible-buffers)))
|
(when (or ;; if there aren't more real buffers than visible buffers,
|
||||||
;; if we end up back where we start (or previous-buffer
|
;; then there are no real, non-visible buffers left.
|
||||||
;; returns nil), we have nowhere left to go
|
(not (cl-set-difference (doom-real-buffer-list)
|
||||||
(memq (previous-buffer) (list buf 'nil)))
|
(doom-visible-buffers)))
|
||||||
(switch-to-buffer (doom-fallback-buffer)))
|
;; if we end up back where we start (or previous-buffer
|
||||||
(kill-buffer buf))
|
;; returns nil), we have nowhere left to go
|
||||||
|
(memq (previous-buffer) (list buf 'nil)))
|
||||||
|
(switch-to-buffer (doom-fallback-buffer)))
|
||||||
|
(kill-buffer buf)))
|
||||||
(t
|
(t
|
||||||
(funcall orig-fn)))))
|
(funcall orig-fn)))))
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user