mirror of
https://github.com/jimeh/.emacs.d.git
synced 2026-02-19 13:46:41 +00:00
fix(workspaces): Don't restore magit buffers on startup
Persp-mode doesn't quite manage to restore magit buffers correctly, so I've opted to have it ignore any and all magit buffers when performing it's auto-save. It is possible to configure it to know how to save and load the magit-status buffer for example, but the snippet for it from persp-mode's readme doesn't fully restore the buffer as is. And magit has many different kinds of buffers, so I've simply opted for having all ignored.
This commit is contained in:
@@ -58,6 +58,9 @@
|
||||
(setq persp-auto-resume-time -1
|
||||
persp-auto-save-opt 0))
|
||||
|
||||
(defun siren-persp-mode-filter-magit-buffers (buf)
|
||||
(string-match "^magit.*:" (buffer-name buf)))
|
||||
|
||||
(defun siren-persp-mode-ibuffer (arg)
|
||||
(interactive "P")
|
||||
(with-persp-buffer-list () (ibuffer arg)))
|
||||
@@ -79,6 +82,9 @@
|
||||
(message "perspectives: %s" output)))
|
||||
|
||||
:config
|
||||
(add-to-list 'persp-common-buffer-filter-functions
|
||||
'siren-persp-mode-filter-magit-buffers)
|
||||
|
||||
(add-hook 'persp-activated-functions
|
||||
#'siren-persp-mode-show-current-perspective-name))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user