parse-time.el (parse-time-string): Allow extractor to return nil.
authorAndreas Schwab <schwab@linux-m68k.org>
Sat, 25 Feb 2012 13:18:12 +0000 (13:18 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Sat, 25 Feb 2012 13:18:12 +0000 (13:18 +0000)
lisp/ChangeLog
lisp/parse-time.el

index bf476f3..fec9e3f 100644 (file)
@@ -2,6 +2,10 @@
 
        * shr.el (shr-column-specs): Protect against TDs with "width: 0%".
 
 
        * shr.el (shr-column-specs): Protect against TDs with "width: 0%".
 
+2012-02-25  Andreas Schwab  <schwab@linux-m68k.org>
+
+       * parse-time.el (parse-time-string): Allow extractor to return nil.
+
 2012-02-23  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * nntp.el (nntp-send-authinfo): Work for secure nntp entry in authinfo.
 2012-02-23  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * nntp.el (nntp-send-authinfo): Work for secure nntp entry in authinfo.
index c731094..afaf1eb 100644 (file)
@@ -213,28 +213,29 @@ unknown are returned as nil."
                 (predicate (pop rule))
                 (parse-time-val))
            (when (and (not (nth (car slots) time)) ;not already set
                 (predicate (pop rule))
                 (parse-time-val))
            (when (and (not (nth (car slots) time)) ;not already set
-                      (setq parse-time-val (cond ((and (consp predicate)
-                                            (not (eq (car predicate)
-                                                     'lambda)))
-                                       (and (numberp parse-time-elt)
-                                            (<= (car predicate) parse-time-elt)
-                                            (<= parse-time-elt (cadr predicate))
-                                            parse-time-elt))
-                                      ((symbolp predicate)
-                                       (cdr (assoc parse-time-elt
-                                                   (symbol-value predicate))))
-                                      ((funcall predicate)))))
+                      (setq parse-time-val
+                            (cond ((and (consp predicate)
+                                        (not (eq (car predicate)
+                                                 'lambda)))
+                                   (and (numberp parse-time-elt)
+                                        (<= (car predicate) parse-time-elt)
+                                        (<= parse-time-elt (cadr predicate))
+                                        parse-time-elt))
+                                  ((symbolp predicate)
+                                   (cdr (assoc parse-time-elt
+                                               (symbol-value predicate))))
+                                  ((funcall predicate)))))
              (setq exit t)
              (while slots
              (setq exit t)
              (while slots
-               (let ((new-val (and rule
-                                   (let ((this (pop rule)))
-                                     (if (vectorp this)
-                                         (parse-integer
-                                          parse-time-elt
-                                          (aref this 0) (aref this 1))
-                                       (funcall this))))))
-                 (rplaca (nthcdr (pop slots) time)
-                         (or new-val parse-time-val)))))))))
+               (let ((new-val (if rule
+                                  (let ((this (pop rule)))
+                                    (if (vectorp this)
+                                        (parse-integer
+                                         parse-time-elt
+                                         (aref this 0) (aref this 1))
+                                      (funcall this)))
+                                parse-time-val)))
+                 (rplaca (nthcdr (pop slots) time) new-val))))))))
     time))
 
 (provide 'parse-time)
     time))
 
 (provide 'parse-time)