aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/calendar/parse-time.el
diff options
context:
space:
mode:
authorAndreas Schwab2012-02-25 11:00:08 +0100
committerAndreas Schwab2012-02-25 11:00:08 +0100
commitf008086fd23420f0ea9d030b7efd827e6fe551b4 (patch)
tree62b4c96e3a83610114d5e0f3e4c050aeda8ba09b /lisp/calendar/parse-time.el
parentd268b4fe42f1fdb3fb9c641db62b94422f0265ba (diff)
downloademacs-f008086fd23420f0ea9d030b7efd827e6fe551b4.tar.gz
emacs-f008086fd23420f0ea9d030b7efd827e6fe551b4.zip
* 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."
193 (predicate (pop rule)) 193 (predicate (pop rule))
194 (parse-time-val)) 194 (parse-time-val))
195 (when (and (not (nth (car slots) time)) ;not already set 195 (when (and (not (nth (car slots) time)) ;not already set
196 (setq parse-time-val (cond ((and (consp predicate) 196 (setq parse-time-val
197 (not (eq (car predicate) 197 (cond ((and (consp predicate)
198 'lambda))) 198 (not (eq (car predicate)
199 (and (numberp parse-time-elt) 199 'lambda)))
200 (<= (car predicate) parse-time-elt) 200 (and (numberp parse-time-elt)
201 (<= parse-time-elt (cadr predicate)) 201 (<= (car predicate) parse-time-elt)
202 parse-time-elt)) 202 (<= parse-time-elt (cadr predicate))
203 ((symbolp predicate) 203 parse-time-elt))
204 (cdr (assoc parse-time-elt 204 ((symbolp predicate)
205 (symbol-value predicate)))) 205 (cdr (assoc parse-time-elt
206 ((funcall predicate))))) 206 (symbol-value predicate))))
207 ((funcall predicate)))))
207 (setq exit t) 208 (setq exit t)
208 (while slots 209 (while slots
209 (let ((new-val (and rule 210 (let ((new-val (if rule
210 (let ((this (pop rule))) 211 (let ((this (pop rule)))
211 (if (vectorp this) 212 (if (vectorp this)
212 (parse-integer 213 (parse-integer
213 parse-time-elt 214 parse-time-elt
214 (aref this 0) (aref this 1)) 215 (aref this 0) (aref this 1))
215 (funcall this)))))) 216 (funcall this)))
216 (rplaca (nthcdr (pop slots) time) 217 parse-time-val)))
217 (or new-val parse-time-val))))))))) 218 (rplaca (nthcdr (pop slots) time) new-val))))))))
218 time)) 219 time))
219 220
220(provide 'parse-time) 221(provide 'parse-time)