diff options
Diffstat (limited to 'lisp/emacs-lisp/cl-lib.el')
-rw-r--r-- | lisp/emacs-lisp/cl-lib.el | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el index 0f5f3c78695..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. +LIST specifies the list of values that the containing function +should return. -\(fn LIST)") +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. @@ -365,13 +369,6 @@ SEQ, this is like `mapcar'. With several, it is like the Common Lisp (cl--defalias 'cl-second 'cadr) (cl--defalias 'cl-rest 'cdr) -(defun cl-endp (x) - "Return true if X is the empty list; false if it is a cons. -Signal an error if X is not a list." - (if (listp x) - (null x) - (signal 'wrong-type-argument (list 'listp x 'x)))) - (cl--defalias 'cl-third 'cl-caddr "Return the third element of the list X.") (cl--defalias 'cl-fourth 'cl-cadddr "Return the fourth element of the list X.") @@ -531,8 +528,9 @@ If ALIST is non-nil, the new pairs are prepended to it." ;; Some more Emacs-related place types. (gv-define-simple-setter buffer-file-name set-visited-file-name t) (gv-define-setter buffer-modified-p (flag &optional buf) - `(with-current-buffer ,buf - (set-buffer-modified-p ,flag))) + (macroexp-let2 nil buffer `(or ,buf (current-buffer)) + `(with-current-buffer ,buffer + (set-buffer-modified-p ,flag)))) (gv-define-simple-setter buffer-name rename-buffer t) (gv-define-setter buffer-string (store) `(insert (prog1 ,store (erase-buffer)))) @@ -666,8 +664,4 @@ of record objects." (t (advice-remove 'type-of #'cl--old-struct-type-of)))) -;; Local variables: -;; byte-compile-dynamic: t -;; End: - ;;; cl-lib.el ends here |