aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2012-06-18 11:57:41 -0400
committerStefan Monnier2012-06-18 11:57:41 -0400
commit1053a8716ba9f1834eccff14ece377928a4bd244 (patch)
tree775e64585480452dcaa629ee9ffa2b85505d3e01 /src
parentb7e8d081674c24b19c5ee39892a72aef25c1dfcc (diff)
downloademacs-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')
-rw-r--r--src/ChangeLog28
-rw-r--r--src/data.c15
2 files changed, 26 insertions, 17 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 9a239de5b99..080748236b4 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,8 +1,12 @@
12012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * data.c (Fdefalias): Return `symbol' (bug#11686).
4
12012-06-18 Martin Rudalics <rudalics@gmx.at> 52012-06-18 Martin Rudalics <rudalics@gmx.at>
2 6
3 * buffer.c (Fkill_buffer): Don't throw an error when the buffer 7 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
4 gets killed during executing of this function (Bug#11665). Try 8 gets killed during executing of this function (Bug#11665).
5 to always return Qt when the buffer has been actually killed. 9 Try to always return Qt when the buffer has been actually killed.
6 (Vkill_buffer_query_functions): In doc-string say that functions 10 (Vkill_buffer_query_functions): In doc-string say that functions
7 run by this hook should not change the current buffer. 11 run by this hook should not change the current buffer.
8 12
@@ -56,8 +60,8 @@
56 (x_draw_glyph_string): Use them. 60 (x_draw_glyph_string): Use them.
57 * xfaces.c (Qline, Qwave): New Lisp objects. 61 * xfaces.c (Qline, Qwave): New Lisp objects.
58 (check_lface_attrs, merge_face_ref) 62 (check_lface_attrs, merge_face_ref)
59 (Finternal_set_lisp_face_attribute, realize_x_face): Handle 63 (Finternal_set_lisp_face_attribute, realize_x_face):
60 wave-style underline face attributes. 64 Handle wave-style underline face attributes.
61 * xterm.c (x_draw_underwave): New function. 65 * xterm.c (x_draw_underwave): New function.
62 (x_draw_glyph_string): Use it. 66 (x_draw_glyph_string): Use it.
63 67
@@ -130,8 +134,8 @@
130 134
1312012-06-16 Eli Zaretskii <eliz@gnu.org> 1352012-06-16 Eli Zaretskii <eliz@gnu.org>
132 136
133 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end. If 137 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
134 all the glyphs of the glyph row came from strings, and we have no 138 If all the glyphs of the glyph row came from strings, and we have no
135 cursor positioning clues, put the cursor on the first glyph of the 139 cursor positioning clues, put the cursor on the first glyph of the
136 row. 140 row.
137 (handle_face_prop): Use chunk-relative overlay string index when 141 (handle_face_prop): Use chunk-relative overlay string index when
@@ -164,8 +168,8 @@
164 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined. 168 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
165 (INTTYPEBITS): New macro, for clarity. 169 (INTTYPEBITS): New macro, for clarity.
166 (INTMASK, MOST_POSITIVE_FIXNUM): Use it. 170 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
167 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P): Simplify 171 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
168 now that USE_LSB_TAG is always defined. 172 Simplify now that USE_LSB_TAG is always defined.
169 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast. 173 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
170 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler. 174 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
171 175
@@ -183,11 +187,11 @@
183 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct 187 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
184 instead of union. 188 instead of union.
185 (XLI, XIL): Define. 189 (XLI, XIL): Define.
186 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG): Use 190 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
187 them. 191 Use them.
188 * emacs.c (gdb_use_struct): Renamed from gdb_use_union. 192 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
189 * .gdbinit: Check gdb_use_struct instead of gdb_use_union. 193 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
190 * alloc.c (widen_to_Lisp_Object): Removed. 194 * alloc.c (widen_to_Lisp_Object): Remove.
191 (mark_memory): Use XIL instead of widen_to_Lisp_Object. 195 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
192 * frame.c (delete_frame): Remove outdated comment. 196 * frame.c (delete_frame): Remove outdated comment.
193 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking 197 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
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
649DEFUN ("defalias", Fdefalias, Sdefalias, 2, 3, 0, 650DEFUN ("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.
651Associates the function with the current load file, if any. 652Associates the function with the current load file, if any.
652The optional third argument DOCSTRING specifies the documentation string 653The optional third argument DOCSTRING specifies the documentation string
653for SYMBOL; if it is omitted or nil, SYMBOL uses the documentation string 654for SYMBOL; if it is omitted or nil, SYMBOL uses the documentation string
654determined by DEFINITION. */) 655determined by DEFINITION.
656The 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
672DEFUN ("setplist", Fsetplist, Ssetplist, 2, 2, 0, 677DEFUN ("setplist", Fsetplist, Ssetplist, 2, 2, 0,