app/calendar: minor refactor; rename +calendar-open-calendar-function

This commit is contained in:
Henrik Lissner 2018-02-19 20:19:54 -05:00
parent 52c24197ba
commit d6cba4253f
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 6 additions and 4 deletions

View file

@ -7,9 +7,11 @@
(unless (featurep! :feature workspaces) (unless (featurep! :feature workspaces)
(user-error ":feature workspaces is required, but disabled")) (user-error ":feature workspaces is required, but disabled"))
(+workspace-switch "Calendar" t) (+workspace-switch "Calendar" t)
(if-let* ((buf (cl-find-if (lambda (it) (string-match-p "^\\*cfw" (buffer-name (window-buffer it)))) (if-let* ((win (cl-loop for win in (doom-visible-windows)
(doom-visible-windows)))) if (string-match-p "^\\*cfw" (buffer-name (window-buffer it)))
(select-window (get-buffer-window buf)) (call-interactively +calendar-open-calendar-function)) return win)))
(select-window win)
(call-interactively +calendar-open-function))
(+workspace/display)) (+workspace/display))
;;;###autoload ;;;###autoload

View file

@ -4,7 +4,7 @@
(expand-file-name "private/org/secret.el" doom-modules-dir) (expand-file-name "private/org/secret.el" doom-modules-dir)
"TODO") "TODO")
(defvar +calendar-open-calendar-function #'+calendar/open-calendar (defvar +calendar-open-function #'+calendar/open-calendar
"TODO") "TODO")