Commits

jmiller  committed 302d846

Sync calendar with 2007-03-31 Emacs cvs

  • Participants
  • Parent commits ea1e4bc

Comments (0)

Files changed (26)

+2007-04-14  Jeff Miller  <jeff.miller@xemacs.org>
+
+	* cal-html.el (cal-html-comment): replace call to 
+	replace-regexp-in-string with replace-in-string
+	* cal-html.el (cal-html-year-dir-ask-user): Account for difference in 
+	read-directory-name between XEmacs & Emacs
+	* cal-html.el (cal-html-htmlify-string): replace call to 
+	replace-regexp-in-string with equivalent workaround
+	* all: update copyrights to 2007
+
+2007-03-27  Glenn Morris  <rgm@gnu.org>
+
+        * calendar/calendar.el (calendar-mode-hook): Declare it.
+
+        * calendar/diary-lib.el (diary-live-p): Do not check for
+        diary-selective-display.
+
+2007-03-21  Ulf Jasper  <ulf.jasper@web.de>
+
+        * calendar/icalendar.el (icalendar-version): Increase to 0.15.
+        (icalendar--get-unfolded-buffer): Define actual arguments rather
+        than just using &rest.  Check replace-in-string is fbound.
+        (icalendar-import-buffer): Doc fix.
+        (icalendar--convert-ical-to-diary): Set diary-file.
+        Check diary-file before inserting final newline.
+        (icalendar--add-diary-entry): Return diary-file.
+
+2007-03-21  Glenn Morris  <rgm@gnu.org>
+
+        * calendar/calendar.el (diary-set-maybe-redraw): Autoload it.
+        (diary-display-hook): Add custom :set function.
+
+        * calendar/diary-lib.el (diary-header-line-flag): Doc fix.
+        Add custom :set function.
+        (diary-header-line-format): Doc fix.
+        (diary-set-maybe-redraw): New function.
+        (number-of-diary-entries): Change :set to use diary-set-maybe-redraw.
+        (diary-list-entries): Always run diary-mode.
+
+2007-03-20  Glenn Morris  <rgm@gnu.org>
+
+        * calendar/diary-lib.el (diary-live-p): New function.
+        (number-of-diary-entries): Add a :set function to redisplay diary
+        when necessary.
+
+2007-03-12  Glenn Morris  <rgm@gnu.org>
+
+        * calendar/cal-china.el,cal-dst.el,calendar.el,diary-lib.el:
+        * calendar/lunar.el,solar.el: Replace "daylight savings" with
+        "daylight saving" in text.	
+
 2007-01-28  Norbert Koch  <viteno@xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 1.31 released.
 ;;; appt.el --- appointment notification functions
 
 ;; Copyright (C) 1989, 1990, 1994, 1998, 2001, 2002, 2003, 2004, 2005,
-;;   2006  Free Software Foundation, Inc.
+;;   2006, 2007  Free Software Foundation, Inc.
 
 ;; Author: Neil Mager <neilm@juliet.ll.mit.edu>
 ;; Maintainer: Glenn Morris <rgm@gnu.org>
 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 ;; Boston, MA 02110-1301, USA.
 
-;;; Synched up with: FSF Emacs 22.1 CVS 2006-09-15
+;;; Synched up with: FSF Emacs 22 CVS 2007-03-30
 
 ;;; Commentary:
 

File cal-bahai.el

 ;;; cal-bahai.el --- calendar functions for the Baha'i calendar.
 
-;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006
+;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
 ;;   Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 ;; Boston, MA 02110-1301, USA.
 
-;;; Synched up with: FSF Emacs 22.1 CVS 2006-09-15
+;;; Synched up with: FSF Emacs 22 CVS 2007-03-30
 
 ;;; Commentary:
 

File cal-china.el

 ;;; cal-china.el --- calendar functions for the Chinese calendar
 
-;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006
+;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007
 ;;   Free Software Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 ;; Boston, MA 02110-1301, USA.
 
-;;; Synched up with: FSF Emacs 22.1 CVS 2006-09-15
+;;; Synched up with: FSF Emacs 22 CVS 2007-03-30
 
 ;;; Commentary:
 
 ; The correct value is as follows, but the Chinese calendrical
 ; authorities do NOT use DST in determining astronomical events:
 ;  60
-  "*Number of minutes difference between daylight savings and standard time
-for Chinese calendar.  Default is for no daylight savings time."
+  "*Number of minutes difference between daylight saving and standard time
+for Chinese calendar.  Default is for no daylight saving time."
   :type 'integer
   :group 'chinese-calendar)
 
   :group 'chinese-calendar)
 
 (defcustom chinese-calendar-daylight-time-zone-name "CDT"
-  "*Abbreviated name of daylight-savings time zone used for Chinese calendar."
+  "*Abbreviated name of daylight saving time zone used for Chinese calendar."
   :type 'string
   :group 'chinese-calendar)
 
 ;  '(cond ((< 1986 year) (calendar-nth-named-day 1 0 4 year 10))
 ;         ((= 1986 year) '(5 4 1986))
 ;         (t nil))
-  "*Sexp giving the date on which daylight savings time starts for Chinese
-calendar.  Default is for no daylight savings time.  See documentation of
+  "*Sexp giving the date on which daylight saving time starts for Chinese
+calendar.  Default is for no daylight saving time.  See documentation of
 `calendar-daylight-savings-starts'."
   :type 'sexp
   :group 'chinese-calendar)
 ; The correct value is as follows, but the Chinese calendrical
 ; authorities do NOT use DST in determining astronomical events:
 ;  '(if (<= 1986 year) (calendar-nth-named-day 1 0 9 year 11))
-  "*Sexp giving the date on which daylight savings time ends for Chinese
-calendar.  Default is for no daylight savings time.  See documentation of
+  "*Sexp giving the date on which daylight saving time ends for Chinese
+calendar.  Default is for no daylight saving time.  See documentation of
 `calendar-daylight-savings-ends'."
   :type 'sexp
   :group 'chinese-calendar)
 
 (defcustom chinese-calendar-daylight-savings-starts-time 0
-  "*Number of minutes after midnight that daylight savings time starts for
-Chinese calendar.  Default is for no daylight savings time."
+  "*Number of minutes after midnight that daylight saving time starts for
+Chinese calendar.  Default is for no daylight saving time."
   :type 'integer
   :group 'chinese-calendar)
 
 (defcustom chinese-calendar-daylight-savings-ends-time 0
-  "*Number of minutes after midnight that daylight savings time ends for
-Chinese calendar.  Default is for no daylight savings time."
+  "*Number of minutes after midnight that daylight saving time ends for
+Chinese calendar.  Default is for no daylight saving time."
   :type 'integer
   :group 'chinese-calendar)
 

File cal-coptic.el

 ;;; cal-coptic.el --- calendar functions for the Coptic/Ethiopic calendars
 
-;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006
+;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007
 ;;   Free Software Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 ;; Boston, MA 02110-1301, USA.
 
-;;; Synched up with: FSF Emacs 22.1 CVS 2006-09-15
+;;; Synched up with: FSF Emacs 22 CVS 2007-03-30
 
 ;;; Commentary:
 
-;;; cal-dst.el --- calendar functions for daylight savings rules
+;;; cal-dst.el --- calendar functions for daylight saving rules
 
 ;; Copyright (C) 1993, 1994, 1995, 1996, 2001, 2002, 2003, 2004, 2005,
-;;   2006  Free Software Foundation, Inc.
+;;   2006, 2007  Free Software Foundation, Inc.
 
 ;; Author: Paul Eggert <eggert@twinsun.com>
 ;;	Edward M. Reingold <reingold@cs.uiuc.edu>
 ;; Maintainer: Glenn Morris <rgm@gnu.org>
 ;; Keywords: calendar
-;; Human-Keywords: daylight savings time, calendar, diary, holidays
+;; Human-Keywords: daylight saving time, calendar, diary, holidays
 
 ;; This file is part of XEmacs.
 
 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 ;; Boston, MA 02110-1301, USA.
 
-;;; Synched up with: FSF Emacs 22.1 CVS 2006-09-15
+;;; Synched up with: FSF Emacs 22 CVS 2007-03-30
 
 ;;; Commentary:
 
 ;; This collection of functions implements the features of calendar.el and
-;; holiday.el that deal with daylight savings time.
+;; holiday.el that deal with daylight saving time.
 
 ;; Comments, corrections, and improvements should be sent to
 ;;  Edward M. Reingold               Department of Computer Science
   "Non-nil means to check each year for DST transitions as needed.
 Otherwise assume the next two transitions found after the
 current date apply to all years.  This is faster, but not always
-correct, since the dates of Daylight Saving transitions sometimes
+correct, since the dates of daylight saving transitions sometimes
 change."
 :type 'boolean
 :version "22.1"
 
 (defun calendar-time-zone-daylight-rules (abs-date utc-diff)
   "Return daylight transition rule for ABS-DATE, UTC-DIFF sec offset from UTC.
-ABS-DATE must specify a day that contains a daylight savings transition.
-The result has the proper form for calendar-daylight-savings-starts'."
+ABS-DATE must specify a day that contains a daylight saving transition.
+The result has the proper form for `calendar-daylight-savings-starts'."
   (let* ((date (calendar-gregorian-from-absolute abs-date))
 	 (weekday (% abs-date 7))
 	 (m (extract-calendar-month date))
 ;; See thread
 ;; http://lists.gnu.org/archive/html/emacs-pretest-bug/2006-11/msg00060.html
 (defun calendar-dst-find-data (&optional time)
-  "Find data on the first Daylight Saving Time transitions after TIME.
+  "Find data on the first daylight saving time transitions after TIME.
 TIME defaults to `current-time'.  Return value is as described
 for `calendar-current-time-zone'."
   (let* ((t0 (or time (current-time)))
       (let* ((t1 (calendar-next-time-zone-transition t0))
              (t2 (and t1 (calendar-next-time-zone-transition t1))))
         (if (not t2)
-            ;; This locale does not have daylight savings time.
+            ;; This locale does not have daylight saving time.
             (list (/ t0-utc-diff 60) 0 t0-name t0-name nil nil 0 0)
-          ;; Use heuristics to find daylight savings parameters.
+          ;; Use heuristics to find daylight saving parameters.
           (let* ((t1-zone (current-time-zone t1))
                  (t1-utc-diff (car t1-zone))
                  (t1-name (car (cdr t1-zone)))
                 )))))))))
 
 (defvar calendar-dst-transition-cache nil
-  "Internal cal-dst variable storing date of Daylight Saving Time transitions.
+  "Internal cal-dst variable storing date of daylight saving time transitions.
 Value is a list with elements of the form (YEAR START END), where
 START and END are expressions that when evaluated return the
 start and end dates (respectively) for DST in YEAR. Used by the
 function `calendar-dst-find-startend'.")
 
 (defun calendar-dst-find-startend (year)
-  "Find the dates in YEAR on which Daylight Saving Time starts and ends.
+  "Find the dates in YEAR on which daylight saving time starts and ends.
 Returns a list (YEAR START END), where START and END are
 expressions that when evaluated return the start and end dates,
 respectively. This function first attempts to use pre-calculated
 UTC-DIFF is an integer specifying the number of minutes difference between
     standard time in the current time zone and Coordinated Universal Time
     (Greenwich Mean Time).  A negative value means west of Greenwich.
-DST-OFFSET is an integer giving the daylight savings time offset in minutes.
+DST-OFFSET is an integer giving the daylight saving time offset in minutes.
 STD-ZONE is a string giving the name of the time zone when no seasonal time
     adjustment is in effect.
 DST-ZONE is a string giving the name of the time zone when there is a seasonal
     time adjustment in effect.
 DST-STARTS and DST-ENDS are sexps in the variable `year' giving the daylight
-    savings time start and end rules, in the form expected by
+    saving time start and end rules, in the form expected by
     `calendar-daylight-savings-starts'.
 DST-STARTS-TIME and DST-ENDS-TIME are integers giving the number of minutes
-    after midnight that daylight savings time starts and ends.
+    after midnight that daylight saving time starts and ends.
 
 If the local area does not use a seasonal time adjustment, STD-ZONE and
 DST-ZONE are equal, and all the DST-* integer variables are 0.
   (unless calendar-current-time-zone-cache
     (setq calendar-current-time-zone-cache (calendar-dst-find-data))))
 
-;;; The following eight defvars relating to daylight savings time should NOT be
+;;; The following eight defvars relating to daylight saving time should NOT be
 ;;; marked to go into loaddefs.el where they would be evaluated when Emacs is
 ;;; dumped.  These variables' appropriate values depend on the conditions under
 ;;; which the code is INVOKED; so it's inappropriate to initialize them when
 
 (defvar calendar-daylight-time-offset
   (or (car (cdr calendar-current-time-zone-cache)) 60)
-  "*Number of minutes difference between daylight savings and standard time.
+  "*Number of minutes difference between daylight saving and standard time.
 
-If the locale never uses daylight savings time, set this to 0.")
+If the locale never uses daylight saving time, set this to 0.")
 
 (defvar calendar-standard-time-zone-name
   (or (car (nthcdr 2 calendar-current-time-zone-cache)) "EST")
 
 (defvar calendar-daylight-time-zone-name
   (or (car (nthcdr 3 calendar-current-time-zone-cache)) "EDT")
-  "*Abbreviated name of daylight-savings time zone at `calendar-location-name'.
+  "*Abbreviated name of daylight saving time zone at `calendar-location-name'.
 For example, \"EDT\" in New York City, \"PDT\" for Los Angeles.")
 
 
 (defun calendar-dst-starts (year)
-  "Return the date of YEAR on which Daylight Saving Time starts.
+  "Return the date of YEAR on which daylight saving time starts.
 This function respects the value of `calendar-dst-check-each-year-flag'."
   (or (let ((expr (if calendar-dst-check-each-year-flag
                       (cadr (calendar-dst-find-startend year))
            (calendar-nth-named-day 2 0 3 year))))
 
 (defun calendar-dst-ends (year)
-  "Return the date of YEAR on which Daylight Saving Time ends.
+  "Return the date of YEAR on which daylight saving time ends.
 This function respects the value of `calendar-dst-check-each-year-flag'."
   (or (let ((expr (if calendar-dst-check-each-year-flag
                       (nth 2 (calendar-dst-find-startend year))
 (put 'calendar-daylight-savings-starts 'risky-local-variable t)
 (defvar calendar-daylight-savings-starts
   '(calendar-dst-starts year)
-  "*Sexp giving the date on which daylight savings time starts.
+  "*Sexp giving the date on which daylight saving time starts.
 This is an expression in the variable `year' whose value gives the Gregorian
-date in the form (month day year) on which daylight savings time starts.  It is
-used to determine the starting date of daylight savings time for the holiday
+date in the form (month day year) on which daylight saving time starts.  It is
+used to determine the starting date of daylight saving time for the holiday
 list and for correcting times of day in the solar and lunar calculations.
 
-For example, if daylight savings time is mandated to start on October 1,
+For example, if daylight saving time is mandated to start on October 1,
 you would set `calendar-daylight-savings-starts' to
 
       '(10 1 year)
 
       '(calendar-nth-named-day 1 0 4 year)
 
-If the locale never uses daylight savings time, set this to nil.")
+If the locale never uses daylight saving time, set this to nil.")
 
 ;;;###autoload
 (put 'calendar-daylight-savings-ends 'risky-local-variable t)
 (defvar calendar-daylight-savings-ends
   '(calendar-dst-ends year)
-  "*Sexp giving the date on which daylight savings time ends.
+  "*Sexp giving the date on which daylight saving time ends.
 This is an expression in the variable `year' whose value gives the Gregorian
-date in the form (month day year) on which daylight savings time ends.  It is
-used to determine the starting date of daylight savings time for the holiday
+date in the form (month day year) on which daylight saving time ends.  It is
+used to determine the starting date of daylight saving time for the holiday
 list and for correcting times of day in the solar and lunar calculations.
 
-For example, if daylight savings time ends on the last Sunday in October:
+For example, if daylight saving time ends on the last Sunday in October:
 
       '(calendar-nth-named-day -1 0 10 year)
 
-If the locale never uses daylight savings time, set this to nil.")
+If the locale never uses daylight saving time, set this to nil.")
 
 (defvar calendar-daylight-savings-starts-time
   (or (car (nthcdr 6 calendar-current-time-zone-cache)) 120)
-  "*Number of minutes after midnight that daylight savings time starts.")
+  "*Number of minutes after midnight that daylight saving time starts.")
 
 (defvar calendar-daylight-savings-ends-time
   (or (car (nthcdr 7 calendar-current-time-zone-cache))
       calendar-daylight-savings-starts-time)
-  "*Number of minutes after midnight that daylight savings time ends.")
+  "*Number of minutes after midnight that daylight saving time ends.")
 
 (defun dst-in-effect (date)
-  "True if on absolute DATE daylight savings time is in effect.
+  "True if on absolute DATE daylight saving time is in effect.
 Fractional part of DATE is local standard time of day."
   (let* ((year (extract-calendar-year
                 (calendar-gregorian-from-absolute (floor date))))
 decimal fraction time, and `zone' is a string.
 
 Optional parameter STYLE forces the result time to be standard time when its
-value is 'standard and daylight savings time (if available) when its value is
+value is 'standard and daylight saving time (if available) when its value is
 'daylight.
 
-Conversion to daylight savings time is done according to
+Conversion to daylight saving time is done according to
 `calendar-daylight-savings-starts', `calendar-daylight-savings-ends',
 `calendar-daylight-savings-starts-time',
 `calendar-daylight-savings-ends-time', and

File cal-french.el

 ;;; cal-french.el --- calendar functions for the French Revolutionary calendar
 
 ;; Copyright (C) 1988, 1989, 1992, 1994, 1995, 1997, 2001, 2002, 2003,
-;;   2004, 2005, 2006  Free Software Foundation, Inc.
+;;   2004, 2005, 2006, 2007  Free Software Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
 ;; Maintainer: Glenn Morris <rgm@gnu.org>
 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 ;; Boston, MA 02110-1301, USA.
 
-;;; Synched up with: FSF Emacs 22.1 CVS 2006-09-15
+;;; Synched up with: FSF Emacs 22 CVS 2007-03-30
 ;;; Commentary:
 
 ;; This collection of functions implements the features of calendar.el and

File cal-hebrew.el

 ;;; cal-hebrew.el --- calendar functions for the Hebrew calendar
 
-;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006
+;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007
 ;;   Free Software Foundation, Inc.
 
 ;; Author: Nachum Dershowitz <nachum@cs.uiuc.edu>
 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 ;; Boston, MA 02110-1301, USA.
 
-;;; Synched up with: FSF Emacs 22.1 CVS 2006-09-15
+;;; Synched up with: FSF Emacs 22 CVS 2007-03-30
 
 ;;; Commentary:
 
 ;;; cal-html.el --- functions for printing HTML calendars
 
-;; Copyright (C) 2002, 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007  Free Software Foundation, Inc.
 
 ;; Author: Anna M. Bigatti <bigatti@dima.unige.it>
 ;; Keywords: calendar
 (defun cal-html-comment (string)
   "Return STRING as html comment."
   (format "<!--  ======  %s  ======  -->\n"
-          (replace-regexp-in-string "--" "++" string)))
+          ;; XEmacs change
+          ;; Emacs uses replace-regexp-in-string
+          (replace-in-string string "--" "++")))
 
 (defun cal-html-href (link string)
   "Return a hyperlink to url LINK with text STRING."
   (expand-file-name (read-directory-name
                      "Enter HTML calendar directory name: "
                      (expand-file-name (format "%d" year)
+                                       cal-html-directory)
+                     ;; XEmacs change
+                     ;; account for difference in read-directory-name
+                     ;; between XEmacs and Emacs
+                     ;; If user just hits return to accept prompted dir
+                     ;; then default-directory is used.  
+                     (expand-file-name (format "%d" year)
                                        cal-html-directory))))
 
 ;;------------------------------------------------------------
   "Protect special characters in STRING from HTML.
 Characters are replaced according to `cal-html-html-subst-list'."
   (if (stringp string)
-      (replace-regexp-in-string
-       (regexp-opt (mapcar 'car cal-html-html-subst-list))
-       (lambda (x)
-         (cdr (assoc x cal-html-html-subst-list)))
-       string)
+      ;; XEmacs change
+      ;; Emacs uses replace-regexp-in-string
+      ;; Can't use replace-in-string since it doesn't support passing
+      ;; a function as the replace argument
+      (let ((rep-list (mapcar 'car cal-html-html-subst-list)))
+        (mapc (lambda (x)
+                (setq string 
+                      (replace-in-string 
+                       string 
+                       x 
+                       (cdr (assoc x cal-html-html-subst-list)))))
+              rep-list)
+        string)
     ""))
 
-
 (defun cal-html-htmlify-entry (entry)
   "Convert a diary entry ENTRY to html with the appropriate class specifier."
   (let ((start

File cal-islam.el

 ;;; cal-islam.el --- calendar functions for the Islamic calendar
 
-;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006
+;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007
 ;;   Free Software Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 ;; Boston, MA 02110-1301, USA.
 
-;;; Synched up with: FSF Emacs 22.1 CVS 2006-09-15
+;;; Synched up with: FSF Emacs 22 CVS 2007-03-30
 
 ;;; Commentary:
 
 ;;; cal-iso.el --- calendar functions for the ISO calendar
 
-;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006
+;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007
 ;;   Free Software Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 ;; Boston, MA 02110-1301, USA.
 
-;;; Synched up with: FSF Emacs 22.1 CVS 2006-09-15
+;;; Synched up with: FSF Emacs 22 CVS 2007-03-30
 
 ;;; Commentary:
 

File cal-julian.el

 ;;; cal-julian.el --- calendar functions for the Julian calendar
 
-;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006
+;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007
 ;;   Free Software Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 ;; Boston, MA 02110-1301, USA.
 
-;;; Synched up with: FSF Emacs 22.1 CVS 2006-09-15
+;;; Synched up with: FSF Emacs 22 CVS 2007-03-30
 
 ;;; Commentary:
 

File cal-mayan.el

 ;;; cal-mayan.el --- calendar functions for the Mayan calendars
 
 ;; Copyright (C) 1992, 1993, 1995, 1997, 2001, 2002, 2003, 2004, 2005,
-;;   2006  Free Software Foundation, Inc.
+;;   2006, 2007  Free Software Foundation, Inc.
 
 ;; Author: Stewart M. Clamen <clamen@cs.cmu.edu>
 ;;	Edward M. Reingold <reingold@cs.uiuc.edu>
 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 ;; Boston, MA 02110-1301, USA.
 
-;;; Synched up with: FSF Emacs 22.1 CVS 2006-09-15
+;;; Synched up with: FSF Emacs 22 CVS 2007-03-30
 
 ;;; Commentary:
 
 ;;; cal-move.el --- calendar functions for movement in the calendar
 
-;; Copyright (C) 1995, 2001, 2002, 2003, 2004, 2005, 2006
+;; Copyright (C) 1995, 2001, 2002, 2003, 2004, 2005, 2006, 2007
 ;;   Free Software Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 ;; Boston, MA 02110-1301, USA.
 
-;;; Synched up with: FSF Emacs 22.1 CVS 2006-09-15
+;;; Synched up with: FSF Emacs 22 CVS 2007-03-30
 
 ;;; Commentary:
 

File cal-persia.el

 ;;; cal-persia.el --- calendar functions for the Persian calendar
 
-;; Copyright (C) 1996, 1997, 2001, 2002, 2003, 2004, 2005, 2006
+;; Copyright (C) 1996, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007
 ;;   Free Software Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 ;; Boston, MA 02110-1301, USA.
 
-;;; Synched up with: FSF Emacs 22.1 CVS 2006-09-15
+;;; Synched up with: FSF Emacs 22 CVS 2007-03-30
 
 ;;; Commentary:
 
 ;;; cal-tex.el --- calendar functions for printing calendars with LaTeX
 
-;; Copyright (C) 1995, 2001, 2002, 2003, 2004, 2005, 2006
+;; Copyright (C) 1995, 2001, 2002, 2003, 2004, 2005, 2006, 2007
 ;;   Free Software Foundation, Inc.
 
 ;; Author: Steve Fisk <fisk@bowdoin.edu>
 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 ;; Boston, MA 02110-1301, USA.
 
-;;; Synched up with: FSF Emacs 22.1 CVS 2006-09-15
+;;; Synched up with: FSF Emacs 22 CVS 2007-03-30
 
 ;;; Commentary:
 
 ;;; cal-x.el --- calendar windows in dedicated frames in X
 
-;; Copyright (C) 1994, 1995, 2001, 2002, 2003, 2004, 2005, 2006
+;; Copyright (C) 1994, 1995, 2001, 2002, 2003, 2004, 2005, 2006, 2007
 ;;   Free Software Foundation, Inc.
 
 ;; Author: Michael Kifer <kifer@cs.sunysb.edu>
 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 ;; Boston, MA 02110-1301, USA.
 
-;;; Synched up with: FSF Emacs 22.1 CVS 2006-09-15
+;;; Synched up with: FSF Emacs 22 CVS 2007-03-30
 
 ;;; Commentary:
 

File cal-xemacs.el

 ;;; cal-xemacs.el --- calendar functions for menu bar and popup menu support
 ;;; Original file is cal-menu.el.
 
-;; Copyright (C) 1994, 1995, 2001, 2002, 2003, 2004, 2005, 2006
+;; Copyright (C) 1994, 1995, 2001, 2002, 2003, 2004, 2005, 2006, 2007
 ;;   Free Software Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 ;; Boston, MA 02110-1301, USA.
 
-;;; Synched up with: FSF Emacs 22.1 CVS 2006-09-15
+;;; Synched up with: FSF Emacs 22 CVS 2007-03-30
 ;;; The Emacs counterpart is named cal-menu.el
 
 ;;; Commentary:
 ;;; calendar.el --- calendar functions
 
 ;; Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1997,
-;;   2000, 2001, 2002, 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+;;   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007  Free Software Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
 ;; Maintainer: Glenn Morris <rgm@gnu.org>
 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 ;; Boston, MA 02110-1301, USA.
 
-;;; Synched up with: FSF Emacs 22.1 CVS 2006-09-15
+;;; Synched up with: FSF Emacs 22 CVS 2007-03-30
 
 ;;; Commentary:
 
 ;;       appt.el                       Appointment notification
 ;;       cal-china.el                  Chinese calendar
 ;;       cal-coptic.el                 Coptic/Ethiopic calendars
-;;       cal-dst.el                    Daylight savings time rules
+;;       cal-dst.el                    Daylight saving time rules
 ;;       cal-hebrew.el                 Hebrew calendar
 ;;       cal-islam.el                  Islamic calendar
 ;;       cal-bahai.el                  Baha'i calendar
   :type 'boolean
   :group 'holidays)
 
+(defcustom calendar-mode-hook nil
+  "Hook run when entering `calendar-mode'."
+:type 'hook
+:group 'calendar-hooks)
+
 ;;;###autoload
 (defcustom calendar-load-hook nil
   "List of functions to be called after the calendar is first loaded.
   :type 'hook
   :group 'diary)
 
+(autoload 'diary-set-maybe-redraw "diary-lib")
+
 ;;;###autoload
 (defcustom diary-display-hook nil
   "List of functions that handle the display of the diary.
 diary buffer, set the variable `diary-list-include-blanks' to t."
   :type 'hook
   :options '(fancy-diary-display)
+:initialize 'custom-initialize-default
+:set 'diary-set-maybe-redraw
   :group 'diary)
 
 ;;;###autoload
       (funcall
        'holiday-sexp
         calendar-daylight-savings-starts
-        '(format "Daylight Savings Time Begins %s"
+        '(format "Daylight Saving Time Begins %s"
                   (if (fboundp 'atan)
                       (solar-time-string
                        (/ calendar-daylight-savings-starts-time (float 60))
     (funcall
      'holiday-sexp
      calendar-daylight-savings-ends
-     '(format "Daylight Savings Time Ends %s"
+     '(format "Daylight Saving Time Ends %s"
               (if (fboundp 'atan)
                   (solar-time-string
                    (/ calendar-daylight-savings-ends-time (float 60))
 
 (defvar calendar-mode-line-format
   (list
-   (propertize (substitute-command-keys
-		"\\<calendar-mode-map>\\[scroll-calendar-left]")
+   (propertize "<"
 	       'help-echo "mouse-2: scroll left"
                'mouse-face 'modeline-mousable
 	       'keymap (cal-make-mode-line-mouse-map 'button2
      'mouse-face 'modeline-mousable
      'keymap (cal-make-mode-line-mouse-map 'button2 #'calendar-goto-today)))
    '(calendar-date-string (calendar-current-date) t)
-   (propertize (substitute-command-keys
-		"\\<calendar-mode-map>\\[scroll-calendar-right]")
+   (propertize ">"
                'help-echo "mouse-2: scroll right"
                'mouse-face 'modeline-mousable
                'keymap (cal-make-mode-line-mouse-map

File diary-lib.el

 ;;; diary-lib.el --- diary functions
 
 ;; Copyright (C) 1989, 1990, 1992, 1993, 1994, 1995, 2001, 2002, 2003,
-;;   2004, 2005, 2006  Free Software Foundation, Inc.
+;;   2004, 2005, 2006, 2007  Free Software Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
 ;; Maintainer: Glenn Morris <rgm@gnu.org>
 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 ;; Boston, MA 02110-1301, USA.
 
-;;; Synched up with: FSF Emacs 22.1 CVS 2006-09-15
+;;; Synched up with: FSF Emacs 22 CVS 2007-03-30
 ;;; XEmacs has extra function `diary-countdown'
 
 ;;; Commentary:
 ;; This can be removed once the kill/yank treatment of invisible text
 ;; (see etc/TODO) is fixed. -- gm
 (defcustom diary-header-line-flag t
-  "If non-nil, `diary-simple-display' will show a header line.
+  "If non-nil, `simple-diary-display' will show a header line.
 The format of the header is specified by `diary-header-line-format'."
   :group   'diary
   :type    'boolean
+:initialize 'custom-initialize-default
+:set 'diary-set-maybe-redraw
   :version "22.1")
 
 (defvar diary-selective-display nil)
 before edit/copy"
                    "Diary"))
            ?\s (frame-width)))
-  "Format of the header line displayed by `diary-simple-display'.
+  "Format of the header line displayed by `simple-diary-display'.
 Only used if `diary-header-line-flag' is non-nil."
   :group   'diary
   :type    'sexp
 
 (defvar diary-saved-point)		; internal
 
+;; The first version of this also checked for diary-selective-display
+;; in the non-fancy case. This was an attempt to distinguish between
+;; displaying the diary and just visiting the diary file. However,
+;; when using fancy diary, calling diary when there are no entries to
+;; display does not create the fancy buffer, nor does it switch on
+;; selective-display in the diary buffer. This means some
+;; customizations will not take effect, eg:
+;; http://lists.gnu.org/archive/html/emacs-pretest-bug/2007-03/msg00466.html
+;; So the check for selective-display was dropped. This means the
+;; diary will be displayed if one customizes a diary variable while
+;; just visiting the diary-file. This is i) unlikely, and ii) no great loss.
+(defun diary-live-p ()
+  "Return non-nil if the diary is being displayed."
+  (or (get-buffer fancy-diary-buffer)
+      (and diary-file
+           (find-buffer-visiting (substitute-in-file-name diary-file)))))
+
+(defun diary-set-maybe-redraw (symbol value)
+  "Set SYMBOL's value to VALUE, and redraw the diary if necessary.
+Redraws the diary if it is being displayed (note this is not the same as
+just visiting the `diary-file'), and SYMBOL's value is to be changed."
+  (let ((oldvalue (eval symbol)))
+    (custom-set-default symbol value)
+    (and (not (equal value oldvalue))
+         (diary-live-p)
+         ;; Note this assumes diary was called without prefix arg.
+         (diary))))
 
 (defcustom number-of-diary-entries 1
   "Specifies how many days of diary entries are to be displayed initially.
 day's and the next day's entries will be displayed.
 
 The value can also be a vector such as [0 2 2 2 2 4 1]; this value
-says to display no diary entries on Sunday, the display the entries
-for the current date and the day after on Monday through Thursday,
-display Friday through Monday's entries on Friday, and display only
-Saturday's entries on Saturday.
+says to display no diary entries on Sunday, the entries for
+the current date and the day after on Monday through Thursday,
+Friday through Monday's entries on Friday, and only Saturday's
+entries on Saturday.
 
 This variable does not affect the diary display with the `d' command
 from the calendar; in that case, the prefix argument controls the
 			 (integer :tag "Thursday")
 			 (integer :tag "Friday")
 			 (integer :tag "Saturday")))
+:initialize 'custom-initialize-default
+:set 'diary-set-maybe-redraw
   :group 'diary)
 
 
             (or (verify-visited-file-modtime diary-buffer)
                 (revert-buffer t t))))
         ;; Setup things like the header-line-format and invisibility-spec.
-        (when (eq major-mode default-major-mode) (diary-mode))
+        ;; This used to only run if the major-mode was default-major-mode,
+        ;; but that meant eg changes to header-line-format did not
+        ;; take effect from one diary invocation to the next.
+        (diary-mode)
         ;; d-s-p is passed to the diary display function.
         (let ((diary-saved-point (point)))
           (save-excursion
 ;;; holidays.el --- holiday functions for the calendar package
 
 ;; Copyright (C) 1989, 1990, 1992, 1993, 1994, 1997, 2001, 2002, 2003,
-;;   2004, 2005, 2006  Free Software Foundation, Inc.
+;;   2004, 2005, 2006, 2007  Free Software Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
 ;; Maintainer: Glenn Morris <rgm@gnu.org>
 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 ;; Boston, MA 02110-1301, USA.
 
-;;; Synched up with: FSF Emacs 22.1 CVS 2006-09-15
+;;; Synched up with: FSF Emacs 22 CVS 2007-03-30
 
 ;;; Commentary:
 

File icalendar.el

 ;;; icalendar.el --- iCalendar implementation -*-coding: utf-8 -*-
 
-;; Copyright (C) 2002, 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007  Free Software Foundation, Inc.
 
 ;; Author:         Ulf Jasper <ulf.jasper@web.de>
 ;; Created:        August 2002
 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 ;; Boston, MA 02110-1301, USA.
 
-;;; Synched up with: FSF Emacs 22.1 CVS 2006-09-15
+;;; Synched up with: FSF Emacs 22 CVS 2007-03-30
 
 ;;; Commentary:
 
 
 ;;; Code:
 
-(defconst icalendar-version "0.14"
+(defconst icalendar-version "0.15"
   "Version number of icalendar.el.")
 
 ;; ======================================================================
         (replace-match "" nil nil)))
     unfolded-buffer))
 
-;; XEmacs change.   
-;; As originally written, icalendar--rris assumed replace-regexp-in-string
-;; and replace-in-string used the same number of args and in the same order. 
-;; They don't, so expand the args and use the appropriate ones. 
-(defsubst icalendar--rris (regexp newtext str &optional fixed-case literal)
+(defsubst icalendar--rris (regexp rep string &optional fixedcase literal)
   "Replace regular expression in string.
-Pass ARGS to `replace-regexp-in-string' (Emacs) or to
-`replace-in-string' (XEmacs)."
-  (if (fboundp 'replace-regexp-in-string)
-      ;; Emacs:
-      ;;(apply 'replace-regexp-in-string args)
-      ;; XEmacs change, use the args
-      (replace-regexp-in-string regexp newtext str args fixed-case literal)
-    ;; XEmacs:
-    (save-match-data ;; apparently XEmacs needs save-match-data
-      ;;(apply 'replace-in-string args))))
-      ;; XEmacs change, use the args
-      (replace-in-string str regexp newtext literal ))))
+Pass arguments REGEXP REP STRING FIXEDCASE LITERAL to
+`replace-regexp-in-string' (Emacs) or to `replace-in-string' (XEmacs)."
+  (cond ((fboundp 'replace-regexp-in-string)
+         ;; Emacs:
+         (replace-regexp-in-string regexp rep string fixedcase literal))
+        ((fboundp 'replace-in-string)
+         ;; XEmacs:
+         (save-match-data ;; apparently XEmacs needs save-match-data
+           (replace-in-string string regexp rep literal)))))
 
 (defun icalendar--read-element (invalue inparams)
   "Recursively read the next iCalendar element in the current buffer.
 DIARY-FILE.
 
 It will ask for each appointment whether to add it to the diary
-when DO-NOT-ASK is non-nil.  When called interactively,
-DO-NOT-ASK is set to t, so that you are asked fore each event.
+unless DO-NOT-ASK is non-nil.  When called interactively,
+DO-NOT-ASK is nil, so that you are asked for each event.
 
 NON-MARKING determines whether diary events are created as
 non-marking.
                         (concat diary-string " "
                                 (icalendar--format-ical-event e)))
                   (if do-not-ask (setq summary nil))
-                  (icalendar--add-diary-entry diary-string diary-file
-                                              non-marking summary))
+                  ;; add entry to diary and store actual name of diary
+                  ;; file (in case it was nil)
+                  (setq diary-file
+                        (icalendar--add-diary-entry diary-string diary-file
+                                                    non-marking summary)))
               ;; event was not ok
               (setq found-error t)
               (setq error-string
          (setq error-string (format "%s\n%s\nCannot handle this event: %s"
                                     error-val error-string e))
          (message "%s" error-string))))
+
     ;; insert final newline
-    (let ((b (find-buffer-visiting diary-file)))
-      (when b
-        (save-current-buffer
-          (set-buffer b)
-          (goto-char (point-max))
-          (insert "\n"))))
+    (if diary-file
+        (let ((b (find-buffer-visiting diary-file)))
+          (when b
+            (save-current-buffer
+              (set-buffer b)
+              (goto-char (point-max))
+              (insert "\n")))))
     (if found-error
         (save-current-buffer
           (set-buffer (get-buffer-create "*icalendar-errors*"))
         (setq diary-file
               (read-file-name "Add appointment to this diary file: ")))
       ;; Note: make-diary-entry will add a trailing blank char.... :(
-      (make-diary-entry string non-marking diary-file))))
+      (make-diary-entry string non-marking diary-file)))
+  ;; return diary-file in case it has been changed interactively
+  diary-file)
 
 (provide 'icalendar)
 
 ;;; lunar.el --- calendar functions for phases of the moon
 
 ;; Copyright (C) 1992, 1993, 1995, 1997, 2001, 2002, 2003, 2004, 2005,
-;;   2006  Free Software Foundation, Inc.
+;;   2006, 2007  Free Software Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
 ;; Maintainer: Glenn Morris <rgm@gnu.org>
 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 ;; Boston, MA 02110-1301, USA.
 
-;;; Synched up with: FSF Emacs 22.1 CVS 2006-09-15
+;;; Synched up with: FSF Emacs 22 CVS 2007-03-30
 
 ;;; Commentary:
 
   "Astronomical (Julian) day number of first new moon on or after astronomical
 \(Julian) day number d.  The fractional part is the time of day.
 
-The date and time are local time, including any daylight savings rules,
+The date and time are local time, including any daylight saving rules,
 as governed by the values of calendar-daylight-savings-starts,
 calendar-daylight-savings-starts-time, calendar-daylight-savings-ends,
 calendar-daylight-savings-ends-time, calendar-daylight-time-offset, and
 ;;; solar.el --- calendar functions for solar events
 
 ;; Copyright (C) 1992, 1993, 1995, 1997, 2001, 2002, 2003, 2004, 2005,
-;;   2006  Free Software Foundation, Inc.
+;;   2006, 2007  Free Software Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
 ;;	Denis B. Roegel <Denis.Roegel@loria.fr>
 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 ;; Boston, MA 02110-1301, USA.
 
-;;; Synched up with: FSF Emacs 22.1 CVS 2006-09-15
+;;; Synched up with: FSF Emacs 22 CVS 2007-03-30
 
 ;;; Commentary:
 
 (defun solar-date-next-longitude (d l)
   "First moment on or after Julian day number D when sun's longitude is a
 multiple of L degrees at calendar-location-name with that location's
-local time (including any daylight savings rules).
+local time (including any daylight saving rules).
 
 L must be an integer divisor of 360.
 

File timeclock.el

 ;;; timeclock.el --- mode for keeping track of how much you work
 
-;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
 ;;   Free Software Foundation, Inc.
 
 ;; Author: John Wiegley <johnw@gnu.org>
 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 ;; Boston, MA 02110-1301, USA.
 
-;;; Synched up with: FSF Emacs 22.1 CVS 2006-09-15
+;;; Synched up with: FSF Emacs 22 CVS 2007-03-30
 ;;; and contrib/timeclock.el from
 ;;; http://arch.gna.org/planner-el/archive-2006/planner-el--devel--0/
 

File todo-mode.el

 ;;; todo-mode.el --- major mode for editing TODO list files
 
-;; Copyright (C) 1997, 1999, 2001, 2002, 2003, 2004, 2005, 2006
+;; Copyright (C) 1997, 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007
 ;;   Free Software Foundation, Inc.
 
 ;; Author: Oliver Seidel <os10000@seidel-space.de>
 ;;	Oliver Seidel
 ;;	(Lessingstr. 8, 65760 Eschborn, Federal Republic of Germany)
 
-;;; Synched up with: FSF Emacs 22.1 CVS 2006-09-15
+;;; Synched up with: FSF Emacs 22 CVS 2007-03-30
 
 ;;; Code: