comparison lisp/subr.el @ 110710:deee083d1b01

* subr.el (booleanp): Return t instead of a list (Bug#7086).
author Chong Yidong <cyd@stupidchicken.com>
date Sat, 02 Oct 2010 21:11:20 -0400
parents 515d80e174ba
children 06aa6ebe38fa
comparison
equal deleted inserted replaced
110709:f07cd17d0a5a 110710:deee083d1b01
2418 "Return t if OBJECT is a string or nil. 2418 "Return t if OBJECT is a string or nil.
2419 Otherwise, return nil." 2419 Otherwise, return nil."
2420 (or (stringp object) (null object))) 2420 (or (stringp object) (null object)))
2421 2421
2422 (defun booleanp (object) 2422 (defun booleanp (object)
2423 "Return non-nil if OBJECT is one of the two canonical boolean values: t or nil." 2423 "Return t if OBJECT is one of the two canonical boolean values: t or nil.
2424 (memq object '(nil t))) 2424 Otherwise, return nil."
2425 (and (memq object '(nil t)) t))
2425 2426
2426 (defun field-at-pos (pos) 2427 (defun field-at-pos (pos)
2427 "Return the field at position POS, taking stickiness etc into account." 2428 "Return the field at position POS, taking stickiness etc into account."
2428 (let ((raw-field (get-char-property (field-beginning pos) 'field))) 2429 (let ((raw-field (get-char-property (field-beginning pos) 'field)))
2429 (if (eq raw-field 'boundary) 2430 (if (eq raw-field 'boundary)