@c -*-texinfo-*-
@c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001,
-@c 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+@c Copyright (C) 1990-1995, 1998-1999, 2001-2011
+@c Free Software Foundation, Inc.
@c See the file elisp.texi for copying conditions.
@setfilename ../../info/functions
@node Functions, Macros, Variables, Top
* Function Cells:: Accessing or setting the function definition
of a symbol.
* Obsolete Functions:: Declaring functions obsolete.
-* Inline Functions:: Defining functions that the compiler will open code.
+* Inline Functions:: Defining functions that the compiler will open code.
* Declaring Functions:: Telling the compiler that a function is defined.
* Function Safety:: Determining whether a function is safe to call.
* Related Topics:: Cross-references to specific Lisp primitives
@item byte-code function
A @dfn{byte-code function} is a function that has been compiled by the
byte compiler. @xref{Byte-Code Type}.
+
+@item autoload object
+@cindex autoload object
+An @dfn{autoload object} is a place-holder for a real function. If
+the autoload object is called, it will make Emacs load the file
+containing the definition of the real function, and then call the real
+function instead.
@end table
@defun functionp object
This function ignores any arguments and returns @code{nil}.
@end defun
+ Emacs Lisp functions can also be user-visible @dfn{commands}. A
+command is a function that has an @dfn{interactive} specification.
+You may want to call these functions as if they were called
+interactively. See @ref{Interactive Call} for details on how to do
+that.
+
@node Mapping Functions
@section Mapping Functions
@cindex mapping functions
@result{} (a c e)
(mapcar '1+ [1 2 3])
@result{} (2 3 4)
-(mapcar 'char-to-string "abc")
+(mapcar 'string "abc")
@result{} ("a" "b" "c")
@end group
@end defun
You can define a function as an alias and declare it obsolete at the
-same time using the macro @code{define-obsolete-function-alias}.
+same time using the macro @code{define-obsolete-function-alias}:
@defmac define-obsolete-function-alias obsolete-name current-name &optional when docstring
This macro marks the function @var{obsolete-name} obsolete and also
@end example
@end defmac
+In addition, you can mark a certain a particular calling convention
+for a function as obsolete:
+
+@defun set-advertised-calling-convention function signature
+This function specifies the argument list @var{signature} as the
+correct way to call @var{function}. This causes the Emacs byte
+compiler to issue a warning whenever it comes across an Emacs Lisp
+program that calls @var{function} any other way (however, it will
+still allow the code to be byte compiled).
+
+For instance, in old versions of Emacs the @code{sit-for} function
+accepted three arguments, like this
+
+@smallexample
+ (sit-for seconds milliseconds nodisp)
+@end smallexample
+
+However, calling @code{sit-for} this way is considered obsolete
+(@pxref{Waiting}). The old calling convention is deprecated like
+this:
+
+@smallexample
+(set-advertised-calling-convention
+ 'sit-for '(seconds &optional nodisp))
+@end smallexample
+@end defun
+
@node Inline Functions
@section Inline Functions
@cindex inline functions
@item undefined
See @ref{Functions for Key Lookup}.
@end table
-
-@ignore
- arch-tag: 39100cdf-8a55-4898-acba-595db619e8e2
-@end ignore