aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2012-08-20 23:35:48 -0700
committerGlenn Morris2012-08-20 23:35:48 -0700
commit1cebb5c0e43f3d279d4050ecfd00e885de015f4d (patch)
treed3ca035197f1f92fc1df8dac8f4c706483e6d03c
parent6d470bddb081435461b67f039b5c9960e23bea8e (diff)
downloademacs-1cebb5c0e43f3d279d4050ecfd00e885de015f4d.tar.gz
emacs-1cebb5c0e43f3d279d4050ecfd00e885de015f4d.zip
Improve cal-tex-cmd usage
* lisp/calendar/cal-tex.el (cal-tex-cursor-filofax-year) (cal-tex-cursor-week, cal-tex-cursor-week2) (cal-tex-cursor-week-iso, cal-tex-cursor-week-at-a-glance) (cal-tex-cursor-filofax-2week, cal-tex-cursor-filofax-week) (cal-tex-cursor-filofax-daily, cal-tex-cursor-day) (cal-tex-insert-preamble, cal-tex-b-document) (cal-tex-e-document, cal-tex-b-center, cal-tex-e-center): Improve cal-tex-cmd usage.
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/calendar/cal-tex.el55
2 files changed, 37 insertions, 27 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5f98620084c..6c158945705 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,14 @@
12012-08-21 Glenn Morris <rgm@gnu.org> 12012-08-21 Glenn Morris <rgm@gnu.org>
2 2
3 * calendar/cal-tex.el (cal-tex-cursor-filofax-year)
4 (cal-tex-cursor-week, cal-tex-cursor-week2)
5 (cal-tex-cursor-week-iso, cal-tex-cursor-week-at-a-glance)
6 (cal-tex-cursor-filofax-2week, cal-tex-cursor-filofax-week)
7 (cal-tex-cursor-filofax-daily, cal-tex-cursor-day)
8 (cal-tex-insert-preamble, cal-tex-b-document)
9 (cal-tex-e-document, cal-tex-b-center, cal-tex-e-center):
10 Improve cal-tex-cmd usage.
11
3 * calendar/cal-tex.el (cal-tex-filofax-paper): New function. 12 * calendar/cal-tex.el (cal-tex-filofax-paper): New function.
4 (cal-tex-cursor-filofax-year, cal-tex-cursor-filofax-2week) 13 (cal-tex-cursor-filofax-year, cal-tex-cursor-filofax-2week)
5 (cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily): Use it. 14 (cal-tex-cursor-filofax-week, cal-tex-cursor-filofax-daily): Use it.
diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el
index fc813040537..b0facb07d4e 100644
--- a/lisp/calendar/cal-tex.el
+++ b/lisp/calendar/cal-tex.el
@@ -375,9 +375,9 @@ Optional EVENT indicates a buffer position to use instead of point."
375 (cal-tex-preamble "twoside") 375 (cal-tex-preamble "twoside")
376 (cal-tex-filofax-paper 'year) 376 (cal-tex-filofax-paper 'year)
377 (cal-tex-cmd "\\fboxsep 0.5mm") 377 (cal-tex-cmd "\\fboxsep 0.5mm")
378 (cal-tex-cmd "\\pagestyle{empty}") 378 (cal-tex-cmd "\\pagestyle" "empty")
379 (cal-tex-b-document) 379 (cal-tex-b-document)
380 (cal-tex-cmd "\\vspace*{0.25in}") 380 (cal-tex-cmd "\\vspace*" "0.25in")
381 (dotimes (j n) 381 (dotimes (j n)
382 (insert (format "\\hfil \\textbf{\\Large %s} \\hfil\\\\\n" year)) 382 (insert (format "\\hfil \\textbf{\\Large %s} \\hfil\\\\\n" year))
383 (cal-tex-b-center) 383 (cal-tex-b-center)
@@ -405,7 +405,7 @@ Optional EVENT indicates a buffer position to use instead of point."
405 (if (= j (1- n)) 405 (if (= j (1- n))
406 (cal-tex-end-document) 406 (cal-tex-end-document)
407 (cal-tex-newpage) 407 (cal-tex-newpage)
408 (cal-tex-cmd "\\vspace*{0.25in}")) 408 (cal-tex-cmd "\\vspace*" "0.25in"))
409 (run-hooks 'cal-tex-year-hook)) 409 (run-hooks 'cal-tex-year-hook))
410 (run-hooks 'cal-tex-hook))) 410 (run-hooks 'cal-tex-hook)))
411 411
@@ -703,7 +703,7 @@ entries are not shown). The calendar shows the hours 8-12am, 1-5pm."
703 (cal-tex-weekly-paper) 703 (cal-tex-weekly-paper)
704 (insert cal-tex-LaTeX-hourbox) 704 (insert cal-tex-LaTeX-hourbox)
705 (cal-tex-b-document) 705 (cal-tex-b-document)
706 (cal-tex-cmd "\\pagestyle{empty}") 706 (cal-tex-cmd "\\pagestyle" "empty")
707 (dotimes (i n) 707 (dotimes (i n)
708 (cal-tex-vspace "-1.5in") 708 (cal-tex-vspace "-1.5in")
709 (cal-tex-b-center) 709 (cal-tex-b-center)
@@ -755,7 +755,7 @@ Optional EVENT indicates a buffer position to use instead of point."
755 (cal-tex-weekly-paper) 755 (cal-tex-weekly-paper)
756 (insert cal-tex-LaTeX-hourbox) 756 (insert cal-tex-LaTeX-hourbox)
757 (cal-tex-b-document) 757 (cal-tex-b-document)
758 (cal-tex-cmd "\\pagestyle{empty}") 758 (cal-tex-cmd "\\pagestyle" "empty")
759 (dotimes (i n) 759 (dotimes (i n)
760 (cal-tex-vspace "-1.5in") 760 (cal-tex-vspace "-1.5in")
761 (cal-tex-b-center) 761 (cal-tex-b-center)
@@ -838,7 +838,7 @@ position to use instead of point."
838 (cal-tex-preamble "11pt") 838 (cal-tex-preamble "11pt")
839 (cal-tex-weekly-paper) 839 (cal-tex-weekly-paper)
840 (cal-tex-b-document) 840 (cal-tex-b-document)
841 (cal-tex-cmd "\\pagestyle{empty}") 841 (cal-tex-cmd "\\pagestyle" "empty")
842 (dotimes (i n) 842 (dotimes (i n)
843 (cal-tex-vspace "-1.5in") 843 (cal-tex-vspace "-1.5in")
844 (cal-tex-b-center) 844 (cal-tex-b-center)
@@ -1043,14 +1043,15 @@ position to use instead of point."
1043 (diary-list (if cal-tex-diary 1043 (diary-list (if cal-tex-diary
1044 (cal-tex-list-diary-entries d1 d2)))) 1044 (cal-tex-list-diary-entries d1 d2))))
1045 (cal-tex-preamble "twoside,12pt") 1045 (cal-tex-preamble "twoside,12pt")
1046 (cal-tex-cmd "\\textwidth 7in") 1046 (insert "\\textwidth 7in
1047 (cal-tex-cmd "\\textheight 10.5in") 1047\\textheight 10.5in
1048 (cal-tex-cmd "\\oddsidemargin 0in") 1048\\oddsidemargin 0in
1049 (cal-tex-cmd "\\evensidemargin 0in") 1049\\evensidemargin 0in
1050 (cal-tex-cmd "\\topmargin 0pt") 1050\\topmargin 0pt
1051 (cal-tex-cmd "\\headheight -0.875in") 1051\\headheight -0.875in
1052 (cal-tex-cmd "\\headsep 0.125in") 1052\\headsep 0.125in
1053 (cal-tex-cmd "\\footskip .125in") 1053\\footskip .125in
1054")
1054 (insert "\\def\\righthead#1{\\hfill {\\normalsize \\bf #1}\\\\[-6pt]} 1055 (insert "\\def\\righthead#1{\\hfill {\\normalsize \\bf #1}\\\\[-6pt]}
1055\\long\\def\\rightday#1#2#3#4#5{% 1056\\long\\def\\rightday#1#2#3#4#5{%
1056 \\rule{\\textwidth}{0.3pt}\\\\% 1057 \\rule{\\textwidth}{0.3pt}\\\\%
@@ -1079,7 +1080,7 @@ position to use instead of point."
1079 \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} 1080 \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\}
1080") 1081")
1081 (cal-tex-b-document) 1082 (cal-tex-b-document)
1082 (cal-tex-cmd "\\pagestyle{empty}\\ ") 1083 (cal-tex-cmd "\\pagestyle" "empty")
1083 (dotimes (i n) 1084 (dotimes (i n)
1084 (insert "\\lefthead") 1085 (insert "\\lefthead")
1085 (cal-tex-arg 1086 (cal-tex-arg
@@ -1224,7 +1225,7 @@ Optional EVENT indicates a buffer position to use instead of point."
1224 \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} 1225 \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\}
1225") 1226")
1226 (cal-tex-b-document) 1227 (cal-tex-b-document)
1227 (cal-tex-cmd "\\pagestyle{empty}") 1228 (cal-tex-cmd "\\pagestyle" "empty")
1228 (dotimes (i n) 1229 (dotimes (i n)
1229 (if (zerop (mod i 2)) 1230 (if (zerop (mod i 2))
1230 (insert "\\righthead") 1231 (insert "\\righthead")
@@ -1319,7 +1320,7 @@ Optional EVENT indicates a buffer position to use instead of point."
1319 \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\} 1320 \\hbox to \\textwidth{\\vbox to 0pt {\\noindent \\footnotesize #3}}}}\\\\}
1320") 1321")
1321 (cal-tex-b-document) 1322 (cal-tex-b-document)
1322 (cal-tex-cmd "\\pagestyle{empty}\\ ") 1323 (cal-tex-cmd "\\pagestyle" "empty")
1323 (dotimes (i n) 1324 (dotimes (i n)
1324 (insert "\\lefthead") 1325 (insert "\\lefthead")
1325 (cal-tex-arg 1326 (cal-tex-arg
@@ -1455,7 +1456,7 @@ Optional EVENT indicates a buffer position to use instead of point."
1455\\def\\linesfill{\\par\\leaders\\copy\\LineBox\\vfill} 1456\\def\\linesfill{\\par\\leaders\\copy\\LineBox\\vfill}
1456") 1457")
1457 (cal-tex-b-document) 1458 (cal-tex-b-document)
1458 (cal-tex-cmd "\\pagestyle{empty}") 1459 (cal-tex-cmd "\\pagestyle" "empty")
1459 (dotimes (i n) 1460 (dotimes (i n)
1460 (dotimes (j 4) 1461 (dotimes (j 4)
1461 (let ((even (zerop (% j 2)))) 1462 (let ((even (zerop (% j 2))))
@@ -1517,7 +1518,7 @@ a buffer position to use instead of point."
1517 (cal-tex-preamble "12pt") 1518 (cal-tex-preamble "12pt")
1518 (cal-tex-weekly-paper 'nomargins) 1519 (cal-tex-weekly-paper 'nomargins)
1519 (cal-tex-b-document) 1520 (cal-tex-b-document)
1520 (cal-tex-cmd "\\pagestyle{empty}") 1521 (cal-tex-cmd "\\pagestyle" "empty")
1521 (dotimes (i n) 1522 (dotimes (i n)
1522 (cal-tex-vspace "-1.7in") 1523 (cal-tex-vspace "-1.7in")
1523 (cal-tex-daily-page (calendar-gregorian-from-absolute date)) 1524 (cal-tex-daily-page (calendar-gregorian-from-absolute date))
@@ -1736,16 +1737,16 @@ non-nil, means add to end of buffer without erasing current contents."
1736 (if (not landscape) 1737 (if (not landscape)
1737 (progn 1738 (progn
1738 (cal-tex-cmd "\\oddsidemargin -1.75cm") 1739 (cal-tex-cmd "\\oddsidemargin -1.75cm")
1739 (cal-tex-cmd "\\def\\holidaymult{.06}")) 1740 (cal-tex-cmd "\\def\\holidaymult" ".06"))
1740 (cal-tex-cmd "\\special{landscape}") 1741 (cal-tex-cmd "\\special" "landscape")
1741 (cal-tex-cmd "\\textwidth 9.5in") 1742 (cal-tex-cmd "\\textwidth 9.5in")
1742 (cal-tex-cmd "\\textheight 7in") 1743 (cal-tex-cmd "\\textheight 7in")
1743 (cal-tex-comment) 1744 (cal-tex-comment)
1744 (cal-tex-cmd "\\def\\holidaymult{.08}")) 1745 (cal-tex-cmd "\\def\\holidaymult" ".08"))
1745 (cal-tex-cmd cal-tex-caldate) 1746 (cal-tex-cmd cal-tex-caldate)
1746 (cal-tex-cmd cal-tex-myday) 1747 (cal-tex-cmd cal-tex-myday)
1747 (cal-tex-b-document) 1748 (cal-tex-b-document)
1748 (cal-tex-cmd "\\pagestyle{empty}")) 1749 (cal-tex-cmd "\\pagestyle" "empty"))
1749 (cal-tex-cmd "\\setlength{\\cellwidth}" width) 1750 (cal-tex-cmd "\\setlength{\\cellwidth}" width)
1750 (insert (format "\\setlength{\\cellwidth}{%f\\cellwidth}\n" 1751 (insert (format "\\setlength{\\cellwidth}{%f\\cellwidth}\n"
1751 (/ 1.1 (length cal-tex-which-days)))) 1752 (/ 1.1 (length cal-tex-which-days))))
@@ -1853,20 +1854,20 @@ Add trailing COMMENT if present."
1853 1854
1854(defun cal-tex-b-document () 1855(defun cal-tex-b-document ()
1855 "Insert beginning of document." 1856 "Insert beginning of document."
1856 (cal-tex-cmd "\\begin{document}")) 1857 (cal-tex-cmd "\\begin" "document"))
1857 1858
1858(defun cal-tex-e-document () 1859(defun cal-tex-e-document ()
1859 "Insert end of document." 1860 "Insert end of document."
1860 (cal-tex-cmd "\\end{document}")) 1861 (cal-tex-cmd "\\end" "document"))
1861 1862
1862(defun cal-tex-b-center () 1863(defun cal-tex-b-center ()
1863 "Insert beginning of centered block." 1864 "Insert beginning of centered block."
1864 (cal-tex-cmd "\\begin{center}")) 1865 (cal-tex-cmd "\\begin" "center"))
1865 1866
1866(defun cal-tex-e-center () 1867(defun cal-tex-e-center ()
1867 "Insert end of centered block." 1868 "Insert end of centered block."
1868 (cal-tex-comment) 1869 (cal-tex-comment)
1869 (cal-tex-cmd "\\end{center}")) 1870 (cal-tex-cmd "\\end" "center"))
1870 1871
1871 1872
1872;;; 1873;;;