From: Jakub Czajka Date: Fri, 23 Dec 2022 16:38:05 +0000 (+0100) Subject: [emacs] Customize calender. X-Git-Url: https://git.ekhem.eu.org/?a=commitdiff_plain;h=a373238538403d02e256e6e94bf3ca20205f8c9f;p=guix.git [emacs] Customize calender. Caflw is an advanced calendar for emacs. --- diff --git a/conf/home/emacs.scm b/conf/home/emacs.scm index 4458f58..0b26c69 100644 --- a/conf/home/emacs.scm +++ b/conf/home/emacs.scm @@ -21,6 +21,14 @@ (dotfiles (list "emacs/.config/emacs/conf/conf-batch-edit.el"))))) +(define emacs-calfw-service + (service home-program-service-type + (home-program-configuration + (packages + (list emacs-calfw)) + (dotfiles + (list "emacs/.config/emacs/conf/conf-calendar.el"))))) + (define emacs-daemon-shepherd-service (shepherd-service (provision '(emacs)) @@ -59,6 +67,7 @@ (define emacs-services (list emacs-batch-edit-service + emacs-calfw-service emacs-daemon-service emacs-package-service emacs-service)) diff --git a/emacs/.config/emacs/conf/conf-calendar.el b/emacs/.config/emacs/conf/conf-calendar.el new file mode 100644 index 0000000..9dd20a4 --- /dev/null +++ b/emacs/.config/emacs/conf/conf-calendar.el @@ -0,0 +1,59 @@ +;; Copyright (c) 2022 Jakub Czajka +;; License: GPL-3.0 or later. +;; +;; conf-calendar.el - configuration for the calendar. + +(require 'conf-package) + +(use-package calfw + :requires + (conf-keys) + :ensure t + :bind + (:map cfw:calendar-mode-map + ("d" . cfw:navi-goto-date-command) + ("g" . cfw:refresh-calendar-buffer)) + :custom + (calendar-holidays holiday-christian-holidays) + :config + (transient-define-prefix conf:calfw-transient () + "Transient keymap with usefeul commands for `calfw'." + [["General" + ("t" "today" cfw:navi-goto-today-command) + ("d" "date" cfw:navi-goto-date-command) + ("g" "refresh" cfw:refresh-calendar-buffer)] + ["Day" + ("b" "previous" cfw:navi-previous-day-command) + ("f" "next" cfw:navi-next-day-command)] + ["Week" + ("p" "previous" cfw:navi-previous-week-command) + ("n" "next" cfw:navi-next-week-command) + ("^" "begin" cfw:navi-goto-week-begin-command) + ("$" "end" cfw:navi-goto-week-end-command)] + ["Month" + ("<" "previous" cfw:navi-previous-month-command) + (">" "next" cfw:navi-next-month-command) + ("[home]" "begin" cfw:navi-goto-first-date-command) + ("[end]" "end" cfw:navi-goto-last-date-command)] + ["View" + ("D" "day" cfw:change-view-day) + ("W" "one week" cfw:change-view-week) + ("T" "two weeks" cfw:change-view-two-weeks) + ("M" "month" cfw:change-view-month)]]) + (define-key cfw:calendar-mode-map "?" '("transient" . conf:calfw-transient))) + +(use-package calfw-org + :requires + (conf-org) + :ensure t + :bind + ("C-c k" . conf:open-calendar) + :config + (defun conf:open-calendar () + "Custom `calfw' calendar." + (interactive) + (require 'calfw) + (cfw:open-calendar-buffer + :contents-sources (list (cfw:org-create-source "Green"))))) + +(provide 'conf-calendar)