Some syncs from Emacs CVS. As you can see.... I have a ways to go. :-)
I plan to commit in the next day or so.
Jeff
ChangeLog addition:
2006-08-02 Jeff Miller <jeff.miller(a)xemacs.org>
2002-04-04 Richard M. Stallman <rms(a)gnu.org>
* calendar/solar.el (solar-northern-spring-or-summer-season): Doc fix.
2002-04-03 Edward M. Reingold <reingold(a)emr.cs.iit.edu>
* solar.el (solar-spring-or-summer-season): Delete.
(solar-northern-spring-or-summer-season): New variable.
(solar-sunrise-and-sunset, solar-moment, solar-sunrise-sunset):
Rewrite.
* solar.el (diary-sabbath-candles-minutes): New variable.
(diary-sabbath-candles): Use it instead of fixed 18 minutes.
* calendar.el (update-calendar-mode-line): Force mode-line update.
Make date under the cursor available as `date' in
calendar-mode-line-format.
Eval items in calendar-mode-line-format list.
* cal-tex.el (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook)
(cal-tex-week-hook, cal-tex-daily-hook): Add doc strings.
* cal-tex.el (cal-tex-latexify-list): Fix doc string.
* cal-tex.el (cal-tex-insert-day-names): LaTeXify day names.
(cal-tex-cursor-week-iso, cal-tex-week-hours, cal-tex-weekly4-box)
(cal-tex-cursor-filofax-2week, cal-tex-cursor-filofax-week)
(cal-tex-daily-page, cal-tex-mini-calendar): LaTeXify day names.
* cal-tex.el: Change all instances (interactive "P") to
(interactive "p").
(cal-tex-cursor-month): Add hfill and newline at end of month that
ended on Saturday.
(cal-tex-preamble): Change to LaTeX2e.
(cal-tex-cursor-filofax-year): Don't use default month names in
LaTeX macros in case user changes them.
(cal-tex-month-name): New function. Used throughout in case user
has done something funny with month names.
* cal-hebrew.el (holiday-rosh-hashanah-etc): Spelling correction.
(diary-rosh-hodesh): Spelling correction.
2002-03-03 Thien-Thi Nguyen <ttn(a)gnu.org>
* calendar/diary-lib.el (list-diary-entries): Use `buffer-substring'
instead of `buffer-substring-no-properties' to support enriched mode.
2002-02-08 Eli Zaretskii <eliz(a)is.elta.co.il>
* calendar/cal-menu.el (calendar-mode-map): Change the menu item's
name to "Insert Diary Entry".
* updated "Diary" menu entries to match Emacs
2002-01-28 Eli Zaretskii <eliz(a)is.elta.co.il>
* calendar/calendar.el (generate-calendar-month): Doc fix.
2002-01-24 Richard M. Stallman <rms(a)gnu.org>
* calendar/calendar.el (generate-calendar-month): Doc fix.
2002-01-03 Richard M. Stallman <rms(a)gnu.org>
* calendar/diary-lib.el (diary-block): Doc fix.
2001-11-26 Pavel Jan,Am(Bk <Pavel(a)Janik.cz>
* calendar/appt.el (appt-disp-window): Use insert instead of
insert-string.
* calendar/diary-lib.el (list-diary-entries): Likewise.
calendar source patch:
Diff command: cvs -q diff -uN
Files affected: solar.el diary-lib.el calendar.el cal-xemacs.el cal-tex.el cal-hebrew.el appt.el
Index: appt.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/calendar/appt.el,v
retrieving revision 1.10
diff -u -b -w -u -r1.10 appt.el
--- appt.el 2006/07/31 02:15:22 1.10
+++ appt.el 2006/08/03 02:32:19
@@ -683,7 +683,7 @@
(concat "-------------------- Appointment in "
min-to-app " minutes. " new-time " %-"))
(erase-buffer)
- (insert-string appt-msg)
+ (insert appt-msg)
(shrink-window-if-larger-than-buffer (get-buffer-window appt-disp-buf t))
(set-buffer-modified-p nil)
(raise-frame (selected-frame))
Index: cal-hebrew.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/calendar/cal-hebrew.el,v
retrieving revision 1.4
diff -u -b -w -u -r1.4 cal-hebrew.el
--- cal-hebrew.el 2006/07/31 02:15:22 1.4
+++ cal-hebrew.el 2006/08/03 02:32:19
@@ -347,7 +347,7 @@
(list (calendar-gregorian-from-absolute (+ abs-r-h 19))
"Hol Hamoed Sukkot (fourth day)")
(list (calendar-gregorian-from-absolute (+ abs-r-h 20))
- "Hoshannah Rabbah")))
+ "Hoshanah Rabbah")))
(output-list
(filter-visible-calendar-holidays mandatory)))
(if all-hebrew-calendar-holidays
@@ -979,9 +979,9 @@
(if (= h-yesterday 30)
(format "%s (second day)" this-month)
this-month)))
- (if (= (% d 7) 6);; Saturday--check for Shabbat Mevarhim
+ (if (= (% d 7) 6);; Saturday--check for Shabbat Mevarchim
(cond ((and (> h-day 22) (/= h-month 6) (= 29 last-day))
- (format "Mevarhim Rosh Hodesh %s (%s)"
+ (format "Mevarchim Rosh Hodesh %s (%s)"
(aref h-month-names
(if (= h-month
(hebrew-calendar-last-month-of-year
@@ -989,7 +989,7 @@
0 h-month))
(aref calendar-day-name-array (- 29 h-day))))
((and (< h-day 30) (> h-day 22) (= 30 last-day))
- (format "Mevarhim Rosh Hodesh %s (%s-%s)"
+ (format "Mevarchim Rosh Hodesh %s (%s-%s)"
(aref h-month-names h-month)
(if (= h-day 29)
"tomorrow"
Index: cal-tex.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/calendar/cal-tex.el,v
retrieving revision 1.4
diff -u -b -w -u -r1.4 cal-tex.el
--- cal-tex.el 2006/07/31 02:15:23 1.4
+++ cal-tex.el 2006/08/03 02:32:19
@@ -121,6 +121,35 @@
:type 'integer
:group 'calendar-tex)
+(defcustom cal-tex-hook nil
+ "*List of functions called after any LaTeX calendar buffer is generated.
+You can use this to do postprocessing on the buffer. For example, to change
+characters with diacritical marks to their LaTeX equivalents, use
+ (add-hook 'cal-tex-hook
+ '(lambda () (iso-iso2tex (point-min) (point-max))))"
+:type 'hook
+:group 'calendar-tex)
+
+(defcustom cal-tex-year-hook nil
+ "*List of functions called after a LaTeX year calendar buffer is generated."
+:type 'hook
+:group 'calendar-tex)
+
+(defcustom cal-tex-month-hook nil
+ "*List of functions called after a LaTeX month calendar buffer is generated."
+:type 'hook
+:group 'calendar-tex)
+
+(defcustom cal-tex-week-hook nil
+ "*List of functions called after a LaTeX week calendar buffer is generated."
+:type 'hook
+:group 'calendar-tex)
+
+(defcustom cal-tex-daily-hook nil
+ "*List of functions called after a LaTeX daily calendar buffer is generated."
+:type 'hook
+:group 'calendar-tex)
+
;;;
;;; Definitions for LaTeX code
;;;
@@ -221,7 +250,7 @@
Optional ARGS are included."
(set-buffer (get-buffer-create cal-tex-buffer))
(erase-buffer)
- (insert "\\documentstyle")
+ (insert "\\documentclass")
(if args
(insert "[" args "]"))
(insert "{article}\n"
@@ -255,14 +284,14 @@
(defun cal-tex-cursor-year (&optional arg)
"Make a buffer with LaTeX commands for the year cursor is on.
Optional prefix argument specifies number of years."
- (interactive "P")
+ (interactive "p")
(cal-tex-year (extract-calendar-year (calendar-cursor-to-date t))
(if arg arg 1)))
(defun cal-tex-cursor-year-landscape (&optional arg)
"Make a buffer with LaTeX commands for the year cursor is on.
Optional prefix argument specifies number of years."
- (interactive "P")
+ (interactive "p")
(cal-tex-year (extract-calendar-year (calendar-cursor-to-date t))
(if arg arg 1)
t))
@@ -306,7 +335,7 @@
(defun cal-tex-cursor-filofax-year (&optional arg)
"Make a Filofax one page yearly calendar of year indicated by cursor.
Optional parameter specifies number of years."
- (interactive "P")
+ (interactive "p")
(let* ((n (if arg arg 1))
(year (extract-calendar-year (calendar-cursor-to-date t))))
(cal-tex-preamble "twoside")
@@ -327,10 +356,13 @@
(insert "\n")
(cal-tex-noindent)
(cal-tex-nl)
+ (let ((month-names; don't use default in case user changed it
+ ["January" "February" "March" "April" "May" "June"
+ "July" "August" "September" "October" "November" "December"]))
(calendar-for-loop i from 1 to 12 do
(insert (cal-tex-mini-calendar i year
- (calendar-month-name i)
- "1in" ".9in" "tiny" "0.6mm")))
+ (aref month-names (1- i))
+ "1in" ".9in" "tiny" "0.6mm"))))
(insert
"\\noindent\\fbox{\\January}\\fbox{\\February}\\fbox{\\March}\\\\
\\noindent\\fbox{\\April}\\fbox{\\May}\\fbox{\\June}\\\\
@@ -355,7 +387,7 @@
"Make a buffer with LaTeX commands for the month cursor is on.
Optional prefix argument specifies number of months to be produced.
The output is in landscape format, one month to a page."
- (interactive "P")
+ (interactive "p")
(let* ((n (if arg arg 1))
(date (calendar-cursor-to-date t))
(month (extract-calendar-month date))
@@ -416,7 +448,8 @@
year)))
7)))
(insert "\\vspace*{-\\cellwidth}\\hspace*{-2\\cellwidth}"
- "\\lastmonth\\nextmonth"))
+ "\\lastmonth\\nextmonth%
+ "))
(if (/= i n)
(progn
(run-hooks 'cal-tex-month-hook)
@@ -432,7 +465,7 @@
"Make a buffer with LaTeX commands for the month cursor is on.
Optional prefix argument specifies number of months to be produced.
Calendar is condensed onto one page."
- (interactive "P")
+ (interactive "p")
(let* ((date (calendar-cursor-to-date t))
(month (extract-calendar-month date))
(year (extract-calendar-year date))
@@ -472,6 +505,15 @@
(setq other-year year)
(cal-tex-insert-days month year diary-list holidays
cal-tex-day-prefix)
+ (if (= (mod (calendar-absolute-from-gregorian
+ (list month
+ (calendar-last-day-of-month month year)
+ year))
+ 7)
+ 6); last day of month was Saturday
+ (progn
+ (cal-tex-hfill)
+ (cal-tex-nl)))
(increment-calendar-month month year 1))
(cal-tex-insert-blank-days-at-end end-month end-year cal-tex-day-prefix)
(cal-tex-end-document)))
@@ -493,7 +535,7 @@
(setq date (list month i year))
(if (memq (calendar-day-of-week date) cal-tex-which-days)
(progn
- (insert (format day-format (calendar-month-name month) i))
+ (insert (format day-format (cal-tex-month-name month) i))
(cal-tex-arg (cal-tex-latexify-list diary-list date))
(cal-tex-arg (cal-tex-latexify-list holidays date))
(cal-tex-arg (eval cal-tex-daily-string))
@@ -510,16 +552,17 @@
(calendar-for-loop i from 0 to 6 do
(if (memq i cal-tex-which-days)
(insert (format cal-tex-day-name-format
+ (cal-tex-LaTeXify-string
(aref calendar-day-name-array
- (mod (+ calendar-week-start-day i) 7)))))
+ (mod (+ calendar-week-start-day i) 7))))))
(cal-tex-comment)))
(defun cal-tex-insert-month-header (n month year end-month end-year)
"Create a title for a calendar.
A title is inserted for a calendar with N months starting with
MONTH YEAR and ending with END-MONTH END-YEAR."
- (let ((month-name (calendar-month-name month))
- (end-month-name (calendar-month-name end-month)))
+ (let ((month-name (cal-tex-month-name month))
+ (end-month-name (cal-tex-month-name end-month)))
(if (= 1 n)
(insert (format "\\calmonth{%s}{%s}\n\\vspace*{-0.5cm}"
month-name year) )
@@ -613,7 +656,7 @@
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")
+ (interactive "p")
(let* ((n (if arg arg 1))
(date (calendar-gregorian-from-absolute
(calendar-dayname-on-or-before
@@ -639,7 +682,7 @@
(cal-tex-vspace "-1.5in")
(cal-tex-b-center)
(cal-tex-Huge-bf (format "\\uppercase{%s}"
- (calendar-month-name month)))
+ (cal-tex-month-name month)))
(cal-tex-hspace "2em")
(cal-tex-Huge-bf (number-to-string year))
(cal-tex-nl ".5cm")
@@ -664,7 +707,7 @@
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")
+ (interactive "p")
(let* ((n (if arg arg 1))
(date (calendar-gregorian-from-absolute
(calendar-dayname-on-or-before
@@ -691,7 +734,7 @@
(cal-tex-vspace "-1.5in")
(cal-tex-b-center)
(cal-tex-Huge-bf (format "\\uppercase{%s}"
- (calendar-month-name month)))
+ (cal-tex-month-name month)))
(cal-tex-hspace "2em")
(cal-tex-Huge-bf (number-to-string year))
(cal-tex-nl ".5cm")
@@ -744,7 +787,7 @@
Optional prefix argument specifies number of weeks.
Diary entries are included if `cal-tex-diary' is t.
Holidays are included if `cal-tex-holidays' is t."
- (interactive "P")
+ (interactive "p")
(let* ((n (if arg arg 1))
(date (calendar-gregorian-from-absolute
(calendar-dayname-on-or-before
@@ -790,9 +833,9 @@
(cal-tex-rule "0pt" "\\textwidth" ".2mm")
(cal-tex-nl)
(cal-tex-b-parbox "t" "\\textwidth")
- (cal-tex-large-bf (calendar-day-name date))
+ (cal-tex-large-bf (cal-tex-LaTeXify-string (calendar-day-name date)))
(insert ", ")
- (cal-tex-large-bf (calendar-month-name month))
+ (cal-tex-large-bf (cal-tex-month-name month))
(insert " ")
(cal-tex-large-bf (number-to-string day))
(if (not (string= "" (cal-tex-latexify-list holidays date)))
@@ -844,9 +887,9 @@
(cal-tex-cmd "\\ \\\\[-.2cm]")
(cal-tex-cmd "\\noindent")
(cal-tex-b-parbox "l" "6.8in")
- (cal-tex-large-bf (calendar-day-name date))
+ (cal-tex-large-bf (cal-tex-LaTeXify-string (calendar-day-name date)))
(insert ", ")
- (cal-tex-large-bf (calendar-month-name month))
+ (cal-tex-large-bf (cal-tex-month-name month))
(insert " ")
(cal-tex-large-bf (number-to-string day))
(if (not (string= "" (cal-tex-latexify-list holidays date)))
@@ -875,7 +918,7 @@
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")
+ (interactive "p")
(let* ((n (if arg arg 1))
(date (calendar-gregorian-from-absolute
(calendar-dayname-on-or-before
@@ -913,12 +956,12 @@
(day (extract-calendar-day date))
(month (extract-calendar-month date))
(year (extract-calendar-year date))
- (dayname (calendar-day-name date))
+ (dayname (cal-tex-LaTeXify-string (calendar-day-name date)))
(date1 (cal-tex-incr-date date))
(day1 (extract-calendar-day date1))
(month1 (extract-calendar-month date1))
(year1 (extract-calendar-year date1))
- (dayname1 (calendar-day-name date1))
+ (dayname1 (cal-tex-LaTeXify-string (calendar-day-name date1)))
)
(cal-tex-b-framebox "8cm" "l")
(cal-tex-b-parbox "b" "7.5cm")
@@ -951,7 +994,7 @@
Optional prefix argument specifies number of weeks.
Diary entries are included if `cal-tex-diary' is t.
Holidays are included if `cal-tex-holidays' is t."
- (interactive "P")
+ (interactive "p")
(let* ((n (if arg arg 1))
(date (calendar-gregorian-from-absolute
(calendar-dayname-on-or-before
@@ -1011,29 +1054,29 @@
(if (= (extract-calendar-month date)
(extract-calendar-month d))
(format "%s %s"
- (calendar-month-name
+ (cal-tex-month-name
(extract-calendar-month date))
(extract-calendar-year date))
(if (= (extract-calendar-year date)
(extract-calendar-year d))
(format "%s---%s %s"
- (calendar-month-name
+ (cal-tex-month-name
(extract-calendar-month date))
- (calendar-month-name
+ (cal-tex-month-name
(extract-calendar-month d))
(extract-calendar-year date))
(format "%s %s---%s %s"
- (calendar-month-name
+ (cal-tex-month-name
(extract-calendar-month date))
(extract-calendar-year date)
- (calendar-month-name (extract-calendar-month d))
+ (cal-tex-month-name (extract-calendar-month d))
(extract-calendar-year d))))))
(insert "%\n")
(calendar-for-loop j from 1 to 7 do
(if (= (mod i 2) 1)
(insert "\\rightday")
(insert "\\leftday"))
- (cal-tex-arg (calendar-day-name date))
+ (cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date)))
(cal-tex-arg (int-to-string (extract-calendar-day date)))
(cal-tex-arg (cal-tex-latexify-list diary-list date))
(cal-tex-arg (cal-tex-latexify-list holidays date))
@@ -1053,7 +1096,7 @@
Weeks start on Monday.
Diary entries are included if `cal-tex-diary' is t.
Holidays are included if `cal-tex-holidays' is t."
- (interactive "P")
+ (interactive "p")
(let* ((n (if arg arg 1))
(date (calendar-gregorian-from-absolute
(calendar-dayname-on-or-before
@@ -1120,27 +1163,27 @@
(if (= (extract-calendar-month date)
(extract-calendar-month d))
(format "%s %s"
- (calendar-month-name
+ (cal-tex-month-name
(extract-calendar-month date))
(extract-calendar-year date))
(if (= (extract-calendar-year date)
(extract-calendar-year d))
(format "%s---%s %s"
- (calendar-month-name
+ (cal-tex-month-name
(extract-calendar-month date))
- (calendar-month-name
+ (cal-tex-month-name
(extract-calendar-month d))
(extract-calendar-year date))
(format "%s %s---%s %s"
- (calendar-month-name
+ (cal-tex-month-name
(extract-calendar-month date))
(extract-calendar-year date)
- (calendar-month-name (extract-calendar-month d))
+ (cal-tex-month-name (extract-calendar-month d))
(extract-calendar-year d))))))
(insert "%\n")
(calendar-for-loop j from 1 to 3 do
(insert "\\leftday")
- (cal-tex-arg (calendar-day-name date))
+ (cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date)))
(cal-tex-arg (int-to-string (extract-calendar-day date)))
(cal-tex-arg (cal-tex-latexify-list diary-list date))
(cal-tex-arg (cal-tex-latexify-list holidays date))
@@ -1155,27 +1198,27 @@
(if (= (extract-calendar-month date)
(extract-calendar-month d))
(format "%s %s"
- (calendar-month-name
+ (cal-tex-month-name
(extract-calendar-month date))
(extract-calendar-year date))
(if (= (extract-calendar-year date)
(extract-calendar-year d))
(format "%s---%s %s"
- (calendar-month-name
+ (cal-tex-month-name
(extract-calendar-month date))
- (calendar-month-name
+ (cal-tex-month-name
(extract-calendar-month d))
(extract-calendar-year date))
(format "%s %s---%s %s"
- (calendar-month-name
+ (cal-tex-month-name
(extract-calendar-month date))
(extract-calendar-year date)
- (calendar-month-name (extract-calendar-month d))
+ (cal-tex-month-name (extract-calendar-month d))
(extract-calendar-year d))))))
(insert "%\n")
(calendar-for-loop j from 1 to 2 do
(insert "\\rightday")
- (cal-tex-arg (calendar-day-name date))
+ (cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date)))
(cal-tex-arg (int-to-string (extract-calendar-day date)))
(cal-tex-arg (cal-tex-latexify-list diary-list date))
(cal-tex-arg (cal-tex-latexify-list holidays date))
@@ -1184,7 +1227,7 @@
(setq date (cal-tex-incr-date date)))
(calendar-for-loop j from 1 to 2 do
(insert "\\weekend")
- (cal-tex-arg (calendar-day-name date))
+ (cal-tex-arg (cal-tex-LaTeXify-string (calendar-day-name date)))
(cal-tex-arg (int-to-string (extract-calendar-day date)))
(cal-tex-arg (cal-tex-latexify-list diary-list date))
(cal-tex-arg (cal-tex-latexify-list holidays date))
@@ -1204,7 +1247,7 @@
Diary entries are included if `cal-tex-diary' is t.
Holidays are included if `cal-tex-holidays' is t.
Pages are ruled if `cal-tex-rules' is t."
- (interactive "P")
+ (interactive "p")
(let* ((n (if arg arg 1))
(date (calendar-gregorian-from-absolute
(calendar-dayname-on-or-before
@@ -1313,7 +1356,7 @@
(defun cal-tex-cursor-day (&optional arg)
"Make a buffer with LaTeX commands for the day cursor is on.
Optional prefix argument specifies number of days."
- (interactive "P")
+ (interactive "p")
(let ((n (if arg arg 1))
(date (calendar-absolute-from-gregorian (calendar-cursor-to-date t))))
(cal-tex-preamble "12pt")
@@ -1335,7 +1378,7 @@
(defun cal-tex-daily-page (date)
"Make a calendar page for Gregorian DATE on 8.5 by 11 paper."
(let* ((hour)
- (month-name (calendar-month-name (extract-calendar-month date))))
+ (month-name (cal-tex-month-name (extract-calendar-month date))))
(cal-tex-banner "cal-tex-daily-page")
(cal-tex-b-makebox "4cm" "l")
(cal-tex-b-parbox "b" "3.8cm")
@@ -1350,7 +1393,7 @@
(cal-tex-e-makebox)
(cal-tex-hfill)
(cal-tex-b-makebox "4cm" "r")
- (cal-tex-bf (calendar-day-name date))
+ (cal-tex-bf (cal-tex-LaTeXify-string (calendar-day-name date)))
(cal-tex-e-makebox)
(cal-tex-nl)
(cal-tex-hspace ".4cm")
@@ -1422,15 +1465,17 @@
"}}r@{\\hspace{" colsep "}}r@{\\hspace{" colsep
"}}r@{\\hspace{" colsep "}}r@{\\hspace{0mm}}}%\n"
"\\multicolumn{7}{c}{"
- (calendar-month-name month)
+ (cal-tex-month-name month)
" "
(int-to-string year)
"}\\\\[1mm]\n")))
(calendar-for-loop i from 0 to 6 do
- (setq str (concat str
+ (setq str
+ (concat str
+ (cal-tex-LaTeXify-string
(substring (aref calendar-day-name-array
(mod (+ calendar-week-start-day i) 7))
- 0 2)
+ 0 2))
(if (/= i 6)
" & "
"\\\\[0.7mm]\n"))))
@@ -1455,7 +1500,7 @@
(+ (if n n 1) (calendar-absolute-from-gregorian date))))
(defun cal-tex-latexify-list (date-list date &optional separator final-separator)
- "Return string with concatenated, LaTeXified entries in DATE_LIST for DATE.
+ "Return string with concatenated, LaTeXified entries in DATE-LIST for DATE.
Use double backslash as a separator unless optional SEPARATOR is given.
If resulting string is not empty, put separator at end if optional
FINAL-SEPARATOR is t."
@@ -1575,6 +1620,10 @@
(setq tail (substring tail 1))
(setq head (concat head (if pair (cdr pair) ch)))))
head)))
+
+(defun cal-tex-month-name (month)
+ "The name of MONTH, LaTeXified."
+ (cal-tex-LaTeXify-string (calendar-month-name month)))
(defun cal-tex-hfill () "Insert hfill." (insert "\\hfill"))
Index: cal-xemacs.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/calendar/cal-xemacs.el,v
retrieving revision 1.8
diff -u -b -w -u -r1.8 cal-xemacs.el
--- cal-xemacs.el 2006/08/02 23:45:54 1.8
+++ cal-xemacs.el 2006/08/03 02:32:20
@@ -143,17 +143,17 @@
(defconst calendar-diary-menu
'("Diary"
- ["Other file" view-other-diary-entries (calendar-cursor-to-date)]
- ["Cursor date" view-diary-entries (calendar-cursor-to-date)]
- ["Mark all" mark-diary-entries t]
- ["Show all" show-all-diary-entries t]
- ["Insert daily"insert-diary-entry t]
- ["Insert weekly" insert-weekly-diary-entry (calendar-cursor-to-date)]
- ["Insert monthly" insert-monthly-diary-entry (calendar-cursor-to-date)]
- ["Insert yearly" insert-yearly-diary-entry (calendar-cursor-to-date)]
- ["Insert anniversary" insert-anniversary-diary-entry (calendar-cursor-to-date)]
- ["Insert block" insert-block-diary-entry (calendar-cursor-to-date)]
- ["Insert cyclic" insert-cyclic-diary-entry (calendar-cursor-to-date)]
+ ["Other File" view-other-diary-entries (calendar-cursor-to-date)]
+ ["Cursor Date" view-diary-entries (calendar-cursor-to-date)]
+ ["Mark All" mark-diary-entries t]
+ ["Show All" show-all-diary-entries t]
+ ["Insert Diary Entry"insert-diary-entry t]
+ ["Insert Weekly" insert-weekly-diary-entry (calendar-cursor-to-date)]
+ ["Insert Monthly" insert-monthly-diary-entry (calendar-cursor-to-date)]
+ ["Insert Yearly" insert-yearly-diary-entry (calendar-cursor-to-date)]
+ ["Insert Anniversary" insert-anniversary-diary-entry (calendar-cursor-to-date)]
+ ["Insert Block" insert-block-diary-entry (calendar-cursor-to-date)]
+ ["Insert Cyclic" insert-cyclic-diary-entry (calendar-cursor-to-date)]
["Insert Islamic" calendar-mouse-insert-islamic-diary-entry (calendar-cursor-to-date)]
["Insert Hebrew" calendar-mouse-insert-hebrew-diary-entry (calendar-cursor-to-date)]))
Index: calendar.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/calendar/calendar.el,v
retrieving revision 1.9
diff -u -b -w -u -r1.9 calendar.el
--- calendar.el 2006/08/02 02:59:43 1.9
+++ calendar.el 2006/08/03 02:32:20
@@ -635,7 +635,7 @@
european-date-diary-pattern
american-date-diary-pattern)
"*List of pseudo-patterns describing the forms of date used in the diary.
-The patterns on the list must be MUTUALLY EXCLUSIVE and must not match
+The patterns on the list must be MUTUALLY EXCLUSIVE and should not match
any portion of the diary entry itself, just the date component.
A pseudo-pattern is a list of regular expressions and the keywords `month',
@@ -1902,10 +1902,10 @@
(defun generate-calendar-month (month year indent)
"Produce a calendar for MONTH, YEAR on the Gregorian calendar.
-The calendar is inserted in the buffer starting at the line on which point
-is currently located, but indented INDENT spaces. The indentation is done
-from the first character on the line and does not disturb the first INDENT
-characters on the line."
+The calendar is inserted at the top of the buffer in which point is currently
+located, but indented INDENT spaces. The indentation is done from the first
+character on the line and does not disturb the first INDENT characters on the
+line."
(let* ((blank-days;; at start of month
(mod
(- (calendar-day-of-week (list month 1 year))
@@ -2143,8 +2143,33 @@
"\\<calendar-mode-map>\\[scroll-calendar-right]")
'help-echo "mouse-2: scroll right"
))
- "The mode line of the calendar buffer.")
+ "The mode line of the calendar buffer.
+This must be a list of items that evaluate to strings--those strings are
+evaluated and concatenated together, evenly separated by blanks. The variable
+`date' is available for use as the date under (or near) the cursor; `date'
+defaults to the current date if it is otherwise undefined. Here is an example
+value that has the Hebrew date, the day number/days remaining in the year,
+and the ISO week/year numbers in the mode. When calendar-move-hook is set to
+'update-calendar-mode-line, these mode line shows these values for the date
+under the cursor:
+
+ (list
+ \"\"
+ '(calendar-hebrew-date-string date)
+ '(let* ((year (extract-calendar-year date))
+ (d (calendar-day-number date))
+ (days-remaining
+ (- (calendar-day-number (list 12 31 year)) d)))
+ (format \"%d/%d\" d days-remaining))
+ '(let* ((d (calendar-absolute-from-gregorian date))
+ (iso-date (calendar-iso-from-absolute d)))
+ (format \"ISO week %d of %d\"
+ (extract-calendar-month iso-date)
+ (extract-calendar-year iso-date)))
+ \"\"))
+")
+
(defun calendar-goto-info-node ()
"Go to the info node for the calendar."
(interactive)
@@ -2222,7 +2247,12 @@
(set-buffer calendar-buffer)
(setq mode-line-format
(calendar-string-spread
- calendar-mode-line-format ? (frame-width))))))
+ (let ((date (condition-case nil
+ (calendar-cursor-to-nearest-date)
+ (error (calendar-current-date)))))
+ (mapcar 'eval calendar-mode-line-format))
+ ? (frame-width)))
+ (force-mode-line-update))))
(defun calendar-window-list ()
"List of all calendar-related windows."
Index: diary-lib.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/calendar/diary-lib.el,v
retrieving revision 1.5
diff -u -b -w -u -r1.5 diary-lib.el
--- diary-lib.el 2006/07/31 02:15:23 1.5
+++ diary-lib.el 2006/08/03 02:32:20
@@ -265,10 +265,10 @@
(if (not (looking-at "\^M\\|\n"))
(progn
(goto-char (point-max))
- (insert-string "\^M")))
+ (insert "\^M")))
(goto-char (point-min))
(if (not (looking-at "\^M\\|\n"))
- (insert-string "\^M"))
+ (insert "\^M"))
(subst-char-in-region (point-min) (point-max) ?\n ?\^M t)
(calendar-for-loop i from 1 to number do
(let ((d diary-date-forms)
@@ -328,9 +328,9 @@
(point) ?\^M ?\n t)
(add-to-diary-list
date
- (buffer-substring-no-properties
+ (buffer-substring
entry-start (point))
- (buffer-substring-no-properties
+ (buffer-substring
(1+ date-start) (1- entry-start)) )))))
(setq d (cdr d)))
(or entry-found
@@ -1252,7 +1252,8 @@
(defun diary-block (m1 d1 y1 m2 d2 y2)
"Block diary entry.
-Entry applies if date is between two dates. Order of the parameters is
+Entry applies if date is between, or on one of, two dates.
+The order of the parameters is
M1, D1, Y1, M2, D2, Y2 if `european-calendar-style' is nil, and
D1, M1, Y1, D2, M2, Y2 if `european-calendar-style' is t."
(let ((date1 (calendar-absolute-from-gregorian
Index: solar.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/calendar/solar.el,v
retrieving revision 1.6
diff -u -b -w -u -r1.6 solar.el
--- solar.el 2006/07/31 02:15:24 1.6
+++ solar.el 2006/08/03 02:32:20
@@ -200,8 +200,8 @@
nil
"Sidereal time at Greenwich at midnight (universal time).")
-(defvar solar-spring-or-summer-season nil
- "T if spring or summer and nil otherwise.
+(defvar solar-northern-spring-or-summer-season nil
+ "Non-nil if northern spring or summer and nil otherwise.
Needed for polar areas, in order to know whether the day lasts 0 or 24 hours.")
(defun solar-setup ()
@@ -300,7 +300,7 @@
(* (solar-sin-degrees obliquity)
(solar-sin-degrees longitude))))
-(defun solar-sunrise-and-sunset (time latitude longitude)
+(defun solar-sunrise-and-sunset (time latitude longitude height)
"Sunrise, sunset and length of day.
Parameters are the midday TIME and the LATITUDE, LONGITUDE of the location.
@@ -310,14 +310,20 @@
\(-0.040945 16), -0.040945 being the number of julian centuries elapsed between
Jan 1, 2000 at 12 UT and November 28, 1995 at 0 UT.
-Coordinates are included because this function is called with latitude=10
+HEIGHT is the angle the center of the sun has over the horizon for the contact
+we are trying to find. For sunrise and sunset, it is usually -0.61 degrees,
+accounting for the edge of the sun being on the horizon.
+
+Coordinates are included because this function is called with latitude=1
degrees to find out if polar regions have 24 hours of sun or only night."
- (let* ((rise-time (solar-moment -1 latitude longitude time))
- (set-time (solar-moment 1 latitude longitude time))
+ (let* ((rise-time (solar-moment -1 latitude longitude time height))
+ (set-time (solar-moment 1 latitude longitude time height))
(day-length))
(if (not (and rise-time set-time))
- (if (or (and (> latitude 0) solar-spring-or-summer-season)
- (and (< latitude 0) (not solar-spring-or-summer-season)))
+ (if (or (and (> latitude 0)
+ solar-northern-spring-or-summer-season)
+ (and (< latitude 0)
+ (not solar-northern-spring-or-summer-season)))
(setq day-length 24)
(setq day-length 0))
(setq day-length (- set-time rise-time)))
@@ -325,7 +331,7 @@
(if set-time (+ set-time (/ calendar-time-zone 60.0)) nil)
day-length)))
-(defun solar-moment (direction latitude longitude time)
+(defun solar-moment (direction latitude longitude time height)
"Sunrise/sunset at location.
Sunrise if DIRECTION =-1 or sunset if =1 at LATITUDE, LONGITUDE, with midday
being TIME.
@@ -336,9 +342,13 @@
\(-0.040945 16), -0.040945 being the number of julian centuries elapsed between
Jan 1, 2000 at 12 UT and November 28, 1995 at 0 UT.
+HEIGHT is the angle the center of the sun has over the horizon for the contact
+we are trying to find. For sunrise and sunset, it is usually -0.61 degrees,
+accounting for the edge of the sun being on the horizon.
+
Uses binary search."
(let* ((ut (car (cdr time)))
- (possible 1) ; we assume that rise or set are possible
+ (possible t) ; we assume that rise or set are possible
(utmin (+ ut (* direction 12.0)))
(utmax ut) ; the time searched is between utmin and utmax
; utmin and utmax are in hours
@@ -354,10 +364,10 @@
latitude longitude t)))))
; -0.61 degrees is the height of the middle of the sun, when it rises
; or sets.
- (if (< hmin -0.61)
- (if (> hmax -0.61)
+ (if (< hmin height)
+ (if (> hmax height)
(while ;(< i 20) ; we perform a simple dichotomy
- ;(> (abs (+ hut 0.61)) epsilon)
+ ;(> (abs (- hut height)) epsilon)
(>= (abs (- utmoment utmoment-old))
(/ solar-error 60))
(setq utmoment-old utmoment)
@@ -365,12 +375,12 @@
(setq hut (car (cdr
(solar-horizontal-coordinates
(list t0 utmoment) latitude longitude t))))
- (if (< hut -0.61) (setq utmin utmoment))
- (if (> hut -0.61) (setq utmax utmoment))
+ (if (< hut height) (setq utmin utmoment))
+ (if (> hut height) (setq utmax utmoment))
)
- (setq possible 0)) ; the sun never rises
- (setq possible 0)) ; the sun never sets
- (if (equal possible 0) nil utmoment)))
+ (setq possible nil)) ; the sun never rises
+ (setq possible nil)) ; the sun never sets
+ (if (not possible) nil utmoment)))
(defun solar-time-string (time time-zone)
"Printable form for decimal fraction TIME in TIME-ZONE.
@@ -429,20 +439,20 @@
(solar-sidereal-time t0))
(solar-sunrise-and-sunset
(list t0 (car (cdr exact-local-noon)))
- 10.0
- (calendar-longitude))))
+ 1.0
+ (calendar-longitude) 0)))
; store the spring/summer information,
; compute sunrise and sunset (two first components of rise-set).
; length of day is the third component (it is only the difference
; between sunset and sunrise when there is a sunset and a sunrise)
(rise-set
(progn
- (setq solar-spring-or-summer-season
- (if (> (car (cdr (cdr equator-rise-set))) 12) 1 0))
+ (setq solar-northern-spring-or-summer-season
+ (if (> (car (cdr (cdr equator-rise-set))) 12) t nil))
(solar-sunrise-and-sunset
(list t0 (car (cdr exact-local-noon)))
(calendar-latitude)
- (calendar-longitude))))
+ (calendar-longitude) -0.61)))
(rise (car rise-set))
(adj-rise (if rise (dst-adjust-time date rise) nil))
(set (car (cdr rise-set)))
@@ -906,6 +916,12 @@
(solar-setup))
(solar-sunrise-sunset-string date))
+(defcustom diary-sabbath-candles-minutes 18
+ "*Number of minutes before sunset for sabbath candle lighting."
+:group 'diary
+:type 'integer
+:version "21.1")
+
(defun diary-sabbath-candles ()
"Local time of candle lighting diary entry--applies if date is a Friday.
No diary entry if there is no sunset on that date."
@@ -914,7 +930,9 @@
(if (= (% (calendar-absolute-from-gregorian date) 7) 5);; Friday
(let* ((sunset (car (cdr (solar-sunrise-sunset date))))
(light (if sunset
- (cons (- (car sunset) (/ 18.0 60.0)) (cdr sunset)))))
+ (cons (- (car sunset)
+ (/ diary-sabbath-candles-minutes 60.0))
+ (cdr sunset)))))
(if sunset
(format "%s Sabbath candle lighting"
(apply 'solar-time-string light))))))