]> git.eshelyaron.com Git - emacs.git/commitdiff
Make cl-values-list signal an error if its argument isn't a list
authorLars Ingebrigtsen <larsi@gnus.org>
Sun, 28 Jul 2019 12:14:46 +0000 (14:14 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 28 Jul 2019 12:14:46 +0000 (14:14 +0200)
* lisp/emacs-lisp/cl-lib.el (cl-values-list): Signal an error if
LIST isn't a list (bug#23597).

etc/NEWS
lisp/emacs-lisp/cl-lib.el

index e79a6ec99747510e2f7b2f319b585d8591eecf05..48b1a35cab0da36b71d4ef92e72b5958c1efb2cb 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -536,6 +536,10 @@ be functions.
 *** 'cl-defstruct' has a new ':noinline' argument to prevent inlining
 its functions.
 
+---
+*** `cl-values-list' will now signal an error if its argument isn't a
+list.
+
 ** doc-view.el
 *** New commands 'doc-view-presentation' and 'doc-view-fit-window-to-page'.
 *** Added support for password-protected PDF files
index f014f8e01042e3dd62877386ae9ec6b1e32c3ad1..7b22fa8483a618796e3e5d8f5164ade952136b4e 100644 (file)
@@ -189,12 +189,16 @@ that the containing function should return.
 
 \(fn &rest VALUES)")
 
-(cl--defalias 'cl-values-list #'identity
+(defun cl-values-list (list)
   "Return multiple values, Common Lisp style, taken from a list.
-LIST specifies the list of values
-that the containing function should return.
-
-\(fn LIST)")
+LIST specifies the list of values that the containing function
+should return.
+
+Note that Emacs Lisp doesn't really support multiple values, so
+all this function does is return LIST."
+  (unless (listp list)
+    (signal 'wrong-type-argument list))
+  list)
 
 (defsubst cl-multiple-value-list (expression)
   "Return a list of the multiple values produced by EXPRESSION.