aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2012-08-21 15:18:56 -0400
committerGlenn Morris2012-08-21 15:18:56 -0400
commit79aba01279160e9c1dea4a4f0b74ef6b2cb9f025 (patch)
tree13f685efebfd91bb8bfc3fbda8ba12b800c5eae1
parentb7fa26919ec7a5d17022cdf21afbab01ca769db5 (diff)
downloademacs-79aba01279160e9c1dea4a4f0b74ef6b2cb9f025.tar.gz
emacs-79aba01279160e9c1dea4a4f0b74ef6b2cb9f025.zip
Revert accidental deletion from previous change
-rw-r--r--lisp/calendar/cal-tex.el155
1 files changed, 154 insertions, 1 deletions
diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el
index b5c92a3b0e8..5891693282f 100644
--- a/lisp/calendar/cal-tex.el
+++ b/lisp/calendar/cal-tex.el
@@ -1215,6 +1215,78 @@ position to use instead of point."
1215 (cal-tex-weekly-common n event)) 1215 (cal-tex-weekly-common n event))
1216 1216
1217;;;###cal-autoload 1217;;;###cal-autoload
1218(defun cal-tex-cursor-filofax-2week (&optional n event)
1219 "Two-weeks-at-a-glance Filofax style calendar for week cursor is in.
1220Optional prefix argument N specifies number of weeks (default 1).
1221The calendar shows holiday and diary entries if
1222`cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil.
1223Optional EVENT indicates a buffer position to use instead of point."
1224 (interactive (list (prefix-numeric-value current-prefix-arg)
1225 last-nonmenu-event))
1226 (or n (setq n 1))
1227 (let* ((date (calendar-gregorian-from-absolute
1228 (calendar-dayname-on-or-before
1229 calendar-week-start-day
1230 (calendar-absolute-from-gregorian
1231 (calendar-cursor-to-date t event)))))
1232 (month (calendar-extract-month date))
1233 (year (calendar-extract-year date))
1234 (day (calendar-extract-day date))
1235 (d1 (calendar-absolute-from-gregorian date))
1236 (d2 (+ (* 7 n) d1))
1237 (holidays (if cal-tex-holidays
1238 (holiday-in-range d1 d2)))
1239 (diary-list (if cal-tex-diary
1240 (cal-tex-list-diary-entries d1 d2))))
1241 (cal-tex-preamble "twoside")
1242 (cal-tex-filofax-paper)
1243 (insert cal-tex-righthead)
1244 (cal-tex-rightday "0.7in")
1245 (insert cal-tex-lefthead)
1246 (cal-tex-leftday "0.7in")
1247 (cal-tex-b-document)
1248 (cal-tex-cmd "\\pagestyle" "empty")
1249 (dotimes (i n)
1250 (if (zerop (mod i 2))
1251 (insert "\\righthead")
1252 (insert "\\lefthead"))
1253 (cal-tex-arg
1254 (let ((d (cal-tex-incr-date date 6)))
1255 (if (= (calendar-extract-month date)
1256 (calendar-extract-month d))
1257 (format "%s %s"
1258 (cal-tex-month-name (calendar-extract-month date))
1259 (calendar-extract-year date))
1260 (if (= (calendar-extract-year date)
1261 (calendar-extract-year d))
1262 (format "%s---%s %s"
1263 (cal-tex-month-name (calendar-extract-month date))
1264 (cal-tex-month-name (calendar-extract-month d))
1265 (calendar-extract-year date))
1266 (format "%s %s---%s %s"
1267 (cal-tex-month-name (calendar-extract-month date))
1268 (calendar-extract-year date)
1269 (cal-tex-month-name (calendar-extract-month d))
1270 (calendar-extract-year d))))))
1271 (insert "%\n")
1272 (dotimes (_jdummy 7)
1273 (if (zerop (mod i 2))
1274 (insert "\\rightday")
1275 (insert "\\leftday"))
1276 (cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date)))
1277 (cal-tex-arg (number-to-string (calendar-extract-day date)))
1278 (cal-tex-arg (cal-tex-latexify-list diary-list date))
1279 (cal-tex-arg (cal-tex-latexify-list holidays date))
1280 (cal-tex-arg (eval cal-tex-daily-string))
1281 (insert "%\n")
1282 (setq date (cal-tex-incr-date date)))
1283 (unless (= i (1- n))
1284 (run-hooks 'cal-tex-week-hook)
1285 (cal-tex-newpage)))
1286 (cal-tex-end-document)
1287 (run-hooks 'cal-tex-hook)))
1288
1289;;;###cal-autoload
1218(defun cal-tex-cursor-filofax-week (&optional n event) 1290(defun cal-tex-cursor-filofax-week (&optional n event)
1219 "One-week-at-a-glance Filofax style calendar for week indicated by cursor. 1291 "One-week-at-a-glance Filofax style calendar for week indicated by cursor.
1220Optional prefix argument N specifies number of weeks (default 1), 1292Optional prefix argument N specifies number of weeks (default 1),
@@ -1223,7 +1295,88 @@ if `cal-tex-holidays' and `cal-tex-diary', respectively, are non-nil.
1223Optional EVENT indicates a buffer position to use instead of point." 1295Optional EVENT indicates a buffer position to use instead of point."
1224 (interactive (list (prefix-numeric-value current-prefix-arg) 1296 (interactive (list (prefix-numeric-value current-prefix-arg)
1225 last-nonmenu-event)) 1297 last-nonmenu-event))
1226 (cal-tex-weekly-common n event t)) 1298 (cal-tex-weekly-common n event t))
1299
1300;;;###cal-autoload
1301(defun cal-tex-cursor-filofax-daily (&optional n event)
1302 "Day-per-page Filofax style calendar for week indicated by cursor.
1303Optional prefix argument N specifies number of weeks (default 1),
1304starting on Mondays. The calendar shows holiday and diary
1305entries if `cal-tex-holidays' and `cal-tex-diary', respectively,
1306are non-nil. Pages are ruled if `cal-tex-rules' is non-nil.
1307Optional EVENT indicates a buffer position to use instead of point."
1308 (interactive (list (prefix-numeric-value current-prefix-arg)
1309 last-nonmenu-event))
1310 (or n (setq n 1))
1311 (let* ((date (calendar-gregorian-from-absolute
1312 (calendar-dayname-on-or-before
1313 1
1314 (calendar-absolute-from-gregorian
1315 (calendar-cursor-to-date t event)))))
1316 (month (calendar-extract-month date))
1317 (year (calendar-extract-year date))
1318 (day (calendar-extract-day date))
1319 (d1 (calendar-absolute-from-gregorian date))
1320 (d2 (+ (* 7 n) d1))
1321 (holidays (if cal-tex-holidays
1322 (holiday-in-range d1 d2)))
1323 (diary-list (if cal-tex-diary
1324 (cal-tex-list-diary-entries d1 d2))))
1325 (cal-tex-preamble "twoside")
1326 (cal-tex-filofax-paper)
1327 (insert cal-tex-righthead)
1328 (cal-tex-shortday "rightday")
1329 (cal-tex-shortday "weekend")
1330 (insert cal-tex-lefthead)
1331 (cal-tex-shortday "leftday")
1332 (insert "\\newbox\\LineBox
1333\\setbox\\LineBox=\\hbox to\\textwidth{%
1334\\vrule height.2in width0pt\\leaders\\hrule\\hfill}
1335\\def\\linesfill{\\par\\leaders\\copy\\LineBox\\vfill}
1336")
1337 (cal-tex-b-document)
1338 (cal-tex-cmd "\\pagestyle" "empty")
1339 (dotimes (i n)
1340 (dotimes (j 4)
1341 (let ((even (zerop (% j 2))))
1342 (insert (if even
1343 "\\righthead"
1344 "\\lefthead"))
1345 (cal-tex-arg (calendar-date-string date))
1346 (insert "%\n")
1347 (insert (if even
1348 "\\rightday"
1349 "\\leftday")))
1350 (cal-tex-arg (cal-tex-latexify-list diary-list date))
1351 (cal-tex-arg (cal-tex-latexify-list holidays date "\\\\" t))
1352 (cal-tex-arg (eval cal-tex-daily-string))
1353 (insert "%\n")
1354 (if cal-tex-rules
1355 (insert "\\linesfill\n")
1356 (insert "\\vfill\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n"))
1357 (cal-tex-newpage)
1358 (setq date (cal-tex-incr-date date)))
1359 (insert "%\n")
1360 (dotimes (_jdummy 2)
1361 (insert "\\lefthead")
1362 (cal-tex-arg (calendar-date-string date))
1363 (insert "\\weekend")
1364 (cal-tex-arg (cal-tex-latexify-list diary-list date))
1365 (cal-tex-arg (cal-tex-latexify-list holidays date "\\\\" t))
1366 (cal-tex-arg (eval cal-tex-daily-string))
1367 (insert "%\n")
1368 (if cal-tex-rules
1369 (insert "\\linesfill\n")
1370 (insert "\\vfill"))
1371 (setq date (cal-tex-incr-date date)))
1372 (or cal-tex-rules
1373 (insert "\\noindent\\rule{\\textwidth}{0.3pt}\\\\%\n"))
1374 (unless (= i (1- n))
1375 (run-hooks 'cal-tex-week-hook)
1376 (cal-tex-newpage)))
1377 (cal-tex-end-document)
1378 (run-hooks 'cal-tex-hook)))
1379
1227 1380
1228;;; 1381;;;
1229;;; Daily calendars 1382;;; Daily calendars