]> git.eshelyaron.com Git - emacs.git/commitdiff
(values, values-list, multiple-value-list, multiple-value-apply, nth-value):
authorRichard M. Stallman <rms@gnu.org>
Fri, 16 Nov 2001 00:00:22 +0000 (00:00 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 16 Nov 2001 00:00:22 +0000 (00:00 +0000)
Use defsubst rather than defalias, to get better doc strings.

lisp/ChangeLog
lisp/emacs-lisp/cl.el

index 4f2f4277ebab3ab06c90a18f8e893fe1dc064c26..ab3ff9423f21d741b9c76f55a5c7e2168eb93e78 100644 (file)
@@ -1,3 +1,9 @@
+2001-11-15  Richard M. Stallman  <rms@gnu.org>
+
+       * emacs-lisp/cl.el (values, values-list, multiple-value-list) 
+       (multiple-value-apply, nth-value): Use defsubst rather than defalias
+       to get better doc strings.
+
 2001-11-15  Pavel Jan\e,Bm\e(Bk  <Pavel@Janik.cz>
 
        * derived.el: Fix autoload cookie.
        * dired.el (dired-undo): Display a message to explain
        that this does not undo file system changes.
 
-2001-11-15  Alan Shutko  <ats@acm.org>
-
-       * compile.el (recompile): Use compilation-arguments if set, so as
-       to be able to M-x recompile the exact command which created a
-       compilation-mode buffer.
-
-2001-11-13  Richard M. Stallman  <rms@gnu.org>
-
-       * progmodes/ada-mode.el (ada-fill-comment-prefix): Doc fix.
-
 2001-11-15  David Kastrup  <David.Kastrup@t-online.de>
 
        * mouse-drag.el (mouse-drag-throw): Push back non-drag events
index f77c15414a3531456889387d442fb71744f49aea..970d918027380514577bbb5d02c3a335ea6368b1 100644 (file)
@@ -203,12 +203,38 @@ Keywords supported:  :test :test-not :key"
 ;;; simulated.  Instead, multiple-value-bind and friends simply expect
 ;;; the target form to return the values as a list.
 
-(defalias 'values 'list)
-(defalias 'values-list 'identity)
-(defalias 'multiple-value-list 'identity)
-(defalias 'multiple-value-call 'apply)  ; only works for one arg
-(defalias 'nth-value 'nth)
+(defsubst values (&rest values)
+  "Return multiple values, Common Lisp style.
+The arguments of `values' are the values
+that the containing function should return."
+  (apply 'list values))
+
+(defsubst 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)
 
+(defsubst multiple-value-list (expression)
+  "Return a list of the multiple values produced by EXPRESSION.
+This handles multiple values in Common Lisp style, but it does not
+work right when EXPRESSION calls an ordinary Emacs Lisp function
+that returns just one value."
+  expression)
+
+(defsubst multiple-value-apply (function expression)
+  "Evaluate EXPRESSION to get multiple values and apply FUNCTION to them.
+This handles multiple values in Common Lisp style, but it does not work
+right when EXPRESSION calls an ordinary Emacs Lisp function that returns just
+one value."
+  (apply function expression))
+
+(defsubst nth-value (n expression)
+  "Evaluate EXPRESSION to get multiple values and return the Nth one.
+This handles multiple values in Common Lisp style, but it does not work
+right when EXPRESSION calls an ordinary Emacs Lisp function that returns just
+one value."
+  (nth n expression))
 
 ;;; Macros.