diff options
author | Jim Blandy <jimb@redhat.com> | 1993-04-08 02:06:43 +0000 |
---|---|---|
committer | Jim Blandy <jimb@redhat.com> | 1993-04-08 02:06:43 +0000 |
commit | 6ccf94c42b1f214946dbe3ddbaa9ec8076b7a0e0 (patch) | |
tree | b5b91f271c95c29e5944cbebe6e5dec7f526831d /lib-src | |
parent | f80cf63f2a14cd5d971233dfbfb3aaecf7cb085b (diff) | |
download | emacs-6ccf94c42b1f214946dbe3ddbaa9ec8076b7a0e0.tar.gz |
* make-docfile.c (write_c_args): Print an argument named "defalt"
as "default".
Diffstat (limited to 'lib-src')
-rw-r--r-- | lib-src/make-docfile.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c index 83602f86e8a..c71fafb887b 100644 --- a/lib-src/make-docfile.c +++ b/lib-src/make-docfile.c @@ -152,6 +152,7 @@ write_c_args (out, buf, minargs, maxargs) for (p = buf; *p; p++) { char c = *p; + int ident_start = 0; /* Notice when we start printing a new identifier. */ if ((('A' <= c && c <= 'Z') @@ -163,6 +164,7 @@ write_c_args (out, buf, minargs, maxargs) if (!in_ident) { in_ident = 1; + ident_start = 1; if (minargs == 0 && maxargs > 0) fprintf (out, "&optional "); @@ -181,7 +183,21 @@ write_c_args (out, buf, minargs, maxargs) if (c == '_') c = '-'; if (c == ',') c = ' '; - if (c != ' ' || ! just_spaced) + /* In C code, `default' is a reserved word, so we spell it + `defalt'; unmangle that here. */ + if (ident_start + && strncmp (p, "defalt", 6) == 0 + && ! (('A' <= p[6] && p[6] <= 'Z') + || ('a' <= p[6] && p[6] <= 'z') + || ('0' <= p[6] && p[6] <= '9') + || p[6] == '_')) + { + fprintf (out, "default"); + p += 5; + in_ident = 0; + just_spaced = 0; + } + else if (c != ' ' || ! just_spaced) putc (c, out); just_spaced = (c == ' '); |