CVS update by jmiller packages/xemacs-packages/calendar, calendar.el ...

xemacs-cvs at xemacs.org xemacs-cvs at xemacs.org
Sat Jan 27 16:43:28 EST 2007


  User: jmiller 
  Date: 07/01/27 22:43:28

  Modified:    packages/xemacs-packages/calendar ChangeLog cal-dst.el
                        calendar.el icalendar.el
Log:
Further Emacs CVS syncs & bug fixes

Revision  Changes    Path
1.47      +32 -2     XEmacs/packages/xemacs-packages/calendar/ChangeLog

Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/calendar/ChangeLog,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -p -r1.46 -r1.47
--- ChangeLog	2006/11/23 10:32:16	1.46
+++ ChangeLog	2007/01/27 21:43:26	1.47
@@ -1,8 +1,38 @@
+2007-01-23  Jeff Miller  <jeff.miller at xemacs.org>
+
+        * icalendar.el (icalendar--rris): Fixed improper argument usage
+	for replace-string.
+        * ChangeLog: restores Adrian Aichner original ChangeLog dates.
+
+2007-01-08  Juanma Barranquero  <lekktu at gmail.com>
+
+        * calendar/icalendar.el (icalendar-import-buffer):Fix typo in
+	docstring.
+        
+2006-12-24  Kevin Ryde  <user42 at zip.com.au>
+
+        * calendar/cal-dst.el (calendar-dst-starts): Default to second
+	Sunday in March.
+        (calendar-dst-ends): Default to first Sunday in November.
+
+2006-12-23  Chong Yidong  <cyd at stupidchicken.com>
+
+        * calendar/calendar.el (calendar-mode-map): Switch < and >.
+        (calendar-mode-line-format): Use mouse-1 bindings, and tweak
+        formatting.
+
+2006-12-17  Ulf Jasper  <ulf.jasper at web.de>
+
+        * calendar/icalendar.el (icalendar-version): Increase to "0.14".
+        (icalendar--rris): First try Emacs, then XEmacs.
+        (icalendar--convert-ical-to-diary): Doc fix.  Insert
+        newline at end of target file.
+
 2006-11-23  Norbert Koch  <viteno at xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 1.30 released.
 
-2006-11-22  Adrian Aichner  <adrian at xemacs.org>
+2006-10-16  Adrian Aichner  <adrian at xemacs.org>
 
         * timeclock.el: Typo fixes.
         * timeclock.el (timeclock-history): New.
@@ -13,7 +43,7 @@
         * timeclock.el (timeclock-find-discrep): Report line number of
         discrepancy to ease manual fixing.
 
-2006-11-22  Adrian Aichner  <adrian at xemacs.org>
+2006-08-01  Adrian Aichner  <adrian at xemacs.org>
 
 	* timeclock.el: Keep timeclock-file buffer around, so that an
 	encrypted timeclock-file does not have to be opened on each



1.8       +6 -3      XEmacs/packages/xemacs-packages/calendar/cal-dst.el

Index: cal-dst.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/calendar/cal-dst.el,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -p -r1.7 -r1.8
--- cal-dst.el	2006/11/13 04:22:11	1.7
+++ cal-dst.el	2007/01/27 21:43:26	1.8
@@ -55,7 +55,8 @@ change."
 :group 'calendar)
 
 (defvar calendar-current-time-zone-cache nil
-  "Cache for result of calendar-current-time-zone.")
+  "Cache for result of `calendar-current-time-zone'.")
+(put 'calendar-current-time-zone-cache 'risky-local-variable t)
 
 (defvar calendar-system-time-basis
   (calendar-absolute-from-gregorian '(1 1 1970))
@@ -347,8 +348,9 @@ This function respects the value of `cal
                       (cadr (calendar-dst-find-startend year))
                     (nth 4 calendar-current-time-zone-cache))))
         (if expr (eval expr)))
+      ;; New US rules commencing 2007.	ftp://elsie.nci.nih.gov/pub/.
       (and (not (zerop calendar-daylight-time-offset))
-           (calendar-nth-named-day 1 0 4 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.
@@ -357,8 +359,9 @@ This function respects the value of `cal
                       (nth 2 (calendar-dst-find-startend year))
                     (nth 5 calendar-current-time-zone-cache))))
         (if expr (eval expr)))
+      ;; New US rules commencing 2007.	ftp://elsie.nci.nih.gov/pub/.
       (and (not (zerop calendar-daylight-time-offset))
-           (calendar-nth-named-day -1 0 10 year))))
+           (calendar-nth-named-day 1 0 11 year))))
 
 
 ;;;###autoload



1.14      +4 -4      XEmacs/packages/xemacs-packages/calendar/calendar.el

Index: calendar.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/calendar/calendar.el,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -p -r1.13 -r1.14
--- calendar.el	2006/11/19 00:31:23	1.13
+++ calendar.el	2007/01/27 21:43:26	1.14
@@ -2213,12 +2213,12 @@ movement commands will not work correctl
                  downcase-region upcase-region kill-region
                  copy-region-as-kill capitalize-region write-region))
       (define-key map (vector 'remap c) 'calendar-not-implemented))
-    (define-key map ">"     'scroll-calendar-right)
-    (define-key map "\C-x>" 'scroll-calendar-right)
+    (define-key map "<"     'scroll-calendar-right)
+    (define-key map "\C-x<" 'scroll-calendar-right)
     (define-key map [prior] 'scroll-calendar-right-three-months)
     (define-key map "\ev"   'scroll-calendar-right-three-months)
-    (define-key map "<"     'scroll-calendar-left)
-    (define-key map "\C-x<" 'scroll-calendar-left)
+    (define-key map ">"     'scroll-calendar-left)
+    (define-key map "\C-x>" 'scroll-calendar-left)
     (define-key map [next]  'scroll-calendar-left-three-months)
     (define-key map "\C-v"  'scroll-calendar-left-three-months)
     (define-key map "\C-b"  'calendar-backward-day)



1.2       +33 -14    XEmacs/packages/xemacs-packages/calendar/icalendar.el

Index: icalendar.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/calendar/icalendar.el,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- icalendar.el	2006/10/23 01:25:29	1.1
+++ icalendar.el	2007/01/27 21:43:26	1.2
@@ -75,6 +75,10 @@
 
 ;;  * Import from ical to diary:
 ;;    + Need more properties for icalendar-import-format
+;;      (added all that Mozilla Calendar uses)
+;;      From iCal specifications (RFC2445: 4.8.1), icalendar.el lacks
+;;      ATTACH, CATEGORIES, COMMENT, GEO, PERCENT-COMPLETE (VTODO),
+;;      PRIORITY, RESOURCES) not considering date/time and time-zone
 ;;    + check vcalendar version
 ;;    + check (unknown) elements
 ;;    + recurring events!
@@ -99,7 +103,7 @@
 
 ;;; Code:
 
-(defconst icalendar-version "0.13"
+(defconst icalendar-version "0.14"
   "Version number of icalendar.el.")
 
 ;; ======================================================================
@@ -224,16 +228,24 @@ buffer."
         (replace-match "" nil nil)))
     unfolded-buffer))
 
-(defsubst icalendar--rris (&rest args)
+;; 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)
   "Replace regular expression in string.
 Pass ARGS to `replace-regexp-in-string' (Emacs) or to
 `replace-in-string' (XEmacs)."
-  ;; XEmacs:
-  (if (fboundp 'replace-in-string)
-      (save-match-data ;; apparently XEmacs needs save-match-data
-        (apply 'replace-in-string args))
-    ;; Emacs:
-    (apply 'replace-regexp-in-string args)))
+  (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 ))))
 
 (defun icalendar--read-element (invalue inparams)
   "Recursively read the next iCalendar element in the current buffer.
@@ -707,7 +719,7 @@ would be \"pm\"."
   "Export diary file to iCalendar format.
 All diary entries in the file DIARY-FILENAME are converted to iCalendar
 format.  The result is appended to the file ICAL-FILENAME."
-  (interactive "FExport diary data from file: 
+  (interactive "FExport diary data from file:
 Finto iCalendar file: ")
   (save-current-buffer
     (set-buffer (find-file diary-filename))
@@ -1451,8 +1463,8 @@ Argument ICAL-FILENAME output iCalendar 
 Argument DIARY-FILENAME input `diary-file'.
 Optional argument NON-MARKING determines whether events are created as
 non-marking or not."
-  (interactive "fImport iCalendar data from file: 
-Finto diary file: 
+  (interactive "fImport iCalendar data from file:
+Finto diary file:
 p")
   ;; clean up the diary file
   (save-current-buffer
@@ -1477,7 +1489,7 @@ NON-MARKING determines whether diary eve
 non-marking.
 
 Return code t means that importing worked well, return code nil
-means that an error has occured.  Error messages will be in the
+means that an error has occurred.  Error messages will be in the
 buffer `*icalendar-errors*'."
   (interactive)
   (save-current-buffer
@@ -1506,7 +1518,7 @@ buffer `*icalendar-errors*'."
                   (set-buffer b)
                   (save-buffer)))))
           (message "Converting icalendar...done")
-          ;; return t if no error occured
+          ;; return t if no error occurred
           (not ical-errors))
       (message
        "Current buffer does not contain icalendar contents!")
@@ -1551,7 +1563,7 @@ buffer `*icalendar-errors*'."
 (defun icalendar--convert-ical-to-diary (ical-list diary-file
                                                    &optional do-not-ask
                                                    non-marking)
-  "Convert Calendar data to an Emacs diary file.
+  "Convert iCalendar data to an Emacs diary file.
 Import VEVENTS from the iCalendar object ICAL-LIST and saves them to a
 DIARY-FILE.  If DO-NOT-ASK is nil the user is asked for each event
 whether to actually import it.  NON-MARKING determines whether diary
@@ -1682,6 +1694,13 @@ written into the buffer `*icalendar-erro
          (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 found-error
         (save-current-buffer
           (set-buffer (get-buffer-create "*icalendar-errors*"))





More information about the XEmacs-CVS mailing list