aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorStefan Monnier2012-06-18 11:57:41 -0400
committerStefan Monnier2012-06-18 11:57:41 -0400
commit1053a8716ba9f1834eccff14ece377928a4bd244 (patch)
tree775e64585480452dcaa629ee9ffa2b85505d3e01 /doc
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 'doc')
-rw-r--r--doc/lispref/ChangeLog6
-rw-r--r--doc/lispref/functions.texi18
-rw-r--r--doc/lispref/macros.texi9
3 files changed, 10 insertions, 23 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 0439cf2be57..89efb5c6255 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,9 @@
12012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * functions.texi (Defining Functions):
4 * macros.texi (Defining Macros): Un-define the return value of `defun',
5 `defmacro' and `defalias'.
6
12012-06-17 Chong Yidong <cyd@gnu.org> 72012-06-17 Chong Yidong <cyd@gnu.org>
2 8
3 * elisp.texi: Remove urlcolor setting. 9 * elisp.texi: Remove urlcolor setting.
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi
index 5fba243f65f..ab2789b5e6d 100644
--- a/doc/lispref/functions.texi
+++ b/doc/lispref/functions.texi
@@ -530,8 +530,7 @@ defines the symbol @var{name} as a function that looks like this:
530@end example 530@end example
531 531
532@code{defun} stores this lambda expression in the function cell of 532@code{defun} stores this lambda expression in the function cell of
533@var{name}. It returns the value @var{name}, but usually we ignore this 533@var{name}. Its return value is @emph{undefined}.
534value.
535 534
536As described previously, @var{argument-list} is a list of argument 535As described previously, @var{argument-list} is a list of argument
537names and may include the keywords @code{&optional} and @code{&rest}. 536names and may include the keywords @code{&optional} and @code{&rest}.
@@ -543,9 +542,6 @@ Here are some examples:
543@example 542@example
544@group 543@group
545(defun foo () 5) 544(defun foo () 5)
546 @result{} foo
547@end group
548@group
549(foo) 545(foo)
550 @result{} 5 546 @result{} 5
551@end group 547@end group
@@ -553,9 +549,6 @@ Here are some examples:
553@group 549@group
554(defun bar (a &optional b &rest c) 550(defun bar (a &optional b &rest c)
555 (list a b c)) 551 (list a b c))
556 @result{} bar
557@end group
558@group
559(bar 1 2 3 4 5) 552(bar 1 2 3 4 5)
560 @result{} (1 2 (3 4 5)) 553 @result{} (1 2 (3 4 5))
561@end group 554@end group
@@ -576,7 +569,6 @@ Here are some examples:
576 (forward-word 1) 569 (forward-word 1)
577 (backward-char 1) 570 (backward-char 1)
578 (capitalize-word 1)) 571 (capitalize-word 1))
579 @result{} capitalize-backwards
580@end group 572@end group
581@end example 573@end example
582 574
@@ -593,7 +585,7 @@ redefinition from unintentional redefinition.
593@anchor{Definition of defalias} 585@anchor{Definition of defalias}
594This special form defines the symbol @var{name} as a function, with 586This special form defines the symbol @var{name} as a function, with
595definition @var{definition} (which can be any valid Lisp function). 587definition @var{definition} (which can be any valid Lisp function).
596It returns @var{definition}. 588Its return value is @emph{undefined}.
597 589
598If @var{docstring} is non-@code{nil}, it becomes the function 590If @var{docstring} is non-@code{nil}, it becomes the function
599documentation of @var{name}. Otherwise, any documentation provided by 591documentation of @var{name}. Otherwise, any documentation provided by
@@ -1015,9 +1007,6 @@ function.
1015@example 1007@example
1016@group 1008@group
1017(defun bar (n) (+ n 2)) 1009(defun bar (n) (+ n 2))
1018 @result{} bar
1019@end group
1020@group
1021(symbol-function 'bar) 1010(symbol-function 'bar)
1022 @result{} (lambda (n) (+ n 2)) 1011 @result{} (lambda (n) (+ n 2))
1023@end group 1012@end group
@@ -1063,9 +1052,6 @@ subsequent attempt to access this cell will cause a
1063@example 1052@example
1064@group 1053@group
1065(defun foo (x) x) 1054(defun foo (x) x)
1066 @result{} foo
1067@end group
1068@group
1069(foo 1) 1055(foo 1)
1070 @result{}1 1056 @result{}1
1071@end group 1057@end group
diff --git a/doc/lispref/macros.texi b/doc/lispref/macros.texi
index b9b0e03c65a..efe298bf647 100644
--- a/doc/lispref/macros.texi
+++ b/doc/lispref/macros.texi
@@ -113,7 +113,6 @@ uses this feature.
113@group 113@group
114(defmacro inc (var) 114(defmacro inc (var)
115 (list 'setq var (list '1+ var))) 115 (list 'setq var (list '1+ var)))
116 @result{} inc
117@end group 116@end group
118 117
119@group 118@group
@@ -124,7 +123,6 @@ uses this feature.
124@group 123@group
125(defmacro inc2 (var1 var2) 124(defmacro inc2 (var1 var2)
126 (list 'progn (list 'inc var1) (list 'inc var2))) 125 (list 'progn (list 'inc var1) (list 'inc var2)))
127 @result{} inc2
128@end group 126@end group
129 127
130@group 128@group
@@ -207,9 +205,8 @@ like this:
207@end example 205@end example
208 206
209(Note that the @sc{cdr} of this list is a function---a lambda expression.) 207(Note that the @sc{cdr} of this list is a function---a lambda expression.)
210This macro object is stored in the function cell of @var{name}. The 208This macro object is stored in the function cell of @var{name}. Its return
211value returned by evaluating the @code{defmacro} form is @var{name}, but 209value is @emph{undefined}.
212usually we ignore this value.
213 210
214The shape and meaning of @var{argument-list} is the same as in a 211The shape and meaning of @var{argument-list} is the same as in a
215function, and the keywords @code{&rest} and @code{&optional} may be used 212function, and the keywords @code{&rest} and @code{&optional} may be used
@@ -342,7 +339,6 @@ For example, (for i from 1 to 10 do (print i))."
342 (cons (list '<= var final) 339 (cons (list '<= var final)
343 (append body (list (list 'inc var))))))) 340 (append body (list (list 'inc var)))))))
344@end group 341@end group
345@result{} for
346 342
347@group 343@group
348(for i from 1 to 3 do 344(for i from 1 to 3 do
@@ -512,7 +508,6 @@ it. Here is an example:
512@group 508@group
513(defmacro foo (a) 509(defmacro foo (a)
514 (list 'setq (eval a) t)) 510 (list 'setq (eval a) t))
515 @result{} foo
516@end group 511@end group
517@group 512@group
518(setq x 'b) 513(setq x 'b)