diff options
| author | Paul Eggert | 2014-05-19 12:19:05 -0700 |
|---|---|---|
| committer | Paul Eggert | 2014-05-19 12:19:05 -0700 |
| commit | 2f1205e0848f7f6ed4578a36c656106a9ba69a8e (patch) | |
| tree | fb23d42169db84a5fb81730489281ce57475960d /src/alloc.c | |
| parent | 427de5355f3c70e60ddc65324f1270d533fca0c2 (diff) | |
| download | emacs-2f1205e0848f7f6ed4578a36c656106a9ba69a8e.tar.gz emacs-2f1205e0848f7f6ed4578a36c656106a9ba69a8e.zip | |
Allow any non-nil value to count as true in bool-vector.
Likewise for xd_signature in dbusbind.c.
This is more consistent with the usual practice in Emacs, which is
that any non-nil value counts as true.
* doc/lispref/sequences.texi (Bool-Vectors): Coalesce discussion of how to
print them. bool-vector's args need not be t or nil.
* src/alloc.c (Fbool_vector): Don't require args to be t or nil.
* src/dbusbind.c (xd_signature): Likewise, for booleans.
* src/data.c, lisp.h (Qbooleanp):
* src/lisp.h (CHECK_BOOLEAN): Remove. All uses removed.
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/src/alloc.c b/src/alloc.c index e808c3d4bf3..1dc33b72520 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -2177,16 +2177,12 @@ LENGTH must be a number. INIT matters only in whether it is t or nil. */) | |||
| 2177 | DEFUN ("bool-vector", Fbool_vector, Sbool_vector, 0, MANY, 0, | 2177 | DEFUN ("bool-vector", Fbool_vector, Sbool_vector, 0, MANY, 0, |
| 2178 | doc: /* Return a new bool-vector with specified arguments as elements. | 2178 | doc: /* Return a new bool-vector with specified arguments as elements. |
| 2179 | Any number of arguments, even zero arguments, are allowed. | 2179 | Any number of arguments, even zero arguments, are allowed. |
| 2180 | Each argument should be either t or nil. | ||
| 2181 | usage: (bool-vector &rest OBJECTS) */) | 2180 | usage: (bool-vector &rest OBJECTS) */) |
| 2182 | (ptrdiff_t nargs, Lisp_Object *args) | 2181 | (ptrdiff_t nargs, Lisp_Object *args) |
| 2183 | { | 2182 | { |
| 2184 | ptrdiff_t i; | 2183 | ptrdiff_t i; |
| 2185 | Lisp_Object vector; | 2184 | Lisp_Object vector; |
| 2186 | 2185 | ||
| 2187 | for (i = 0; i < nargs; i++) | ||
| 2188 | CHECK_BOOLEAN (args[i]); | ||
| 2189 | |||
| 2190 | vector = make_uninit_bool_vector (nargs); | 2186 | vector = make_uninit_bool_vector (nargs); |
| 2191 | for (i = 0; i < nargs; i++) | 2187 | for (i = 0; i < nargs; i++) |
| 2192 | bool_vector_set (vector, i, !NILP (args[i])); | 2188 | bool_vector_set (vector, i, !NILP (args[i])); |