Update FSF's address.
[bpt/emacs.git] / lisp / calendar / cal-tex.el
index 6ee9102..638fb23 100644 (file)
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to
-;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
 ;;; Commentary:
 
-;; This collection of functions implements the features of calendar.el that
-;; deal with printing the calendar.
-
-;;; TO DO
-;;;
-;;;     (*)  Add holidays and diary entries to daily calendar.
-;;;
-;;;     (*)  Add diary entries to weekly calendar functions.
-;;;
-;;;     (*)  Make calendar styles for A4 paper.
-;;;
-;;;     (*)  Make daily and monthly styles Filofax paper.
-;;;
-;;;     (*)  Improve the LaTeX command that produces the boxes in the monthly
-;;;          calendar to eliminate slight gap--what causes it?!
+;; This collection of functions implements the creation of LaTeX calendars
+;; based on the user's holiday choices and diary file.
+
+;; TO DO
+;;
+;;     (*)  Add holidays and diary entries to daily calendar.
+;;
+;;     (*)  Add diary entries to weekly calendar functions.
+;;
+;;     (*)  Make calendar styles for A4 paper.
+;;
+;;     (*)  Make daily and monthly styles Filofax paper.
+;;
+;;     (*)  Improve the LaTeX command that produces the boxes in the monthly
+;;          calendar to eliminate slight gap--what causes it?!
 
 ;;; Code:
 
 (require 'calendar)
 
-(autoload 'list-diary-entries "diary" nil t)
+(autoload 'list-diary-entries "diary-lib" nil t)
 (autoload 'calendar-holiday-list "holidays" nil t)
 (autoload 'calendar-iso-from-absolute "cal-iso" nil t)
 
-
-(defun cal-tex-version ()
-  (interactive)
-  (message "Version 1, October 11, 1995"))
-
 ;;;
 ;;; Customizable variables 
 ;;;
@@ -252,7 +248,7 @@ Optional prefix argument specifies number of years."
 
 (defun cal-tex-cursor-year-landscape (&optional arg)
   "Make a buffer with LaTeX commands for the year cursor is on.
-Optional prefix argument specifies numeber of years."
+Optional prefix argument specifies number of years."
   (interactive "P")
   (cal-tex-year (extract-calendar-year (calendar-cursor-to-date t))
                 (if arg arg 1)
@@ -597,7 +593,8 @@ this is only an upper bound."
 ;;;
 
 (defun cal-tex-cursor-week (&optional arg)
-  "One page calendar for week indicated by cursor.
+  "Make a buffer with LaTeX commands for a two-page one-week calendar.
+It applies to the week that point is in.
 Optional prefix argument specifies number of weeks.
 Holidays are included if `cal-tex-holidays' is t."
   (interactive "P")
@@ -647,8 +644,8 @@ Holidays are included if `cal-tex-holidays' is t."
     (run-hooks 'cal-tex-hook)))
 
 (defun cal-tex-cursor-week2 (&optional arg)
-  "Make a buffer with LaTeX commands for the week cursor is on.
-The printed output will be on two pages.
+  "Make a buffer with LaTeX commands for a two-page one-week calendar.
+It applies to the week that point is in.
 Optional prefix argument specifies number of weeks.
 Holidays are included if `cal-tex-holidays' is t."
   (interactive "P")
@@ -726,10 +723,10 @@ Holidays are included if `cal-tex-holidays' is t."
     (cal-tex-end-document)
     (run-hooks 'cal-tex-hook)))
 
-(defun cal-tex-cursor-week3 (&optional arg)
-  "One page ISO style calendar for the ISO week indicated by cursor.
+(defun cal-tex-cursor-week-iso (&optional arg)
+  "Make a buffer with LaTeX commands for a one page ISO-style weekly calendar.
 Optional prefix argument specifies number of weeks.
-Diary entries are included if cal-tex-diary is t.
+Diary entries are included if `cal-tex-diary' is t.
 Holidays are included if `cal-tex-holidays' is t."
   (interactive "P")
   (let* ((n (if arg arg 1))
@@ -857,10 +854,11 @@ Holidays are included if `cal-tex-holidays' is t."
      (cal-tex-arg height)
      (cal-tex-nl))))
 
-(defun cal-tex-cursor-week4 (&optional arg)
-  "One page calendar for week indicated by cursor.
-Week begins on Monday.
-Optional prefix argument specifies number of weeks."
+(defun cal-tex-cursor-week-monday (&optional arg)
+  "Make a buffer with LaTeX commands for a two-page one-week calendar.
+It applies to the week that point is in, and starts on Monday.
+Optional prefix argument specifies number of weeks.
+Holidays are included if `cal-tex-holidays' is t."
   (interactive "P")
   (let* ((n (if arg arg 1))
          (date (calendar-gregorian-from-absolute
@@ -888,13 +886,13 @@ Optional prefix argument specifies number of weeks."
        (if (/= i n)
            (progn
              (run-hooks 'cal-tex-week-hook)
-            (setq date date7)
+            (setq date (cal-tex-incr-date date 7))
              (cal-tex-newpage))))
     (cal-tex-end-document)
     (run-hooks 'cal-tex-hook)))
 
 (defun cal-tex-weekly4-box (date weekend)
-  "make one box for DATE, different if WEEKEND"
+  "Make one box for DATE, different if WEEKEND."
   (let* (
        (day (extract-calendar-day date))
        (month (extract-calendar-month date))
@@ -908,8 +906,7 @@ Optional prefix argument specifies number of weeks."
        )
     (cal-tex-b-framebox "8cm" "l")
     (cal-tex-b-parbox "b" "7.5cm")
-    (insert (format "{\\Large\\bf %s,} %s/%s/%s\\\\\n" 
-                   dayname month day year))
+    (insert (format "{\\Large\\bf %s,} %s/%s/%s\\\\\n" dayname month day year))
     (cal-tex-rule "0pt" "7.5cm" ".5mm")
     (cal-tex-nl)
     (if (not weekend)
@@ -932,10 +929,10 @@ Optional prefix argument specifies number of weeks."
      (cal-tex-e-framebox)
      (cal-tex-hspace "1cm")))
 
-(defun cal-tex-cursor-week5 (&optional arg)
+(defun cal-tex-cursor-filofax-2week (&optional arg)
   "Two-weeks-at-a-glance Filofax style calendar for week indicated by cursor.
 Optional prefix argument specifies number of weeks.
-Diary entries are included if cal-tex-diary is t.
+Diary entries are included if `cal-tex-diary' is t.
 Holidays are included if `cal-tex-holidays' is t."
   (interactive "P")
   (let* ((n (if arg arg 1))
@@ -1033,11 +1030,11 @@ Holidays are included if `cal-tex-holidays' is t."
     (cal-tex-end-document)
     (run-hooks 'cal-tex-hook)))
 
-(defun cal-tex-cursor-week6 (&optional arg)
+(defun cal-tex-cursor-filofax-week (&optional arg)
   "One-week-at-a-glance Filofax style calendar for week indicated by cursor.
 Optional prefix argument specifies number of weeks.
 Weeks start on Monday. 
-Diary entries are included if cal-tex-diary is t.
+Diary entries are included if `cal-tex-diary' is t.
 Holidays are included if `cal-tex-holidays' is t."
   (interactive "P")
   (let* ((n (if arg arg 1))