=== modified file 'lib-src/make-docfile.c' --- lib-src/make-docfile.c 2013-01-15 21:26:01 +0000 +++ lib-src/make-docfile.c 2013-03-25 11:26:49 +0000 @@ -842,8 +842,18 @@ || c == '\n' || c == '\r')); input_buffer[i] = '\0'; - name = xmalloc (i + 1); - memcpy (name, input_buffer, i + 1); + if (defunflag) + { + /* Prepend 'F' to Lisp function name. */ + name = xmalloc (i + 2); + name[0] = 'F'; + memcpy (name + 1, input_buffer, i + 1); + } + else + { + name = xmalloc (i + 1); + memcpy (name, input_buffer, i + 1); + } if (!defunflag) { @@ -857,7 +867,7 @@ DEFVAR_LISP ("name", addr, doc: /\* doc *\/) */ if (defunflag) - commas = generate_globals ? 4 : 5; + commas = generate_globals ? 3 : 4; else if (defvarperbufferflag) commas = 3; else if (defvarflag) === modified file 'src/lisp.h' --- src/lisp.h 2013-03-24 12:59:45 +0000 +++ src/lisp.h 2013-03-25 11:26:49 +0000 @@ -2029,12 +2029,10 @@ /* Define a built-in function for calling from Lisp. `lname' should be the name to give the function in Lisp, as a null-terminated C string. - `fnname' should be the name of the function in C. - By convention, it starts with F. - `sname' should be the name for the C constant structure - that records information on this function for internal use. - By convention, it should be the same as `fnname' but with S instead of F. - It's too bad that C macros can't compute this from `fnname'. + `pattern' is used to generate the name of the function in C, + and the C constant structure that records information on this + function for internal use. By convention, the first one is + done by prepending F and the second is done by prepending S. `minargs' should be a number, the minimum number of arguments allowed. `maxargs' should be a number, the maximum number of arguments allowed, or else MANY or UNEVALLED. @@ -2054,22 +2052,22 @@ /* This version of DEFUN declares a function prototype with the right arguments, so we can catch errors with maxargs at compile-time. */ #ifdef _MSC_VER -#define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \ - Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \ - static struct Lisp_Subr alignas (GCALIGNMENT) sname = \ - { { (PVEC_SUBR << PSEUDOVECTOR_AREA_BITS) \ - | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)) }, \ - { (Lisp_Object (__cdecl *)(void))fnname }, \ - minargs, maxargs, lname, intspec, 0}; \ - Lisp_Object fnname +#define DEFUN(lname, pattern, minargs, maxargs, intspec, doc) \ + Lisp_Object F ## pattern DEFUN_ARGS_ ## maxargs ; \ + static struct Lisp_Subr alignas (GCALIGNMENT) S ## pattern = \ + { { (PVEC_SUBR << PSEUDOVECTOR_AREA_BITS) \ + | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)) }, \ + { (Lisp_Object (__cdecl *)(void)) F ## pattern }, \ + minargs, maxargs, lname, intspec, 0}; \ + Lisp_Object F ## pattern #else /* not _MSC_VER */ -#define DEFUN(lname, fnname, sname, minargs, maxargs, intspec, doc) \ - Lisp_Object fnname DEFUN_ARGS_ ## maxargs ; \ - static struct Lisp_Subr alignas (GCALIGNMENT) sname = \ - { { PVEC_SUBR << PSEUDOVECTOR_AREA_BITS }, \ - { .a ## maxargs = fnname }, \ - minargs, maxargs, lname, intspec, 0}; \ - Lisp_Object fnname +#define DEFUN(lname, pattern, minargs, maxargs, intspec, doc) \ + Lisp_Object F ## pattern DEFUN_ARGS_ ## maxargs ; \ + static struct Lisp_Subr alignas (GCALIGNMENT) S ## pattern = \ + { { PVEC_SUBR << PSEUDOVECTOR_AREA_BITS }, \ + { .a ## maxargs = F ## pattern }, \ + minargs, maxargs, lname, intspec, 0}; \ + Lisp_Object F ## pattern #endif /* Note that the weird token-substitution semantics of ANSI C makes