]> code.delx.au - gnu-emacs/blobdiff - src/data.c
(w32_init_fringe, mac_init_fringe): Add rif argument.
[gnu-emacs] / src / data.c
index cc0f96793ca9afce7675afc873a280cfbcde80b1..dfc0c35705aae23852153d943daa8e3257866b3f 100644 (file)
@@ -1,12 +1,12 @@
 /* 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,
@@ -751,12 +751,30 @@ Value, if non-nil, is a list \(interactive SPEC).  */)
      (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))
     {
@@ -1276,7 +1294,7 @@ set_internal (symbol, newval, buf, bindflag)
          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;
        }
@@ -1452,7 +1470,7 @@ More generally, you can use multiple variables and values, as in
 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;
 {
@@ -1587,7 +1605,7 @@ Instead, use `add-hook' and specify t for the LOCAL argument.  */)
       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);
@@ -2406,7 +2424,9 @@ DEFUN ("zerop", Fzerop, Szerop, 1, 1, 0,
   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)