summaryrefslogtreecommitdiff
path: root/lisp/calendar/parse-time.el
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@linux-m68k.org>2012-02-25 11:00:08 +0100
committerAndreas Schwab <schwab@linux-m68k.org>2012-02-25 11:00:08 +0100
commitf008086fd23420f0ea9d030b7efd827e6fe551b4 (patch)
tree62b4c96e3a83610114d5e0f3e4c050aeda8ba09b /lisp/calendar/parse-time.el
parentd268b4fe42f1fdb3fb9c641db62b94422f0265ba (diff)
downloademacs-f008086fd23420f0ea9d030b7efd827e6fe551b4.tar.gz
* calendar/parse-time.el (parse-time-string): Allow extractor to
return nil.
Diffstat (limited to 'lisp/calendar/parse-time.el')
-rw-r--r--lisp/calendar/parse-time.el41
1 files changed, 21 insertions, 20 deletions
diff --git a/lisp/calendar/parse-time.el b/lisp/calendar/parse-time.el
index ab513517452..baf92065550 100644
--- a/lisp/calendar/parse-time.el
+++ b/lisp/calendar/parse-time.el
@@ -193,28 +193,29 @@ unknown are returned as nil."
(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)