app/calendar: fix edge case with +calendar/quit

The user can open the calendar directly, with `M-x
cfw:open-calendar-buffer`, which sidesteps the workspace init logic in
=calendar. This fixes +calendar/quit so it can deal with this use case.

Mentioned in #4019
This commit is contained in:
Henrik Lissner 2021-03-06 00:07:12 -05:00
parent 7399138736
commit cf31d2605f

View file

@ -29,11 +29,12 @@
"TODO" "TODO"
(interactive) (interactive)
(if (featurep! :ui workspaces) (if (featurep! :ui workspaces)
(+workspace/delete "Calendar") (when (+workspace-exists-p "Calendar")
(doom-kill-matching-buffers "^\\*cfw:") (+workspace/delete "Calendar"))
(when (window-configuration-p +calendar--wconf) (when (window-configuration-p +calendar--wconf)
(set-window-configuration +calendar--wconf)) (set-window-configuration +calendar--wconf))
(setq +calendar--wconf nil))) (setq +calendar--wconf nil))
(doom-kill-matching-buffers "^\\*cfw[:-]"))
;;;###autoload ;;;###autoload
(defun +calendar/open-calendar () (defun +calendar/open-calendar ()