From 81b1f9c9b79e05111fa5bc0fb8711e7d54067d14 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 16 Aug 2009 18:38:15 +0000 Subject: [PATCH] * calendar/parse-time.el (parse-time-string-chars): Save match data. --- lisp/ChangeLog | 5 +++++ lisp/calendar/parse-time.el | 15 ++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5c323349f72..341e2380381 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2009-08-16 Chong Yidong + + * calendar/parse-time.el (parse-time-string-chars): Save match + data. + 2009-08-16 Stefan Monnier * progmodes/sql.el (sql-product-alist): Add :name tag to entries. diff --git a/lisp/calendar/parse-time.el b/lisp/calendar/parse-time.el index 27a71269281..56a2fd715d2 100644 --- a/lisp/calendar/parse-time.el +++ b/lisp/calendar/parse-time.el @@ -51,13 +51,14 @@ (aref parse-time-digits char)) (defsubst parse-time-string-chars (char) - (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)))) + (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))))) (put 'parse-error 'error-conditions '(parse-error error)) (put 'parse-error 'error-message "Parsing error") -- 2.39.2