From 31a6fa77d0863e2f712adf7140c3238969adb758 Mon Sep 17 00:00:00 2001 From: Antonio Ruiz Date: Wed, 31 Aug 2022 14:35:59 -0400 Subject: [PATCH] feat(calendar): only initialize calfw if necessary If the *calendar* workspace is already populated with calfw buffers, there is no reason to re-initialize calfw. --- modules/app/calendar/autoload.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/app/calendar/autoload.el b/modules/app/calendar/autoload.el index 7cb61b9ad..314380171 100644 --- a/modules/app/calendar/autoload.el +++ b/modules/app/calendar/autoload.el @@ -18,8 +18,12 @@ (if (modulep! :ui workspaces) (progn (+workspace-switch +calendar-workspace-name t) - (doom/switch-to-scratch-buffer) - (+calendar--init) + (unless (memq (buffer-local-value 'major-mode + (window-buffer (selected-window))) + '(cfw:details-mode + cfw:calendar-mode)) + (doom/switch-to-scratch-buffer) + (+calendar--init)) (+workspace/display)) (setq +calendar--wconf (current-window-configuration)) (delete-other-windows)