Skip to content

after rendering a calendar, the cursor is somehow in the middle of the buffer #14

@pedro-nonfree

Description

@pedro-nonfree

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions