Emacs calendar: show more than 3 months?

前端 未结 4 990
青春惊慌失措
青春惊慌失措 2021-02-14 09:46

In Emacs, when you display the calendar with M-x calendar, you get a three-month display – last month, this month, and next month – in a new window that\'s just 8 l

4条回答
  •  面向向阳花
    2021-02-14 10:36

    There doesn't seem to be an easy way to do this. I was able to knock up the following code, which will show all twelve months, in a row, in a separate frame.

    (require 'cl)
    (require 'calendar)
    
    (defun twelve-month-calendar ()
      (interactive)
      (let ((calendar-buffer (get-buffer-create "12-month calendar"))
            (month 12)
            (year 2012))
        (set-buffer calendar-buffer)
        (setq calendar-frame (make-frame))
        (make-variable-buffer-local 'font-lock-face)
        (set-face-attribute 'default calendar-frame :height 70)
        (set-frame-width calendar-frame 300)
        (erase-buffer)
        (dotimes (i 12)
          (calendar-generate-month month year 0)
          (calendar-increment-month month year -1))
        (calendar-mode)))
    

    You might need to tweak it a bit, depending on your screen/font size.

提交回复
热议问题