diff options
| author | Stefan Monnier | 2012-06-18 11:57:41 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2012-06-18 11:57:41 -0400 |
| commit | 1053a8716ba9f1834eccff14ece377928a4bd244 (patch) | |
| tree | 775e64585480452dcaa629ee9ffa2b85505d3e01 /src/data.c | |
| parent | b7e8d081674c24b19c5ee39892a72aef25c1dfcc (diff) | |
| download | emacs-1053a8716ba9f1834eccff14ece377928a4bd244.tar.gz emacs-1053a8716ba9f1834eccff14ece377928a4bd244.zip | |
Fix return value of `defun' and un-define it.
* src/data.c (Fdefalias): Return `symbol'.
* doc/lispref/functions.texi (Defining Functions):
* doc/lispref/macros.texi (Defining Macros): Un-define the return value of
`defun', `defmacro' and `defalias'.
Fixes: debbugs:11686
Diffstat (limited to 'src/data.c')
| -rw-r--r-- | src/data.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/data.c b/src/data.c index 4449977dbe0..2aa27e65d77 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -637,8 +637,9 @@ DEFUN ("fset", Ffset, Sfset, 2, 2, 0, | |||
| 637 | Fput (symbol, Qautoload, XCDR (function)); | 637 | Fput (symbol, Qautoload, XCDR (function)); |
| 638 | 638 | ||
| 639 | XSYMBOL (symbol)->function = definition; | 639 | XSYMBOL (symbol)->function = definition; |
| 640 | /* Handle automatic advice activation */ | 640 | /* Handle automatic advice activation. */ |
| 641 | if (CONSP (XSYMBOL (symbol)->plist) && !NILP (Fget (symbol, Qad_advice_info))) | 641 | if (CONSP (XSYMBOL (symbol)->plist) |
| 642 | && !NILP (Fget (symbol, Qad_advice_info))) | ||
| 642 | { | 643 | { |
| 643 | call2 (Qad_activate_internal, symbol, Qnil); | 644 | call2 (Qad_activate_internal, symbol, Qnil); |
| 644 | definition = XSYMBOL (symbol)->function; | 645 | definition = XSYMBOL (symbol)->function; |
| @@ -647,11 +648,12 @@ DEFUN ("fset", Ffset, Sfset, 2, 2, 0, | |||
| 647 | } | 648 | } |
| 648 | 649 | ||
| 649 | DEFUN ("defalias", Fdefalias, Sdefalias, 2, 3, 0, | 650 | DEFUN ("defalias", Fdefalias, Sdefalias, 2, 3, 0, |
| 650 | doc: /* Set SYMBOL's function definition to DEFINITION, and return DEFINITION. | 651 | doc: /* Set SYMBOL's function definition to DEFINITION. |
| 651 | Associates the function with the current load file, if any. | 652 | Associates the function with the current load file, if any. |
| 652 | The optional third argument DOCSTRING specifies the documentation string | 653 | The optional third argument DOCSTRING specifies the documentation string |
| 653 | for SYMBOL; if it is omitted or nil, SYMBOL uses the documentation string | 654 | for SYMBOL; if it is omitted or nil, SYMBOL uses the documentation string |
| 654 | determined by DEFINITION. */) | 655 | determined by DEFINITION. |
| 656 | The return value is undefined. */) | ||
| 655 | (register Lisp_Object symbol, Lisp_Object definition, Lisp_Object docstring) | 657 | (register Lisp_Object symbol, Lisp_Object definition, Lisp_Object docstring) |
| 656 | { | 658 | { |
| 657 | CHECK_SYMBOL (symbol); | 659 | CHECK_SYMBOL (symbol); |
| @@ -666,7 +668,10 @@ determined by DEFINITION. */) | |||
| 666 | LOADHIST_ATTACH (Fcons (Qdefun, symbol)); | 668 | LOADHIST_ATTACH (Fcons (Qdefun, symbol)); |
| 667 | if (!NILP (docstring)) | 669 | if (!NILP (docstring)) |
| 668 | Fput (symbol, Qfunction_documentation, docstring); | 670 | Fput (symbol, Qfunction_documentation, docstring); |
| 669 | return definition; | 671 | /* We used to return `definition', but now that `defun' and `defmacro' expand |
| 672 | to a call to `defalias', we return `symbol' for backward compatibility | ||
| 673 | (bug#11686). */ | ||
| 674 | return symbol; | ||
| 670 | } | 675 | } |
| 671 | 676 | ||
| 672 | DEFUN ("setplist", Fsetplist, Ssetplist, 2, 2, 0, | 677 | DEFUN ("setplist", Fsetplist, Ssetplist, 2, 2, 0, |