[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/emacs-24 r108135: Move function from cal-te
From: |
Glenn Morris |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/emacs-24 r108135: Move function from cal-tex to holidays |
Date: |
Fri, 02 Nov 2012 02:19:54 -0000 |
User-agent: |
Bazaar (2.5.0) |
------------------------------------------------------------
revno: 108135
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Sat 2012-05-05 13:58:14 -0700
message:
Move function from cal-tex to holidays
* calendar/holidays.el (holiday-in-range):
Move here from cal-tex-list-holidays.
* calendar/cal-tex.el (cal-tex-list-holidays):
Make it an obsolete alias for holiday-in-range. Update all callers.
modified:
lisp/ChangeLog
lisp/calendar/cal-tex.el
lisp/calendar/holidays.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2012-05-05 16:38:22 +0000
+++ b/lisp/ChangeLog 2012-05-05 20:58:14 +0000
@@ -1,3 +1,10 @@
+2012-05-05 Glenn Morris <address@hidden>
+
+ * calendar/holidays.el (holiday-in-range):
+ Move here from cal-tex-list-holidays.
+ * calendar/cal-tex.el (cal-tex-list-holidays):
+ Make it an obsolete alias for holiday-in-range. Update all callers.
+
2012-05-05 Chong Yidong <address@hidden>
* select.el (xselect--encode-string): Always use utf-8 for TEXT on
=== modified file 'lisp/calendar/cal-tex.el'
--- a/lisp/calendar/cal-tex.el 2012-04-16 19:18:36 +0000
+++ b/lisp/calendar/cal-tex.el 2012-05-05 20:58:14 +0000
@@ -237,31 +237,9 @@
"LaTeX code to insert one box with date info in calendar.
This definition is the heart of the calendar!")
-(autoload 'calendar-holiday-list "holidays")
+(autoload 'holiday-in-range "holidays")
-(defun cal-tex-list-holidays (d1 d2)
- "Generate a list of all holidays from absolute date D1 to D2."
- (let* ((start (calendar-gregorian-from-absolute d1))
- (displayed-month (calendar-extract-month start))
- (displayed-year (calendar-extract-year start))
- (end (calendar-gregorian-from-absolute d2))
- (end-month (calendar-extract-month end))
- (end-year (calendar-extract-year end))
- (number-of-intervals
- (1+ (/ (calendar-interval displayed-month displayed-year
- end-month end-year)
- 3)))
- holidays in-range a)
- (calendar-increment-month displayed-month displayed-year 1)
- (dotimes (_idummy number-of-intervals)
- (setq holidays (append holidays (calendar-holiday-list)))
- (calendar-increment-month displayed-month displayed-year 3))
- (dolist (hol holidays)
- (and (car hol)
- (setq a (calendar-absolute-from-gregorian (car hol)))
- (and (<= d1 a) (<= a d2))
- (setq in-range (append (list hol) in-range))))
- in-range))
+(define-obsolete-function-alias 'cal-tex-list-holidays 'holiday-in-range
"24.2")
(autoload 'diary-list-entries "diary-lib")
@@ -446,7 +424,7 @@
(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 (cal-tex-list-holidays d1 d2)))
+ (holidays (if cal-tex-holidays (holiday-in-range d1 d2)))
other-month other-year small-months-at-start)
(cal-tex-insert-preamble (cal-tex-number-weeks month year 1) t "12pt")
(cal-tex-cmd cal-tex-cal-one-month)
@@ -516,7 +494,7 @@
(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 (cal-tex-list-holidays d1 d2))))
+ (holidays (if cal-tex-holidays (holiday-in-range d1 d2))))
(cal-tex-insert-preamble (cal-tex-number-weeks month year n) nil "12pt")
(if (> n 1)
(cal-tex-cmd cal-tex-cal-multi-month)
@@ -697,7 +675,7 @@
(d1 (calendar-absolute-from-gregorian date))
(d2 (+ (* 7 n) d1))
(holidays (if cal-tex-holidays
- (cal-tex-list-holidays d1 d2))))
+ (holiday-in-range d1 d2))))
(cal-tex-preamble "11pt")
(cal-tex-cmd "\\textwidth 6.5in")
(cal-tex-cmd "\\textheight 10.5in")
@@ -752,7 +730,7 @@
(d1 (calendar-absolute-from-gregorian date))
(d2 (+ (* 7 n) d1))
(holidays (if cal-tex-holidays
- (cal-tex-list-holidays d1 d2))))
+ (holiday-in-range d1 d2))))
(cal-tex-preamble "12pt")
(cal-tex-cmd "\\textwidth 6.5in")
(cal-tex-cmd "\\textheight 10.5in")
@@ -836,7 +814,7 @@
(d1 (calendar-absolute-from-gregorian date))
(d2 (+ (* 7 n) d1))
(holidays (if cal-tex-holidays
- (cal-tex-list-holidays d1 d2)))
+ (holiday-in-range d1 d2)))
(diary-list (if cal-tex-diary
(cal-tex-list-diary-entries
;; FIXME d1?
@@ -1052,7 +1030,7 @@
(d1 (calendar-absolute-from-gregorian date))
(d2 (+ (* 7 n) d1))
(holidays (if cal-tex-holidays
- (cal-tex-list-holidays d1 d2)))
+ (holiday-in-range d1 d2)))
(diary-list (if cal-tex-diary
(cal-tex-list-diary-entries
;; FIXME d1?
@@ -1149,7 +1127,7 @@
(d1 (calendar-absolute-from-gregorian date))
(d2 (+ (* 7 n) d1))
(holidays (if cal-tex-holidays
- (cal-tex-list-holidays d1 d2)))
+ (holiday-in-range d1 d2)))
(diary-list (if cal-tex-diary
(cal-tex-list-diary-entries
;; FIXME d1?
@@ -1292,7 +1270,7 @@
(d1 (calendar-absolute-from-gregorian date))
(d2 (+ (* 7 n) d1))
(holidays (if cal-tex-holidays
- (cal-tex-list-holidays d1 d2)))
+ (holiday-in-range d1 d2)))
(diary-list (if cal-tex-diary
(cal-tex-list-diary-entries
;; FIXME d1?
=== modified file 'lisp/calendar/holidays.el'
--- a/lisp/calendar/holidays.el 2012-04-09 07:11:39 +0000
+++ b/lisp/calendar/holidays.el 2012-05-05 20:58:14 +0000
@@ -645,6 +645,33 @@
(define-obsolete-function-alias
'check-calendar-holidays 'calendar-check-holidays "23.1")
+
+;; Formerly cal-tex-list-holidays.
+(defun holiday-in-range (d1 d2)
+ "Generate a list of all holidays in range from absolute date D1 to D2."
+ (let* ((start (calendar-gregorian-from-absolute d1))
+ (displayed-month (calendar-extract-month start))
+ (displayed-year (calendar-extract-year start))
+ (end (calendar-gregorian-from-absolute d2))
+ (end-month (calendar-extract-month end))
+ (end-year (calendar-extract-year end))
+ (number-of-intervals
+ (1+ (/ (calendar-interval displayed-month displayed-year
+ end-month end-year)
+ 3)))
+ holidays in-range a)
+ (calendar-increment-month displayed-month displayed-year 1)
+ (dotimes (_idummy number-of-intervals)
+ (setq holidays (append holidays (calendar-holiday-list)))
+ (calendar-increment-month displayed-month displayed-year 3))
+ (dolist (hol holidays)
+ (and (car hol)
+ (setq a (calendar-absolute-from-gregorian (car hol)))
+ (and (<= d1 a) (<= a d2))
+ (setq in-range (append (list hol) in-range))))
+ in-range))
+
+
(declare-function x-popup-menu "menu.c" (position menu))
;;;###cal-autoload
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/emacs-24 r108135: Move function from cal-tex to holidays,
Glenn Morris <=