aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2019-07-28 14:14:46 +0200
committerLars Ingebrigtsen2019-07-28 14:14:46 +0200
commitf82ae2fc87e948f173941981e48da3daf7e65e96 (patch)
tree9c350d7397ac1be0c6905a4cb380593536bf8f3e
parent5289170ead27a168d41a12f09da6d9548729ec88 (diff)
downloademacs-f82ae2fc87e948f173941981e48da3daf7e65e96.tar.gz
emacs-f82ae2fc87e948f173941981e48da3daf7e65e96.zip
Make cl-values-list signal an error if its argument isn't a list
* lisp/emacs-lisp/cl-lib.el (cl-values-list): Signal an error if LIST isn't a list (bug#23597).
-rw-r--r--etc/NEWS4
-rw-r--r--lisp/emacs-lisp/cl-lib.el14
2 files changed, 13 insertions, 5 deletions
diff --git a/etc/NEWS b/etc/NEWS
index e79a6ec9974..48b1a35cab0 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -536,6 +536,10 @@ be functions.
536*** 'cl-defstruct' has a new ':noinline' argument to prevent inlining 536*** 'cl-defstruct' has a new ':noinline' argument to prevent inlining
537its functions. 537its functions.
538 538
539---
540*** `cl-values-list' will now signal an error if its argument isn't a
541list.
542
539** doc-view.el 543** doc-view.el
540*** New commands 'doc-view-presentation' and 'doc-view-fit-window-to-page'. 544*** New commands 'doc-view-presentation' and 'doc-view-fit-window-to-page'.
541*** Added support for password-protected PDF files 545*** Added support for password-protected PDF files
diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el
index f014f8e0104..7b22fa8483a 100644
--- a/lisp/emacs-lisp/cl-lib.el
+++ b/lisp/emacs-lisp/cl-lib.el
@@ -189,12 +189,16 @@ that the containing function should return.
189 189
190\(fn &rest VALUES)") 190\(fn &rest VALUES)")
191 191
192(cl--defalias 'cl-values-list #'identity 192(defun cl-values-list (list)
193 "Return multiple values, Common Lisp style, taken from a list. 193 "Return multiple values, Common Lisp style, taken from a list.
194LIST specifies the list of values 194LIST specifies the list of values that the containing function
195that the containing function should return. 195should return.
196 196
197\(fn LIST)") 197Note that Emacs Lisp doesn't really support multiple values, so
198all this function does is return LIST."
199 (unless (listp list)
200 (signal 'wrong-type-argument list))
201 list)
198 202
199(defsubst cl-multiple-value-list (expression) 203(defsubst cl-multiple-value-list (expression)
200 "Return a list of the multiple values produced by EXPRESSION. 204 "Return a list of the multiple values produced by EXPRESSION.