Function: cal-tex-cursor-filofax-daily

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

Signature

(cal-tex-cursor-filofax-daily &optional N EVENT)

Documentation

Day-per-page Filofax style calendar for week indicated by cursor.

Optional prefix argument N specifies number of weeks (default 1), starting on Mondays. The calendar shows holiday and diary entries if cal-tex-holidays and cal-tex-diary, respectively, are non-nil. Pages are ruled if cal-tex-rules is 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-daily (&optional n event)
  "Day-per-page Filofax style calendar for week indicated by cursor.
Optional prefix argument N specifies number of weeks (default 1),
starting on Mondays.  The calendar shows holiday and diary
entries if `cal-tex-holidays' and `cal-tex-diary', respectively,
are non-nil.  Pages are ruled if `cal-tex-rules' is 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
                 1
                 (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-shortday "rightday")
    (cal-tex-shortday "weekend")
    (insert cal-tex-lefthead)
    (cal-tex-shortday "leftday")
    (insert "\\newbox\\LineBox
\\setbox\\LineBox=\\hbox to\\textwidth{%
\\vrule height.2in width0pt\\leaders\\hrule\\hfill}
\\def\\linesfill{\\par\\leaders\\copy\\LineBox\\vfill}
")
    (cal-tex-b-document)
    (cal-tex-cmd "\\pagestyle" "empty")
    (dotimes (i n)
      (dotimes (j 4)
        (let ((even (evenp j)))
          (insert (if even
                      "\\righthead"
                    "\\lefthead"))
          (cal-tex-arg (calendar-date-string date))
          (insert "%\n")
          (insert (if even
                      "\\rightday"
                    "\\leftday")))
        (cal-tex-arg (cal-tex-latexify-list diary-list date))
        (cal-tex-arg (cal-tex-latexify-list holidays date "\\\\" t))
        (cal-tex-arg (eval cal-tex-daily-string t))
        (insert "%\n")
        (insert (if cal-tex-rules
                    "\\linesfill\n"
                  "\\vfill\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n"))
        (cal-tex-newpage)
        (setq date (cal-tex-incr-date date)))
      (insert "%\n")
      (dotimes (_jdummy 2)
        (insert "\\lefthead")
        (cal-tex-arg (calendar-date-string date))
        (insert "\\weekend")
        (cal-tex-arg (cal-tex-latexify-list diary-list date))
        (cal-tex-arg (cal-tex-latexify-list holidays date "\\\\" t))
        (cal-tex-arg (eval cal-tex-daily-string t))
        (insert "%\n")
        (insert (if cal-tex-rules
                    "\\linesfill\n"
                  "\\vfill"))
        (setq date (cal-tex-incr-date date)))
      (or cal-tex-rules
          (insert "\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n"))
      (unless (= i (1- n))
        (run-hooks 'cal-tex-week-hook)
        (cal-tex-newpage)))
    (cal-tex-end-document)
    (run-hooks 'cal-tex-hook)))