aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/data.c b/src/data.c
index 10d6a1e9eb5..d2f6ce76905 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1,6 +1,6 @@
1/* Primitive operations on Lisp data types for GNU Emacs Lisp interpreter. 1/* Primitive operations on Lisp data types for GNU Emacs Lisp interpreter.
2 Copyright (C) 1985, 1986, 1988, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2 Copyright (C) 1985, 1986, 1988, 1993, 1994, 1995, 1997, 1998, 1999, 2000,
3 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 3 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -1984,23 +1984,26 @@ indirect_function (object)
1984 return hare; 1984 return hare;
1985} 1985}
1986 1986
1987DEFUN ("indirect-function", Findirect_function, Sindirect_function, 1, 1, 0, 1987DEFUN ("indirect-function", Findirect_function, Sindirect_function, 1, 2, 0,
1988 doc: /* Return the function at the end of OBJECT's function chain. 1988 doc: /* Return the function at the end of OBJECT's function chain.
1989If OBJECT is a symbol, follow all function indirections and return the final 1989If OBJECT is not a symbol, just return it. Otherwise, follow all
1990function binding. 1990function indirections to find the final function binding and return it.
1991If OBJECT is not a symbol, just return it. 1991If the final symbol in the chain is unbound, signal a void-function error.
1992Signal a void-function error if the final symbol is unbound. 1992Optional arg NOERROR non-nil means to return nil instead of signalling.
1993Signal a cyclic-function-indirection error if there is a loop in the 1993Signal a cyclic-function-indirection error if there is a loop in the
1994function chain of symbols. */) 1994function chain of symbols. */)
1995 (object) 1995 (object, noerror)
1996 register Lisp_Object object; 1996 register Lisp_Object object;
1997 Lisp_Object noerror;
1997{ 1998{
1998 Lisp_Object result; 1999 Lisp_Object result;
1999 2000
2000 result = indirect_function (object); 2001 result = indirect_function (object);
2001 2002
2002 if (EQ (result, Qunbound)) 2003 if (EQ (result, Qunbound))
2003 return Fsignal (Qvoid_function, Fcons (object, Qnil)); 2004 return (NILP (noerror)
2005 ? Fsignal (Qvoid_function, Fcons (object, Qnil))
2006 : Qnil);
2004 return result; 2007 return result;
2005} 2008}
2006 2009