Function: cal-tex-cursor-month

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

Signature

(cal-tex-cursor-month &optional N EVENT)

Documentation

Make a LaTeX calendar buffer for the month the cursor is on.

Optional prefix argument N specifies number of months to be produced (default 1). The calendar is condensed onto one page. It 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-month (&optional n event)
  "Make a LaTeX calendar buffer for the month the cursor is on.
Optional prefix argument N specifies number of months to be
produced (default 1).  The calendar is condensed onto one page.
It 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))
  (let* ((date (calendar-cursor-to-date t event))
         (month (calendar-extract-month date))
         (year (calendar-extract-year date))
         (end-month month)
         (end-year year)
         ;; FIXME -landscape sets cal-tex-which-days?
         (d1 (calendar-absolute-from-gregorian (list month 1 year)))
         (d2 (progn
               (calendar-increment-month end-month end-year (1- n))
               (calendar-absolute-from-gregorian
                (list end-month
                      (calendar-last-day-of-month end-month end-year)
                      end-year))))
         (diary-list (if cal-tex-diary (cal-tex-list-diary-entries d1 d2)))
         (holidays (if cal-tex-holidays (holiday-in-range d1 d2))))
    (cal-tex-insert-preamble (cal-tex-number-weeks month year n))
    (if (> n 1)
        (cal-tex-cmd cal-tex-cal-multi-month)
      (cal-tex-cmd cal-tex-cal-one-month))
    (cal-tex-insert-month-header n month year end-month end-year)
    (cal-tex-insert-day-names)
    (cal-tex-nl ".2cm")
    (cal-tex-insert-blank-days month year cal-tex-day-prefix)
    (dotimes (_idummy n)
      (cal-tex-insert-days month year diary-list holidays cal-tex-day-prefix)
      (when (= (calendar-week-end-day)
               (calendar-day-of-week
                (list month
                      (calendar-last-day-of-month month year)
                      year))) ; last day of month was last day of week
        (cal-tex-hfill)
        (cal-tex-nl))
      (calendar-increment-month month year 1))
    (cal-tex-insert-blank-days-at-end end-month end-year cal-tex-day-prefix))
  (cal-tex-end-document)
  (run-hooks 'cal-tex-hook))