From f82ae2fc87e948f173941981e48da3daf7e65e96 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sun, 28 Jul 2019 14:14:46 +0200 Subject: [PATCH] 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). --- etc/NEWS | 4 ++++ lisp/emacs-lisp/cl-lib.el | 14 +++++++++----- 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. *** '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 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. \(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. -- 2.39.2