/* Primitive operations on Lisp data types for GNU Emacs Lisp interpreter.
Copyright (C) 1985, 1986, 1988, 1993, 1994, 1995, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
This file is part of GNU Emacs.
GNU Emacs is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Emacs is distributed in the hope that it will be useful,
(cmd)
Lisp_Object cmd;
{
- Lisp_Object fun = indirect_function (cmd);
+ Lisp_Object fun = indirect_function (cmd); /* Check cycles. */
+
+ if (NILP (fun) || EQ (fun, Qunbound))
+ return Qnil;
+
+ /* Use an `interactive-form' property if present, analogous to the
+ function-documentation property. */
+ fun = cmd;
+ while (SYMBOLP (fun))
+ {
+ Lisp_Object tmp = Fget (fun, intern ("interactive-form"));
+ if (!NILP (tmp))
+ return tmp;
+ else
+ fun = Fsymbol_function (fun);
+ }
if (SUBRP (fun))
{
- if (XSUBR (fun)->prompt)
- return list2 (Qinteractive, build_string (XSUBR (fun)->prompt));
+ char *spec = XSUBR (fun)->intspec;
+ if (spec)
+ return list2 (Qinteractive,
+ (*spec != '(') ? build_string (spec) :
+ Fcar (Fread_from_string (build_string (spec), Qnil, Qnil)));
}
else if (COMPILEDP (fun))
{
XSETCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr,
tem1);
- /* Set `buffer' and `frame' slots for thebinding now loaded. */
+ /* Set `buffer' and `frame' slots for the binding now loaded. */
XSETBUFFER (XBUFFER_LOCAL_VALUE (valcontents)->buffer, buf);
XBUFFER_LOCAL_VALUE (valcontents)->frame = selected_frame;
}
This sets each VAR's default value to the corresponding VALUE.
The VALUE for the Nth VAR can refer to the new default values
of previous VARs.
-usage: (setq-default [VAR VALUE...]) */)
+usage: (setq-default [VAR VALUE]...) */)
(args)
Lisp_Object args;
{
XBUFFER_LOCAL_VALUE (newval)->found_for_frame = 0;
XBUFFER_LOCAL_VALUE (newval)->check_frame = 0;
XBUFFER_LOCAL_VALUE (newval)->cdr = tem;
- SET_SYMBOL_VALUE (variable, newval);;
+ SET_SYMBOL_VALUE (variable, newval);
}
/* Make sure this buffer has its own value of symbol. */
tem = Fassq (variable, current_buffer->local_var_alist);
return Qnil;
}
\f
-/* Convert between long values and pairs of Lisp integers. */
+/* Convert between long values and pairs of Lisp integers.
+ Note that long_to_cons returns a single Lisp integer
+ when the value fits in one. */
Lisp_Object
long_to_cons (i)