(parse-time-syntax): Restore it to keep compatibility with XEmacs.
authorKatsumi Yamaoka <yamaoka@jpl.org>
Sun, 13 Sep 2009 23:31:56 +0000 (23:31 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Sun, 13 Sep 2009 23:31:56 +0000 (23:31 +0000)
(parse-time-string-chars): Use it.

lisp/ChangeLog
lisp/parse-time.el

index 669d50b..7a68620 100644 (file)
@@ -1,3 +1,9 @@
+2009-09-13  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * parse-time.el (parse-time-syntax): Restore it to keep compatibility
+       with XEmacs.
+       (parse-time-string-chars): Use it.
+
 2009-09-10  Teodor Zlatanov  <tzz@lifelogs.com>
 
        * imap.el (imap-interactive-login): Better messages.
 
        * nnrss.el (nnrss-request-article): Avoid default-fill-column.
 
+2009-08-26  Glenn Morris  <rgm@gnu.org>
+
+       * parse-time.el (parse-time-rules): Autoload riskiness here, rather
+       than placing in files.el.
+
 2009-08-25  Glenn Morris  <rgm@gnu.org>
 
        * nnir.el (top-level): Don't require cl at run-time.
        * gnus-art.el (gnus-button-patch): Use forward-line rather than
        goto-line.
 
+2009-08-16  Chong Yidong  <cyd@stupidchicken.com>
+
+       * parse-time.el (parse-time-string-chars): Save match data.
+
+2009-08-16  Jan Seeger  <jan.seeger@thenybble.de>  (tiny change)
+
+       * parse-time.el (parse-time-string-chars): Compute using character
+       classes, to handle non-ascii characters (Bug#3190).
+
 2009-08-12  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * gnus-group.el (gnus-safe-html-newsgroups): New user option.
index b0e8cac..441a8e9 100644 (file)
@@ -37,6 +37,7 @@
 
 (eval-when-compile (require 'cl))      ;and ah ain't kiddin' 'bout it
 
+(defvar parse-time-syntax (make-vector 256 nil))
 (defvar parse-time-digits (make-vector 256 nil))
 
 ;; Byte-compiler warnings
   (loop for i from ?0 to ?9
     do (aset parse-time-digits i (- i ?0))))
 
+(unless (aref parse-time-syntax ?0)
+  (loop for i from ?0 to ?9
+       do (aset parse-time-syntax i ?0))
+  (loop for i from ?A to ?Z
+       do (aset parse-time-syntax i ?A))
+  (loop for i from ?a to ?z
+       do (aset parse-time-syntax i ?a))
+  (aset parse-time-syntax ?+ 1)
+  (aset parse-time-syntax ?- -1)
+  (aset parse-time-syntax ?: ?d))
+
 (defsubst digit-char-p (char)
   (aref parse-time-digits char))
 
+;; Note: the function definition differs from the one in Emacs
+;; in order to keep the compatibility with XEmacs.
 (defsubst parse-time-string-chars (char)
-  (save-match-data
-    (let (case-fold-search str)
-      (cond ((eq char ?+) 1)
-           ((eq char ?-) -1)
-           ((eq char ?:) ?d)
-           ((string-match "[[:upper:]]" (setq str (string char))) ?A)
-           ((string-match "[[:lower:]]" str) ?a)
-           ((string-match "[[:digit:]]" str) ?0)))))
+  (and (< char (length parse-time-syntax))
+       (aref parse-time-syntax char)))
 
 (put 'parse-error 'error-conditions '(parse-error error))
 (put 'parse-error 'error-message "Parsing error")