From d2fde41d7de13c4557aa8669ffed5ace92fc2b6e Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 9 Jul 2002 23:12:30 +0000 Subject: [PATCH] (Fdefalias): Add an optional `docstring' argument. (set_internal, Fsetq_default): Use XCAR/XCDR. --- src/data.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/data.c b/src/data.c index 33a94b389f3..f2c13dd9749 100644 --- a/src/data.c +++ b/src/data.c @@ -704,14 +704,18 @@ DEFUN ("fset", Ffset, Sfset, 2, 2, 0, return definition; } -DEFUN ("defalias", Fdefalias, Sdefalias, 2, 2, 0, +extern Lisp_Object Qfunction_documentation; + +DEFUN ("defalias", Fdefalias, Sdefalias, 2, 3, 0, doc: /* Set SYMBOL's function definition to DEFINITION, and return DEFINITION. Associates the function with the current load file, if any. */) - (symbol, definition) - register Lisp_Object symbol, definition; + (symbol, definition, docstring) + register Lisp_Object symbol, definition, docstring; { definition = Ffset (symbol, definition); LOADHIST_ATTACH (symbol); + if (!NILP (docstring)) + Fput (symbol, Qfunction_documentation, docstring); return definition; } @@ -1209,7 +1213,7 @@ set_internal (symbol, newval, buf, bindflag) and load that binding. */ else { - tem1 = Fcons (symbol, Fcdr (current_alist_element)); + tem1 = Fcons (symbol, XCDR (current_alist_element)); buf->local_var_alist = Fcons (tem1, buf->local_var_alist); } @@ -1411,9 +1415,9 @@ usage: (setq-default SYMBOL VALUE [SYMBOL VALUE...]) */) do { val = Feval (Fcar (Fcdr (args_left))); - symbol = Fcar (args_left); + symbol = XCAR (args_left); Fset_default (symbol, val); - args_left = Fcdr (Fcdr (args_left)); + args_left = Fcdr (XCDR (args_left)); } while (!NILP (args_left)); -- 2.39.5