comparison lib-src/make-docfile.c @ 4539:061e030e3270

Fix some bugs in load-history construction, built-in symbol file names. lib-src/ChangeLog addition: 2008-12-27 Aidan Kehoe <kehoea@parhasard.net> * make-docfile.c (main): Allow more than one -d argument, followed by a directory to change to. (put_filename): Don't strip directory information; with previous change, allows retrieval of Lisp function and variable origin files from #'built-in-symbol-file relative to lisp-directory. (scan_lisp_file): Don't add an extraneous newline after the file name, put_filename has added the newline already. lisp/ChangeLog addition: 2008-12-27 Aidan Kehoe <kehoea@parhasard.net> * loadup.el (load-history): Add the contents of current-load-list to load-history before clearing it. Move the variable declarations earlier in the file to a format understood by make-docfile.c. * custom.el (custom-declare-variable): Add the variable's symbol to the current file's load history entry correctly, don't use a cons. Eliminate a comment that we don't need to worry about, we don't need to check the `initialized' C variable in Lisp. * bytecomp.el (byte-compile-output-file-form): Merge Andreas Schwab's pre-GPLv3 GNU change of 19970831 here; treat #'custom-declare-variable correctly, generating the docstrings in a format understood by make-docfile.c. * loadhist.el (symbol-file): Correct behaviour for checking autoloaded macros and functions when supplied with a TYPE argument. Accept fully-qualified paths from #'built-in-symbol-file; if a path is not fully-qualified, return it relative to lisp-directory if the filename corresponds to a Lisp file, and relative to (concat source-directory "/src/") otherwise. * make-docfile.el (preloaded-file-list): Rationalise some let bindings a little. Use the "-d" argument to make-docfile.c to supply Lisp paths relative to lisp-directory, not absolutely. Add in loadup.el explicitly to the list of files to be processed by make-docfile.c--it doesn't make sense to add it to preloaded-file-list, since that is used for purposes of byte-compilation too. src/ChangeLog addition: 2008-12-27 Aidan Kehoe <kehoea@parhasard.net> * doc.c (Fbuilt_in_symbol_file): Return a subr's filename immediately if we've found it. Check for compiled function and compiled macro docstrings in DOC too, and return them if they exist. The branch of the if statement focused on functions may have executed, but we may still want to check variable bindings; an else clause isn't appropriate.
author Aidan Kehoe <kehoea@parhasard.net>
date Sat, 27 Dec 2008 14:05:50 +0000
parents c785f98c6737
children f3a65dff1912
comparison
equal deleted inserted replaced
4535:69a1eda3da06 4539:061e030e3270
231 if (arg[strlen (arg) - 1] == '\n') 231 if (arg[strlen (arg) - 1] == '\n')
232 arg[strlen (arg) - 1] = '\0'; /* chop \n */ 232 arg[strlen (arg) - 1] = '\0'; /* chop \n */
233 err_count += scan_file (arg); 233 err_count += scan_file (arg);
234 } 234 }
235 } 235 }
236 else if (argc > i + 1 && !strcmp (argv[i], "-d"))
237 {
238 /* XEmacs change; allow more than one chdir.
239 The idea is that the second chdir is to source-lisp, and that
240 any Lisp files not under there have the full path specified. */
241 i += 1;
242 chdir (argv[i]);
243 continue;
244 }
236 else 245 else
237 { 246 {
238 int j; 247 int j;
239 /* Don't process one file twice. */ 248 /* Don't process one file twice. */
240 for (j = first_infile; j < i; j++) 249 for (j = first_infile; j < i; j++)
267 276
268 /* Add a source file name boundary in the output file. */ 277 /* Add a source file name boundary in the output file. */
269 static void 278 static void
270 put_filename (const char *filename) 279 put_filename (const char *filename)
271 { 280 {
281 /* XEmacs change; don't strip directory information. */
282 #if 0
272 const char *tmp; 283 const char *tmp;
273 284
274 /* Why are we cutting this off? */
275 for (tmp = filename; *tmp; tmp++) 285 for (tmp = filename; *tmp; tmp++)
276 { 286 {
277 if (IS_DIRECTORY_SEP(*tmp)) 287 if (IS_DIRECTORY_SEP(*tmp))
278 filename = tmp + 1; 288 filename = tmp + 1;
279 } 289 }
290 #endif
280 291
281 /* <= because sizeof includes the nul byte at the end. Not quite right, 292 /* <= because sizeof includes the nul byte at the end. Not quite right,
282 because it should include the length of the symbol + "\037[VF]" instead 293 because it should include the length of the symbol + "\037[VF]" instead
283 of simply 10. */ 294 of simply 10. */
284 assert(sizeof("\037S\n") + strlen(filename) + 10 295 assert(sizeof("\037S\n") + strlen(filename) + 10
1388 1399
1389 In the latter case, the opening quote (and leading 1400 In the latter case, the opening quote (and leading
1390 backslash-newline) have already been read. */ 1401 backslash-newline) have already been read. */
1391 1402
1392 put_filename (filename); /* XEmacs addition */ 1403 put_filename (filename); /* XEmacs addition */
1393 putc ('\n', outfile); /* XEmacs addition */
1394 putc (037, outfile); 1404 putc (037, outfile);
1395 putc (type, outfile); 1405 putc (type, outfile);
1396 fprintf (outfile, "%s\n", buffer); 1406 fprintf (outfile, "%s\n", buffer);
1397 if (saved_string) 1407 if (saved_string)
1398 { 1408 {