Function: cal-tex-cursor-filofax-2week

cal-tex-cursor-filofax-2week is an autoloaded, interactive and byte-compiled function defined in cal-tex.el.gz.

Signature

(cal-tex-cursor-filofax-2week &optional N EVENT)

Documentation

Two-weeks-at-a-glance Filofax style calendar for week cursor is in.

Optional prefix argument N specifies number of weeks (default 1). The calendar shows holiday and diary entries if cal-tex-holidays and cal-tex-diary, respectively, are non-nil. Optional EVENT indicates a buffer position to use instead of point.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/cal-tex.el.gz
;;;###cal-autoload
(defun cal-tex-cursor-filofax-2week (&optional n event)
  "Two-weeks-at-a-glance Filofax style calendar for week cursor is in.
Optional prefix argument N specifies number of weeks (default 1).
The calendar shows holiday and diary entries if
`cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil.
Optional EVENT indicates a buffer position to use instead of point."
  (interactive (list (prefix-numeric-value current-prefix-arg)
                     last-nonmenu-event))
  (or n (setq n 1))
  (with-suppressed-warnings ((lexical date))
    (defvar date))                      ;For `cal-tex-daily-string'.
  (let* ((date (calendar-gregorian-from-absolute
                (calendar-dayname-on-or-before
                 calendar-week-start-day
                 (calendar-absolute-from-gregorian
                  (calendar-cursor-to-date t event)))))
         ;; (month (calendar-extract-month date))
         ;; (year (calendar-extract-year date))
         ;; (day (calendar-extract-day date))
         (d1 (calendar-absolute-from-gregorian date))
         (d2 (+ (* 7 n) d1))
         (holidays (if cal-tex-holidays
                       (holiday-in-range d1 d2)))
         (diary-list (if cal-tex-diary
                         (cal-tex-list-diary-entries d1 d2))))
    (cal-tex-preamble "twoside")
    (cal-tex-filofax-paper)
    (insert cal-tex-righthead)
    (cal-tex-longday "rightday" "0.7in")
    (insert cal-tex-lefthead)
    (cal-tex-longday "leftday" "0.7in")
    (cal-tex-b-document)
    (cal-tex-cmd "\\pagestyle" "empty")
    (dotimes (i n)
      (if (zerop (mod i 2))
          (insert "\\righthead")
        (insert "\\lefthead"))
      (cal-tex-arg
       (let ((d (cal-tex-incr-date date 6)))
         (if (= (calendar-extract-month date)
                (calendar-extract-month d))
             (format "%s %s"
                     (cal-tex-month-name (calendar-extract-month date))
                     (calendar-extract-year date))
           (if (= (calendar-extract-year date)
                  (calendar-extract-year d))
               (format "%s---%s %s"
                       (cal-tex-month-name (calendar-extract-month date))
                       (cal-tex-month-name (calendar-extract-month d))
                       (calendar-extract-year date))
              (format "%s %s---%s %s"
                      (cal-tex-month-name (calendar-extract-month date))
                      (calendar-extract-year date)
                      (cal-tex-month-name (calendar-extract-month d))
                      (calendar-extract-year d))))))
      (insert "%\n")
      (dotimes (_jdummy 7)
        (if (zerop (mod i 2))
            (insert "\\rightday")
          (insert "\\leftday"))
        (cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date)))
        (cal-tex-arg (number-to-string (calendar-extract-day date)))
        (cal-tex-arg (cal-tex-latexify-list diary-list date))
        (cal-tex-arg (cal-tex-latexify-list holidays date))
        (cal-tex-arg (eval cal-tex-daily-string t))
        (insert "%\n")
        (setq date (cal-tex-incr-date date)))
      (unless (= i (1- n))
        (run-hooks 'cal-tex-week-hook)
        (cal-tex-newpage)))
    (cal-tex-end-document)
    (run-hooks 'cal-tex-hook)))