emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r107424: * calendar/parse-time.el (pa


From: Andreas Schwab
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r107424: * calendar/parse-time.el (parse-time-string): Allow extractor to
Date: Sat, 25 Feb 2012 11:00:08 +0100
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107424
committer: Andreas Schwab <address@hidden>
branch nick: emacs
timestamp: Sat 2012-02-25 11:00:08 +0100
message:
  * calendar/parse-time.el (parse-time-string): Allow extractor to
  return nil.
modified:
  lisp/ChangeLog
  lisp/calendar/parse-time.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-02-25 08:51:32 +0000
+++ b/lisp/ChangeLog    2012-02-25 10:00:08 +0000
@@ -1,3 +1,8 @@
+2012-02-25  Andreas Schwab  <address@hidden>
+
+       * calendar/parse-time.el (parse-time-string): Allow extractor to
+       return nil.
+
 2012-02-25  Michael Albinus  <address@hidden>
 
        * net/tramp.el (tramp-file-name-for-operation): Add

=== modified file 'lisp/calendar/parse-time.el'
--- a/lisp/calendar/parse-time.el       2012-01-19 07:21:25 +0000
+++ b/lisp/calendar/parse-time.el       2012-02-25 10:00:08 +0000
@@ -193,28 +193,29 @@
                 (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
-               (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)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]