------------------------------------------------------------ revno: 117130 committer: Michael Albinus branch nick: trunk timestamp: Tue 2014-05-20 10:25:18 +0200 message: * dbusbind.c (xd_signature): Revert last 2 patches. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-05-19 19:19:05 +0000 +++ src/ChangeLog 2014-05-20 08:25:18 +0000 @@ -1,3 +1,7 @@ +2014-05-20 Michael Albinus + + * dbusbind.c (xd_signature): Revert last 2 patches. + 2014-05-19 Paul Eggert Allow any non-nil value to count as true in bool-vector. === modified file 'src/dbusbind.c' --- src/dbusbind.c 2014-05-19 19:19:05 +0000 +++ src/dbusbind.c 2014-05-20 08:25:18 +0000 @@ -387,8 +387,8 @@ break; case DBUS_TYPE_BOOLEAN: - /* Every Emacs Lisp object serves as a boolean, so there's nothing - to check. */ + if (!EQ (object, Qt) && !EQ (object, Qnil)) + wrong_type_argument (intern ("booleanp"), object); sprintf (signature, "%c", dtype); break; ------------------------------------------------------------ revno: 117129 committer: Leo Liu branch nick: trunk timestamp: Tue 2014-05-20 08:59:36 +0800 message: * cl.texi (List Functions, Efficiency Concerns): Update cl-endp. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2014-05-13 23:15:48 +0000 +++ doc/misc/ChangeLog 2014-05-20 00:59:36 +0000 @@ -1,3 +1,7 @@ +2014-05-20 Leo Liu + + * cl.texi (List Functions, Efficiency Concerns): Update cl-endp. + 2014-05-13 Paul Eggert * texinfo.tex: Update from gnulib. === modified file 'doc/misc/cl.texi' --- doc/misc/cl.texi 2014-05-08 03:41:21 +0000 +++ doc/misc/cl.texi 2014-05-20 00:59:36 +0000 @@ -3679,10 +3679,8 @@ @end defun @defun cl-endp x -Common Lisp defines this function to act like @code{null}, but -signaling an error if @code{x} is neither a @code{nil} nor a -cons cell. This package simply defines @code{cl-endp} as a synonym -for @code{null}. +This function acts like @code{null}, but signals an error if @code{x} +is neither a @code{nil} nor a cons cell. @end defun @defun cl-list-length x @@ -4449,12 +4447,11 @@ encouraged but not required to signal an error in these situations. This package sometimes omits such error checking in the interest of compactness and efficiency. For example, @code{cl-do} variable -specifiers are supposed to be lists of one, two, or three forms; -extra forms are ignored by this package rather than signaling a -syntax error. The @code{cl-endp} function is simply a synonym for -@code{null} in this package. Functions taking keyword arguments -will accept an odd number of arguments, treating the trailing -keyword as if it were followed by the value @code{nil}. +specifiers are supposed to be lists of one, two, or three forms; extra +forms are ignored by this package rather than signaling a syntax +error. Functions taking keyword arguments will accept an odd number +of arguments, treating the trailing keyword as if it were followed by +the value @code{nil}. Argument lists (as processed by @code{cl-defun} and friends) @emph{are} checked rigorously except for the minor point just ------------------------------------------------------------ revno: 117128 committer: Paul Eggert branch nick: trunk timestamp: Mon 2014-05-19 12:19:05 -0700 message: 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. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-05-19 07:49:09 +0000 +++ doc/lispref/ChangeLog 2014-05-19 19:19:05 +0000 @@ -1,3 +1,9 @@ +2014-05-19 Paul Eggert + + Allow any non-nil value to count as true in bool-vector. + * sequences.texi (Bool-Vectors): Coalesce discussion of how to + print them. bool-vector's args need not be t or nil. + 2014-05-19 Dmitry Antipov * sequences.texi (Bool-vectors): Mention bool-vector. === modified file 'doc/lispref/sequences.texi' --- doc/lispref/sequences.texi 2014-05-19 07:49:09 +0000 +++ doc/lispref/sequences.texi 2014-05-19 19:19:05 +0000 @@ -811,7 +811,7 @@ and the length cannot be changed once the bool-vector is created. Bool-vectors are constants when evaluated. - There are three special functions for working with bool-vectors; aside + Several functions work specifically with bool-vectors; aside from that, you manipulate them with same functions used for other kinds of arrays. @@ -822,28 +822,7 @@ @defun bool-vector &rest objects This function creates and returns a bool-vector whose elements are the -arguments, @var{objects}, each of them should be either @code{t} or @code{nil}. -Note that the printed form represents up to 8 boolean values as a single -character: - -@example -@group -(bool-vector t nil t nil) - @result{} #&4"^E" -(bool-vector) - @result{} #&0"" -@end group -@end example - -If you want to print a bool-vector in a way similar to other vectors, -you can use @code{vconcat} function: - -@example -@group -(vconcat (bool-vector nil t nil t)) - @result{} [nil t nil t] -@end group -@end example +arguments, @var{objects}. @end defun @defun bool-vector-p object @@ -899,6 +878,27 @@ Return the number of elements that are @code{t} in bool vector @var{a}. @end defun + The printed form represents up to 8 boolean values as a single +character: + +@example +@group +(bool-vector t nil t nil) + @result{} #&4"^E" +(bool-vector) + @result{} #&0"" +@end group +@end example + +You can use @code{vconcat} to print a bool-vector like other vectors: + +@example +@group +(vconcat (bool-vector nil t nil t)) + @result{} [nil t nil t] +@end group +@end example + Here is another example of creating, examining, and updating a bool-vector: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-05-19 07:54:39 +0000 +++ src/ChangeLog 2014-05-19 19:19:05 +0000 @@ -1,3 +1,14 @@ +2014-05-19 Paul Eggert + + 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. + * alloc.c (Fbool_vector): Don't require args to be t or nil. + * dbusbind.c (xd_signature): Likewise, for booleans. + * data.c, lisp.h (Qbooleanp): + * lisp.h (CHECK_BOOLEAN): Remove. All uses removed. + 2014-05-19 Dmitry Antipov * lisp.h (CHECK_BOOLEAN): New function. === modified file 'src/alloc.c' --- src/alloc.c 2014-05-19 07:49:09 +0000 +++ src/alloc.c 2014-05-19 19:19:05 +0000 @@ -2177,16 +2177,12 @@ DEFUN ("bool-vector", Fbool_vector, Sbool_vector, 0, MANY, 0, doc: /* Return a new bool-vector with specified arguments as elements. Any number of arguments, even zero arguments, are allowed. -Each argument should be either t or nil. usage: (bool-vector &rest OBJECTS) */) (ptrdiff_t nargs, Lisp_Object *args) { ptrdiff_t i; Lisp_Object vector; - for (i = 0; i < nargs; i++) - CHECK_BOOLEAN (args[i]); - vector = make_uninit_bool_vector (nargs); for (i = 0; i < nargs; i++) bool_vector_set (vector, i, !NILP (args[i])); === modified file 'src/data.c' --- src/data.c 2014-05-19 07:49:09 +0000 +++ src/data.c 2014-05-19 19:19:05 +0000 @@ -54,7 +54,7 @@ Lisp_Object Qbeginning_of_buffer, Qend_of_buffer, Qbuffer_read_only; Lisp_Object Qtext_read_only; -Lisp_Object Qintegerp, Qwholenump, Qsymbolp, Qlistp, Qconsp, Qbooleanp; +Lisp_Object Qintegerp, Qwholenump, Qsymbolp, Qlistp, Qconsp; static Lisp_Object Qnatnump; Lisp_Object Qstringp, Qarrayp, Qsequencep, Qbufferp; Lisp_Object Qchar_or_string_p, Qmarkerp, Qinteger_or_marker_p, Qvectorp; @@ -3442,7 +3442,6 @@ DEFSYM (Qlistp, "listp"); DEFSYM (Qconsp, "consp"); - DEFSYM (Qbooleanp, "booleanp"); DEFSYM (Qsymbolp, "symbolp"); DEFSYM (Qkeywordp, "keywordp"); DEFSYM (Qintegerp, "integerp"); === modified file 'src/dbusbind.c' --- src/dbusbind.c 2014-05-19 07:49:09 +0000 +++ src/dbusbind.c 2014-05-19 19:19:05 +0000 @@ -387,7 +387,8 @@ break; case DBUS_TYPE_BOOLEAN: - CHECK_BOOLEAN (object); + /* Every Emacs Lisp object serves as a boolean, so there's nothing + to check. */ sprintf (signature, "%c", dtype); break; === modified file 'src/lisp.h' --- src/lisp.h 2014-05-19 07:49:09 +0000 +++ src/lisp.h 2014-05-19 19:19:05 +0000 @@ -796,7 +796,7 @@ /* Defined in data.c. */ extern Lisp_Object Qarrayp, Qbufferp, Qbuffer_or_string_p, Qchar_table_p; extern Lisp_Object Qconsp, Qfloatp, Qintegerp, Qlambda, Qlistp, Qmarkerp, Qnil; -extern Lisp_Object Qnumberp, Qstringp, Qsymbolp, Qt, Qvectorp, Qbooleanp; +extern Lisp_Object Qnumberp, Qstringp, Qsymbolp, Qt, Qvectorp; extern Lisp_Object Qbool_vector_p; extern Lisp_Object Qvector_or_char_table_p, Qwholenump; extern Lisp_Object Qwindow; @@ -2510,11 +2510,6 @@ CHECK_TYPE (CONSP (x), Qconsp, x); } INLINE void -CHECK_BOOLEAN (Lisp_Object x) -{ - CHECK_TYPE (EQ (x, Qt) || EQ (x, Qnil), Qbooleanp, x); -} -INLINE void CHECK_VECTOR (Lisp_Object x) { CHECK_TYPE (VECTORP (x), Qvectorp, x); ------------------------------------------------------------ revno: 117127 committer: Leo Liu branch nick: trunk timestamp: Tue 2014-05-20 00:08:40 +0800 message: * emacs-lisp/cl-lib.el (cl-endp): Conform to CL's semantics. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-05-18 22:57:37 +0000 +++ lisp/ChangeLog 2014-05-19 16:08:40 +0000 @@ -1,3 +1,7 @@ +2014-05-19 Leo Liu + + * emacs-lisp/cl-lib.el (cl-endp): Conform to CL's semantics. + 2014-05-18 Glenn Morris * loadup.el: === modified file 'lisp/emacs-lisp/cl-lib.el' --- lisp/emacs-lisp/cl-lib.el 2014-04-22 03:18:15 +0000 +++ lisp/emacs-lisp/cl-lib.el 2014-05-19 16:08:40 +0000 @@ -358,7 +358,13 @@ (cl--defalias 'cl-first 'car) (cl--defalias 'cl-second 'cadr) (cl--defalias 'cl-rest 'cdr) -(cl--defalias 'cl-endp 'null) + +(defun cl-endp (x) + "Return true if X is the empty list; false if it is a cons. +Signal an error if X is not a list." + (if (listp x) + (null x) + (signal 'wrong-type-argument (list 'list x 'x)))) (cl--defalias 'cl-third 'cl-caddr "Return the third element of the list X.") (cl--defalias 'cl-fourth 'cl-cadddr "Return the fourth element of the list X.") ------------------------------------------------------------ revno: 117126 committer: Dmitry Antipov branch nick: trunk timestamp: Mon 2014-05-19 11:54:39 +0400 message: * font.c (font_matching_entity): Extract font-entity object from the vector of matching entities (Bug#17486). diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-05-19 07:49:09 +0000 +++ src/ChangeLog 2014-05-19 07:54:39 +0000 @@ -7,6 +7,9 @@ (syms_of_data): DEFSYM it. * dbusbind.c (xd_signature): Use CHECK_BOOLEAN. + * font.c (font_matching_entity): Extract font-entity object + from the vector of matching entities (Bug#17486). + 2014-05-17 Paul Eggert Assume C99 or later (Bug#17487). === modified file 'src/font.c' --- src/font.c 2014-04-05 19:30:36 +0000 +++ src/font.c 2014-05-19 07:54:39 +0000 @@ -2803,7 +2803,7 @@ ASET (work, FONT_TYPE_INDEX, driver_list->driver->type); entity = assoc_no_quit (work, XCDR (cache)); if (CONSP (entity)) - entity = XCDR (entity); + entity = AREF (XCDR (entity), 0); else { entity = driver_list->driver->match (f, work);