calfw-blocks
calfw-blocks copied to clipboard
after rendering a calendar, the cursor is somehow in the middle of the buffer
After rendering a calendar, the cursor is somehow in the middle of the buffer (like 4-5 hours after the earlist-visible-time
This is the kind of calendar I am doing and how I am solving it with the advice function:
(defun my/cfw:open-calendar-agenda-weekly-view-agenda-plan ()
(interactive)
(let ((org-agenda-files '("~/org/agenda-plan.org"))
(org-agenda-skip-timestamp-if-done nil))
(cfw:open-calendar-buffer
:contents-sources
(list
(cfw:org-create-source))
:view 'block-week)))
(setq calfw-blocks-earliest-visible-time '(7 0))
(setq calfw-blocks-lines-per-hour 2)
(setq calfw-blocks-show-time-grid nil)
(defun my/cfw:beginning-of-buffer (&rest _)
(run-at-time 0.1 nil
(lambda ()
(beginning-of-buffer))))
(advice-add 'cfw:open-calendar-buffer :after 'my/cfw:beginning-of-buffer)