mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
ui/workspaces: don't persist TRAMP buffers
They're too slow to restore.
This commit is contained in:
@ -195,10 +195,15 @@ stored in `persp-save-dir'.")
|
|||||||
(defun +workspaces-delete-all-posframes-h (&rest _)
|
(defun +workspaces-delete-all-posframes-h (&rest _)
|
||||||
(posframe-delete-all))))
|
(posframe-delete-all))))
|
||||||
|
|
||||||
;; Fix #1525: Ignore dead buffers in PERSP's buffer list
|
|
||||||
(defun +workspaces-dead-buffer-p (buf)
|
(add-hook! 'persp-filter-save-buffers-functions
|
||||||
(not (buffer-live-p buf)))
|
(defun +workspaces-dead-buffer-p (buf)
|
||||||
(add-hook 'persp-filter-save-buffers-functions #'+workspaces-dead-buffer-p)
|
;; Fix #1525: Ignore dead buffers in PERSP's buffer list
|
||||||
|
(not (buffer-live-p buf)))
|
||||||
|
(defun +workspaces-remote-buffer-p (buf)
|
||||||
|
;; And don't save TRAMP buffers; they're super slow to restore
|
||||||
|
(let ((dir (buffer-local-value 'default-directory buf)))
|
||||||
|
(ignore-errors (file-remote-p dir)))))
|
||||||
|
|
||||||
;; Otherwise, buffers opened via bookmarks aren't treated as "real" and are
|
;; Otherwise, buffers opened via bookmarks aren't treated as "real" and are
|
||||||
;; excluded from the buffer list.
|
;; excluded from the buffer list.
|
||||||
|
Reference in New Issue
Block a user