[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master f82ae2f: Make cl-values-list signal an error if its
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] master f82ae2f: Make cl-values-list signal an error if its argument isn't a list |
Date: |
Sun, 28 Jul 2019 08:15:48 -0400 (EDT) |
branch: master
commit f82ae2fc87e948f173941981e48da3daf7e65e96
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>
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 e79a6ec..48b1a35 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 f014f8e..7b22fa8 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.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master f82ae2f: Make cl-values-list signal an error if its argument isn't a list,
Lars Ingebrigtsen <=