Index: lisp.h =================================================================== RCS file: /sources/emacs/emacs/src/lisp.h,v retrieving revision 1.583 diff -c -r1.583 lisp.h *** lisp.h 29 Aug 2007 21:50:08 -0000 1.583 --- lisp.h 9 Sep 2007 20:37:51 -0000 *************** *** 891,897 **** Lisp_Object (*function) (); short min_args, max_args; char *symbol_name; ! char *prompt; char *doc; }; --- 891,897 ---- Lisp_Object (*function) (); short min_args, max_args; char *symbol_name; ! char *intspec; char *doc; }; *************** *** 1669,1698 **** followed by the address of a vector of Lisp_Objects which contains the argument values. UNEVALLED means pass the list of unevaluated arguments ! `prompt' says how to read arguments for an interactive call. ! See the doc string for `interactive'. A null string means call interactively with no arguments. `doc' is documentation for the user. */ #if (!defined (__STDC__) && !defined (PROTOTYPES)) \ || defined (USE_NONANSI_DEFUN) ! #define DEFUN(lname, fnname, sname, minargs, maxargs, prompt, doc) \ Lisp_Object fnname (); \ DECL_ALIGN (struct Lisp_Subr, sname) = \ { PVEC_SUBR | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)), \ ! fnname, minargs, maxargs, lname, prompt, 0}; \ Lisp_Object fnname #else /* This version of DEFUN declares a function prototype with the right arguments, so we can catch errors with maxargs at compile-time. */ ! #define DEFUN(lname, fnname, sname, minargs, maxargs, prompt, doc) \ Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \ DECL_ALIGN (struct Lisp_Subr, sname) = \ { PVEC_SUBR | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)), \ ! fnname, minargs, maxargs, lname, prompt, 0}; \ Lisp_Object fnname /* Note that the weird token-substitution semantics of ANSI C makes --- 1669,1701 ---- followed by the address of a vector of Lisp_Objects which contains the argument values. UNEVALLED means pass the list of unevaluated arguments ! `intspec' says how interactive arguments are to be fetched. ! If the string starts with a `(', `intspec' is evaluated and the resulting ! list is the list of arguments. ! If it's a string that doesn't start with `(', the value should follow ! the one of the doc string for `interactive'. A null string means call interactively with no arguments. `doc' is documentation for the user. */ #if (!defined (__STDC__) && !defined (PROTOTYPES)) \ || defined (USE_NONANSI_DEFUN) ! #define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \ Lisp_Object fnname (); \ DECL_ALIGN (struct Lisp_Subr, sname) = \ { PVEC_SUBR | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)), \ ! fnname, minargs, maxargs, lname, intspec, 0}; \ Lisp_Object fnname #else /* This version of DEFUN declares a function prototype with the right arguments, so we can catch errors with maxargs at compile-time. */ ! #define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \ Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \ DECL_ALIGN (struct Lisp_Subr, sname) = \ { PVEC_SUBR | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)), \ ! fnname, minargs, maxargs, lname, intspec, 0}; \ Lisp_Object fnname /* Note that the weird token-substitution semantics of ANSI C makes Index: callint.c =================================================================== RCS file: /sources/emacs/emacs/src/callint.c,v retrieving revision 1.154 diff -c -r1.154 callint.c *** callint.c 29 Aug 2007 05:27:56 -0000 1.154 --- callint.c 9 Sep 2007 20:37:52 -0000 *************** *** 334,345 **** if (SUBRP (fun)) { ! string = (unsigned char *) XSUBR (fun)->prompt; if (!string) { lose: wrong_type_argument (Qcommandp, function); } } else if (COMPILEDP (fun)) { --- 334,353 ---- if (SUBRP (fun)) { ! string = (unsigned char *) XSUBR (fun)->intspec; if (!string) { lose: wrong_type_argument (Qcommandp, function); } + /* The function has an interactive spec to evaluate. */ + if (*string == '(') + { + specs = + Fcar (Fread_from_string (make_string (string, strlen (string)), + Qnil, Qnil)); + string = 0; + } } else if (COMPILEDP (fun)) { Index: data.c =================================================================== RCS file: /sources/emacs/emacs/src/data.c,v retrieving revision 1.277 diff -c -r1.277 data.c *** data.c 29 Aug 2007 05:27:58 -0000 1.277 --- data.c 9 Sep 2007 20:37:53 -0000 *************** *** 770,777 **** if (SUBRP (fun)) { ! if (XSUBR (fun)->prompt) ! return list2 (Qinteractive, build_string (XSUBR (fun)->prompt)); } else if (COMPILEDP (fun)) { --- 770,777 ---- if (SUBRP (fun)) { ! if (XSUBR (fun)->intspec) ! return list2 (Qinteractive, build_string (XSUBR (fun)->intspec)); } else if (COMPILEDP (fun)) { Index: eval.c =================================================================== RCS file: /sources/emacs/emacs/src/eval.c,v retrieving revision 1.287 diff -c -r1.287 eval.c *** eval.c 29 Aug 2007 05:27:57 -0000 1.287 --- eval.c 9 Sep 2007 20:37:54 -0000 *************** *** 2078,2084 **** /* Emacs primitives are interactive if their DEFUN specifies an interactive spec. */ if (SUBRP (fun)) ! return XSUBR (fun)->prompt ? Qt : if_prop; /* Bytecode objects are interactive if they are long enough to have an element whose index is COMPILED_INTERACTIVE, which is --- 2078,2084 ---- /* Emacs primitives are interactive if their DEFUN specifies an interactive spec. */ if (SUBRP (fun)) ! return XSUBR (fun)->intspec ? Qt : if_prop; /* Bytecode objects are interactive if they are long enough to have an element whose index is COMPILED_INTERACTIVE, which is