diff options
| author | Lars Ingebrigtsen | 2019-07-28 14:14:46 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-07-28 14:14:46 +0200 |
| commit | f82ae2fc87e948f173941981e48da3daf7e65e96 (patch) | |
| tree | 9c350d7397ac1be0c6905a4cb380593536bf8f3e | |
| parent | 5289170ead27a168d41a12f09da6d9548729ec88 (diff) | |
| download | emacs-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/NEWS | 4 | ||||
| -rw-r--r-- | lisp/emacs-lisp/cl-lib.el | 14 |
2 files changed, 13 insertions, 5 deletions
| @@ -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 |
| 537 | its functions. | 537 | its functions. |
| 538 | 538 | ||
| 539 | --- | ||
| 540 | *** `cl-values-list' will now signal an error if its argument isn't a | ||
| 541 | list. | ||
| 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. |
| 194 | LIST specifies the list of values | 194 | LIST specifies the list of values that the containing function |
| 195 | that the containing function should return. | 195 | should return. |
| 196 | 196 | ||
| 197 | \(fn LIST)") | 197 | Note that Emacs Lisp doesn't really support multiple values, so |
| 198 | all 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. |