From 2ffad42466d4727f3bf1b598050fbdd675eef1ca Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 29 Jun 2018 22:23:44 +0200 Subject: [PATCH] Prevent persp-mode throwing an error on kill-emacs This would otherwise stop Emacs from quitting. --- modules/feature/workspaces/config.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/feature/workspaces/config.el b/modules/feature/workspaces/config.el index a168b57e0..5f5e9f005 100644 --- a/modules/feature/workspaces/config.el +++ b/modules/feature/workspaces/config.el @@ -144,6 +144,12 @@ Uses `+workspaces-main' to determine the name of the main workspace." counsel-projectile-switch-project-action #'+workspaces|switch-to-project) (add-hook 'projectile-after-switch-project-hook #'+workspaces|switch-to-project) + ;; In some scenarios, persp-mode throws error an error when Emacs tries to + ;; die, preventing its death. + (defun +workspaces*ignore-errors-on-kill-emacs (orig-fn) + (ignore-errors (funcall orig-fn))) + (advice-add #'persp-kill-emacs-h :around #'+workspaces*ignore-errors-on-kill-emacs) + ;; ;; eshell (persp-def-buffer-save/load