feat(calendar): use a different workspace name

The workspace name *calendar* is more consistent with other app
workspaces like *mu4e*, *notmuch*, *rss*, and *IRC*.
This commit is contained in:
Antonio Ruiz 2022-08-31 14:33:08 -04:00 committed by Henrik Lissner
parent 32baf538ee
commit 9d14d093c0

View file

@ -1,6 +1,8 @@
;;; app/calendar/autoload.el -*- lexical-binding: t; -*- ;;; app/calendar/autoload.el -*- lexical-binding: t; -*-
(defvar +calendar--wconf nil) (defvar +calendar--wconf nil)
(defvar +calendar-workspace-name "*calendar*"
"Name of the workspace created by `=calendar', dedicated to the calendar.")
(defun +calendar--init () (defun +calendar--init ()
(if-let (win (cl-find-if (lambda (b) (string-match-p "^\\*cfw:" (buffer-name b))) (if-let (win (cl-find-if (lambda (b) (string-match-p "^\\*cfw:" (buffer-name b)))
@ -15,7 +17,7 @@
(interactive) (interactive)
(if (modulep! :ui workspaces) (if (modulep! :ui workspaces)
(progn (progn
(+workspace-switch "Calendar" t) (+workspace-switch +calendar-workspace-name t)
(doom/switch-to-scratch-buffer) (doom/switch-to-scratch-buffer)
(+calendar--init) (+calendar--init)
(+workspace/display)) (+workspace/display))
@ -29,8 +31,8 @@
"TODO" "TODO"
(interactive) (interactive)
(if (modulep! :ui workspaces) (if (modulep! :ui workspaces)
(when (+workspace-exists-p "Calendar") (when (+workspace-exists-p +calendar-workspace-name)
(+workspace/delete "Calendar")) (+workspace/delete +calendar-workspace-name))
(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))