[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Year calendar view
From: |
William Xu |
Subject: |
Re: Year calendar view |
Date: |
Fri, 08 Mar 2013 22:57:12 +0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.2 (darwin) |
Ivan Kanis <address@hidden> writes:
> It displays a year calendar and holiday faces. When displaying the
> current year, the cursor will be placed on the day. It doesn't
> handle any of the calendar input, such as motion.
I got this error when running on emacs 24.2.2:
Debugger entered--Lisp error: (void-variable calendar-month-header)
(list calendar-month-header)
(calendar-string-spread (list calendar-month-header) 32
calendar-month-digit-width)
(insert (calendar-string-spread (list calendar-month-header) 32
calendar-month-digit-width))
(let ((blank-days (mod (- (calendar-day-of-week (list month 1 year))
calendar-week-start-day) 7)) (last (calendar-last-day-of-month month year))
(trunc (min calendar-intermonth-spacing (1- calendar-left-margin))) (day 1)
(row 0) string) (calendar-move-to-column indent) (insert
(calendar-string-spread (list calendar-month-header) 32
calendar-month-digit-width)) (calendar-ensure-newline)
(calendar-insert-at-column indent calendar-intermonth-header trunc) (dotimes (i
7) (insert (progn (setq string (calendar-day-name (mod (+
calendar-week-start-day i) 7) nil t)) (if enable-multibyte-characters
(truncate-string-to-width string calendar-day-header-width) (substring string 0
calendar-day-header-width))) (make-string (- calendar-column-width
calendar-day-header-width) 32))) (calendar-ensure-newline)
(calendar-insert-at-column indent calendar-intermonth-text trunc) (insert
(make-string (* blank-days calendar-column-width) 32)) (dotimes (i last) (setq
day (1+ i)) (insert (format (format "%%%dd%%s" calendar-day-digit-width) day
(make-string (- calendar-column-width calendar-day-digit-width) 32)))
(set-text-properties (- (point) (1+ calendar-day-digit-width)) (1- (point)) (\`
(mouse-face highlight help-echo (\, (eval calendar-date-echo-text)) date t)))
(when (and (zerop (mod (+ day blank-days) 7)) (/= day last))
(calendar-ensure-newline) (setq row (1+ row)) (setq day (1+ day))
(calendar-insert-at-column indent calendar-intermonth-text trunc))) row)
caly-calendar-generate-month(1 2013 5)
(setq row (caly-calendar-generate-month month year (+ calendar-left-margin (*
calendar-month-width i))))
(while (< i --cl-dotimes-temp--) (setq row (caly-calendar-generate-month
month year (+ calendar-left-margin (* calendar-month-width i))))
(calendar-increment-month month year 1) (when (> (% (1+ i) 3) 0) (forward-line
(- (+ row 2))) (beginning-of-line)) (incf i))
(let ((--cl-dotimes-temp-- 3) (i 0)) (while (< i --cl-dotimes-temp--) (setq
row (caly-calendar-generate-month month year (+ calendar-left-margin (*
calendar-month-width i)))) (calendar-increment-month month year 1) (when (> (%
(1+ i) 3) 0) (forward-line (- (+ row 2))) (beginning-of-line)) (incf i)))
(catch (quote --cl-block-nil--) (let ((--cl-dotimes-temp-- 3) (i 0)) (while
(< i --cl-dotimes-temp--) (setq row (caly-calendar-generate-month month year (+
calendar-left-margin (* calendar-month-width i)))) (calendar-increment-month
month year 1) (when (> (% (1+ i) 3) 0) (forward-line (- (+ row 2)))
(beginning-of-line)) (incf i))))
(cl-block-wrapper (catch (quote --cl-block-nil--) (let ((--cl-dotimes-temp--
3) (i 0)) (while (< i --cl-dotimes-temp--) (setq row
(caly-calendar-generate-month month year (+ calendar-left-margin (*
calendar-month-width i)))) (calendar-increment-month month year 1) (when (> (%
(1+ i) 3) 0) (forward-line (- (+ row 2))) (beginning-of-line)) (incf i)))))
(block nil (let ((--cl-dotimes-temp-- 3) (i 0)) (while (< i
--cl-dotimes-temp--) (setq row (caly-calendar-generate-month month year (+
calendar-left-margin (* calendar-month-width i)))) (calendar-increment-month
month year 1) (when (> (% (1+ i) 3) 0) (forward-line (- (+ row 2)))
(beginning-of-line)) (incf i))))
(dotimes (i 3) (setq row (caly-calendar-generate-month month year (+
calendar-left-margin (* calendar-month-width i)))) (calendar-increment-month
month year 1) (when (> (% (1+ i) 3) 0) (forward-line (- (+ row 2)))
(beginning-of-line)))
(while --cl-dolist-temp-- (setq month (car --cl-dolist-temp--)) (dotimes (i
3) (setq row (caly-calendar-generate-month month year (+ calendar-left-margin
(* calendar-month-width i)))) (calendar-increment-month month year 1) (when (>
(% (1+ i) 3) 0) (forward-line (- (+ row 2))) (beginning-of-line))) (goto-char
(point-max)) (insert "\n\n") (add-to-list (quote mark) (point) t) (setq
--cl-dolist-temp-- (cdr --cl-dolist-temp--)))
(let ((--cl-dolist-temp-- (quote (1 4 7 10))) month) (while
--cl-dolist-temp-- (setq month (car --cl-dolist-temp--)) (dotimes (i 3) (setq
row (caly-calendar-generate-month month year (+ calendar-left-margin (*
calendar-month-width i)))) (calendar-increment-month month year 1) (when (> (%
(1+ i) 3) 0) (forward-line (- (+ row 2))) (beginning-of-line))) (goto-char
(point-max)) (insert "\n\n") (add-to-list (quote mark) (point) t) (setq
--cl-dolist-temp-- (cdr --cl-dolist-temp--))))
(catch (quote --cl-block-nil--) (let ((--cl-dolist-temp-- (quote (1 4 7 10)))
month) (while --cl-dolist-temp-- (setq month (car --cl-dolist-temp--)) (dotimes
(i 3) (setq row (caly-calendar-generate-month month year (+
calendar-left-margin (* calendar-month-width i)))) (calendar-increment-month
month year 1) (when (> (% (1+ i) 3) 0) (forward-line (- (+ row 2)))
(beginning-of-line))) (goto-char (point-max)) (insert "\n\n") (add-to-list
(quote mark) (point) t) (setq --cl-dolist-temp-- (cdr --cl-dolist-temp--)))))
(cl-block-wrapper (catch (quote --cl-block-nil--) (let ((--cl-dolist-temp--
(quote (1 4 7 10))) month) (while --cl-dolist-temp-- (setq month (car
--cl-dolist-temp--)) (dotimes (i 3) (setq row (caly-calendar-generate-month
month year (+ calendar-left-margin ...))) (calendar-increment-month month year
1) (when (> (% ... 3) 0) (forward-line (- ...)) (beginning-of-line)))
(goto-char (point-max)) (insert "\n\n") (add-to-list (quote mark) (point) t)
(setq --cl-dolist-temp-- (cdr --cl-dolist-temp--))))))
(block nil (let ((--cl-dolist-temp-- (quote (1 4 7 10))) month) (while
--cl-dolist-temp-- (setq month (car --cl-dolist-temp--)) (dotimes (i 3) (setq
row (caly-calendar-generate-month month year (+ calendar-left-margin (*
calendar-month-width i)))) (calendar-increment-month month year 1) (when (> (%
(1+ i) 3) 0) (forward-line (- (+ row 2))) (beginning-of-line))) (goto-char
(point-max)) (insert "\n\n") (add-to-list (quote mark) (point) t) (setq
--cl-dolist-temp-- (cdr --cl-dolist-temp--)))))
(dolist (month (quote (1 4 7 10))) (dotimes (i 3) (setq row
(caly-calendar-generate-month month year (+ calendar-left-margin (*
calendar-month-width i)))) (calendar-increment-month month year 1) (when (> (%
(1+ i) 3) 0) (forward-line (- (+ row 2))) (beginning-of-line))) (goto-char
(point-max)) (insert "\n\n") (add-to-list (quote mark) (point) t))
(let* ((today (calendar-current-date)) (today-month (nth 0 today)) (today-day
(nth 1 today)) (today-year (nth 2 today)) (orig-calendar-buffer
calendar-buffer) (mark (quote (1))) (count 0) row this-year year) (setq
this-year (string-to-number (read-from-minibuffer "Enter year to display: "
(int-to-string today-year))) year this-year) (when (get-buffer caly-buffer)
(kill-buffer caly-buffer)) (switch-to-buffer (get-buffer-create caly-buffer))
(dolist (month (quote (1 4 7 10))) (dotimes (i 3) (setq row
(caly-calendar-generate-month month year (+ calendar-left-margin (*
calendar-month-width i)))) (calendar-increment-month month year 1) (when (> (%
(1+ i) 3) 0) (forward-line (- (+ row 2))) (beginning-of-line))) (goto-char
(point-max)) (insert "\n\n") (add-to-list (quote mark) (point) t))
(caly-calendar-mode) (setq displayed-year this-year) (setq calendar-buffer
caly-buffer) (when calendar-mark-holidays-flag (dolist (month (quote (1 4 7
10))) (narrow-to-region (nth count mark) (nth (1+ count) mark)) (setq
displayed-month (1+ month)) (calendar-mark-holidays) (setq count (1+ count))))
(widen) (if (= today-year this-year) (progn (setq count (/ today-month 3))
(narrow-to-region (nth count mark) (nth (1+ count) mark)) (setq displayed-month
(+ (* (/ (- today-month 1) 3) 3) 2)) (calendar-cursor-to-visible-date today)
(widen)) (goto-char (point-min))) (setq calendar-buffer orig-calendar-buffer)
(other-window 1))
caly()
call-interactively(caly t nil)
execute-extended-command(nil)
call-interactively(execute-extended-command nil nil)
--
William
http://xwl.appspot.com
- Re: Year calendar view,
William Xu <=