diff options
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/ChangeLog | 23 | ||||
| -rw-r--r-- | lib-src/make-docfile.c | 43 | ||||
| -rw-r--r-- | lib-src/makefile.w32-in | 46 |
3 files changed, 86 insertions, 26 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 1f28000e110..bc0e5c9a3d2 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog | |||
| @@ -1,3 +1,26 @@ | |||
| 1 | 2012-10-21 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * make-docfile.c (scan_lisp_file): Add cp51932.el and eucjp-ms.el. | ||
| 4 | |||
| 5 | 2012-10-20 Eli Zaretskii <eliz@gnu.org> | ||
| 6 | |||
| 7 | * make-docfile.c (IS_SLASH, DEF_ELISP_FILE): New macros. | ||
| 8 | (scan_lisp_file): Only pass a .el file if its basename matches a | ||
| 9 | known file in its entirety. Use IS_SLASH and DEF_ELISP_FILE. | ||
| 10 | |||
| 11 | 2012-10-20 Andreas Schwab <schwab@linux-m68k.org> | ||
| 12 | |||
| 13 | * make-docfile.c (scan_lisp_file): Add bounds checking. | ||
| 14 | |||
| 15 | 2012-10-20 Eli Zaretskii <eliz@gnu.org> | ||
| 16 | |||
| 17 | Prevent silent omission of doc strings from uncompiled Lisp files. | ||
| 18 | * make-docfile.c (scan_lisp_file): Barf if called with a .el file | ||
| 19 | other than one of a small list of supported un-compiled files. | ||
| 20 | |||
| 21 | * makefile.w32-in (lisp1, lisp2): Name .elc files wherever they | ||
| 22 | exist. (Bug#12395) | ||
| 23 | |||
| 1 | 2012-10-17 Eli Zaretskii <eliz@gnu.org> | 24 | 2012-10-17 Eli Zaretskii <eliz@gnu.org> |
| 2 | 25 | ||
| 3 | * ntlib.c: Include <mbstring.h>, to avoid compiler warning about | 26 | * ntlib.c: Include <mbstring.h>, to avoid compiler warning about |
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c index 411b7057861..68e7029ee85 100644 --- a/lib-src/make-docfile.c +++ b/lib-src/make-docfile.c | |||
| @@ -58,9 +58,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 58 | #undef chdir | 58 | #undef chdir |
| 59 | #define READ_TEXT "rt" | 59 | #define READ_TEXT "rt" |
| 60 | #define READ_BINARY "rb" | 60 | #define READ_BINARY "rb" |
| 61 | #define IS_SLASH(c) ((c) == '/' || (c) == '\\' || (c) == ':') | ||
| 61 | #else /* not DOS_NT */ | 62 | #else /* not DOS_NT */ |
| 62 | #define READ_TEXT "r" | 63 | #define READ_TEXT "r" |
| 63 | #define READ_BINARY "r" | 64 | #define READ_BINARY "r" |
| 65 | #define IS_SLASH(c) ((c) == '/') | ||
| 64 | #endif /* not DOS_NT */ | 66 | #endif /* not DOS_NT */ |
| 65 | 67 | ||
| 66 | static int scan_file (char *filename); | 68 | static int scan_file (char *filename); |
| @@ -1025,9 +1027,9 @@ scan_c_file (char *filename, const char *mode) | |||
| 1025 | arglist, but the doc string must still have a backslash and newline | 1027 | arglist, but the doc string must still have a backslash and newline |
| 1026 | immediately after the double quote. | 1028 | immediately after the double quote. |
| 1027 | The only source files that must follow this convention are preloaded | 1029 | The only source files that must follow this convention are preloaded |
| 1028 | uncompiled ones like loaddefs.el and bindings.el; aside | 1030 | uncompiled ones like loaddefs.el; aside from that, it is always the .elc |
| 1029 | from that, it is always the .elc file that we look at, and they are no | 1031 | file that we should look at, and they are no problem because byte-compiler |
| 1030 | problem because byte-compiler output follows this convention. | 1032 | output follows this convention. |
| 1031 | The NAME and DOCSTRING are output. | 1033 | The NAME and DOCSTRING are output. |
| 1032 | NAME is preceded by `F' for a function or `V' for a variable. | 1034 | NAME is preceded by `F' for a function or `V' for a variable. |
| 1033 | An entry is output only if DOCSTRING has \ newline just after the opening ". | 1035 | An entry is output only if DOCSTRING has \ newline just after the opening ". |
| @@ -1098,15 +1100,50 @@ search_lisp_doc_at_eol (FILE *infile) | |||
| 1098 | return 1; | 1100 | return 1; |
| 1099 | } | 1101 | } |
| 1100 | 1102 | ||
| 1103 | #define DEF_ELISP_FILE(fn) { #fn, sizeof(#fn) - 1 } | ||
| 1104 | |||
| 1101 | static int | 1105 | static int |
| 1102 | scan_lisp_file (const char *filename, const char *mode) | 1106 | scan_lisp_file (const char *filename, const char *mode) |
| 1103 | { | 1107 | { |
| 1104 | FILE *infile; | 1108 | FILE *infile; |
| 1105 | register int c; | 1109 | register int c; |
| 1106 | char *saved_string = 0; | 1110 | char *saved_string = 0; |
| 1111 | /* These are the only files that are loaded uncompiled, and must | ||
| 1112 | follow the conventions of the doc strings expected by this | ||
| 1113 | function. These conventions are automatically followed by the | ||
| 1114 | byte compiler when it produces the .elc files. */ | ||
| 1115 | static struct { | ||
| 1116 | const char *fn; | ||
| 1117 | size_t fl; | ||
| 1118 | } const uncompiled[] = { | ||
| 1119 | DEF_ELISP_FILE (loaddefs.el), | ||
| 1120 | DEF_ELISP_FILE (loadup.el), | ||
| 1121 | DEF_ELISP_FILE (charprop.el), | ||
| 1122 | DEF_ELISP_FILE (cp51932.el), | ||
| 1123 | DEF_ELISP_FILE (eucjp-ms.el) | ||
| 1124 | }; | ||
| 1125 | int i, match; | ||
| 1126 | size_t flen = strlen (filename); | ||
| 1107 | 1127 | ||
| 1108 | if (generate_globals) | 1128 | if (generate_globals) |
| 1109 | fatal ("scanning lisp file when -g specified", 0); | 1129 | fatal ("scanning lisp file when -g specified", 0); |
| 1130 | if (flen > 3 && !strcmp (filename + flen - 3, ".el")) | ||
| 1131 | { | ||
| 1132 | for (i = 0, match = 0; i < sizeof (uncompiled) / sizeof (uncompiled[0]); | ||
| 1133 | i++) | ||
| 1134 | { | ||
| 1135 | if (uncompiled[i].fl <= flen | ||
| 1136 | && !strcmp (filename + flen - uncompiled[i].fl, uncompiled[i].fn) | ||
| 1137 | && (flen == uncompiled[i].fl | ||
| 1138 | || IS_SLASH (filename[flen - uncompiled[i].fl - 1]))) | ||
| 1139 | { | ||
| 1140 | match = 1; | ||
| 1141 | break; | ||
| 1142 | } | ||
| 1143 | } | ||
| 1144 | if (!match) | ||
| 1145 | fatal ("uncompiled lisp file %s is not supported", filename); | ||
| 1146 | } | ||
| 1110 | 1147 | ||
| 1111 | infile = fopen (filename, mode); | 1148 | infile = fopen (filename, mode); |
| 1112 | if (infile == NULL) | 1149 | if (infile == NULL) |
diff --git a/lib-src/makefile.w32-in b/lib-src/makefile.w32-in index ecc5fb866b3..640e8a7c468 100644 --- a/lib-src/makefile.w32-in +++ b/lib-src/makefile.w32-in | |||
| @@ -209,38 +209,38 @@ lisp1= \ | |||
| 209 | $(lispsource)emacs-lisp/map-ynp.elc \ | 209 | $(lispsource)emacs-lisp/map-ynp.elc \ |
| 210 | $(lispsource)menu-bar.elc \ | 210 | $(lispsource)menu-bar.elc \ |
| 211 | $(lispsource)international/mule.elc \ | 211 | $(lispsource)international/mule.elc \ |
| 212 | $(lispsource)international/mule-conf.el \ | 212 | $(lispsource)international/mule-conf.elc \ |
| 213 | $(lispsource)international/mule-cmds.elc \ | 213 | $(lispsource)international/mule-cmds.elc \ |
| 214 | $(lispsource)international/characters.elc \ | 214 | $(lispsource)international/characters.elc \ |
| 215 | $(lispsource)international/charprop.el \ | 215 | $(lispsource)international/charprop.el \ |
| 216 | $(lispsource)case-table.elc | 216 | $(lispsource)case-table.elc |
| 217 | 217 | ||
| 218 | lisp2 = \ | 218 | lisp2 = \ |
| 219 | $(lispsource)language/chinese.el \ | 219 | $(lispsource)language/chinese.elc \ |
| 220 | $(lispsource)language/cyrillic.el \ | 220 | $(lispsource)language/cyrillic.elc \ |
| 221 | $(lispsource)language/indian.el \ | 221 | $(lispsource)language/indian.elc \ |
| 222 | $(lispsource)language/sinhala.el \ | 222 | $(lispsource)language/sinhala.elc \ |
| 223 | $(lispsource)language/english.el \ | 223 | $(lispsource)language/english.elc \ |
| 224 | $(lispsource)language/ethiopic.elc \ | 224 | $(lispsource)language/ethiopic.elc \ |
| 225 | $(lispsource)language/european.elc \ | 225 | $(lispsource)language/european.elc \ |
| 226 | $(lispsource)language/czech.el \ | 226 | $(lispsource)language/czech.elc \ |
| 227 | $(lispsource)language/slovak.el \ | 227 | $(lispsource)language/slovak.elc \ |
| 228 | $(lispsource)language/romanian.el \ | 228 | $(lispsource)language/romanian.elc \ |
| 229 | $(lispsource)language/greek.el \ | 229 | $(lispsource)language/greek.elc \ |
| 230 | $(lispsource)language/hebrew.elc \ | 230 | $(lispsource)language/hebrew.elc \ |
| 231 | $(lispsource)language/japanese.el \ | 231 | $(lispsource)language/japanese.elc \ |
| 232 | $(lispsource)language/korean.el \ | 232 | $(lispsource)language/korean.elc \ |
| 233 | $(lispsource)language/lao.el \ | 233 | $(lispsource)language/lao.elc \ |
| 234 | $(lispsource)language/cham.el \ | 234 | $(lispsource)language/cham.elc \ |
| 235 | $(lispsource)language/tai-viet.el \ | 235 | $(lispsource)language/tai-viet.elc \ |
| 236 | $(lispsource)language/thai.el \ | 236 | $(lispsource)language/thai.elc \ |
| 237 | $(lispsource)language/tibetan.elc \ | 237 | $(lispsource)language/tibetan.elc \ |
| 238 | $(lispsource)language/vietnamese.el \ | 238 | $(lispsource)language/vietnamese.elc \ |
| 239 | $(lispsource)language/misc-lang.el \ | 239 | $(lispsource)language/misc-lang.elc \ |
| 240 | $(lispsource)language/utf-8-lang.el \ | 240 | $(lispsource)language/utf-8-lang.elc \ |
| 241 | $(lispsource)language/georgian.el \ | 241 | $(lispsource)language/georgian.elc \ |
| 242 | $(lispsource)language/khmer.el \ | 242 | $(lispsource)language/khmer.elc \ |
| 243 | $(lispsource)language/burmese.el \ | 243 | $(lispsource)language/burmese.elc \ |
| 244 | $(lispsource)register.elc \ | 244 | $(lispsource)register.elc \ |
| 245 | $(lispsource)replace.elc \ | 245 | $(lispsource)replace.elc \ |
| 246 | $(lispsource)simple.elc \ | 246 | $(lispsource)simple.elc \ |
| @@ -266,7 +266,7 @@ lisp2 = \ | |||
| 266 | $(WINDOW_SUPPORT) \ | 266 | $(WINDOW_SUPPORT) \ |
| 267 | $(lispsource)widget.elc \ | 267 | $(lispsource)widget.elc \ |
| 268 | $(lispsource)window.elc \ | 268 | $(lispsource)window.elc \ |
| 269 | $(lispsource)version.el | 269 | $(lispsource)version.elc |
| 270 | 270 | ||
| 271 | # This is needed the first time we build the tree, since temacs.exe | 271 | # This is needed the first time we build the tree, since temacs.exe |
| 272 | # does not exist yet, and the DOC rule needs it to rebuild DOC whenever | 272 | # does not exist yet, and the DOC rule needs it to rebuild DOC whenever |