Mercurial > hg > xemacs-beta
comparison src/doc.c @ 20:859a2309aef8 r19-15b93
Import from CVS: tag r19-15b93
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:50:05 +0200 |
parents | 9ee227acff29 |
children | 441bb1e64a06 |
comparison
equal
deleted
inserted
replaced
19:ac1f612d5250 | 20:859a2309aef8 |
---|---|
284 if (!STRINGP (string)) | 284 if (!STRINGP (string)) |
285 signal_simple_error ("loading bytecode failed to return string", string); | 285 signal_simple_error ("loading bytecode failed to return string", string); |
286 return Fread (string); | 286 return Fread (string); |
287 } | 287 } |
288 | 288 |
289 DEFUN ("documentation", Fdocumentation, Sdocumentation, 1, 2, 0 /* | 289 DEFUN ("documentation", Fdocumentation, 1, 2, 0, /* |
290 Return the documentation string of FUNCTION. | 290 Return the documentation string of FUNCTION. |
291 Unless a non-nil second argument is given, the | 291 Unless a non-nil second argument is given, the |
292 string is passed through `substitute-command-keys'. | 292 string is passed through `substitute-command-keys'. |
293 */ ) | 293 */ |
294 (function, raw) | 294 (function, raw)) |
295 Lisp_Object function, raw; | |
296 { | 295 { |
297 /* This function can GC */ | 296 /* This function can GC */ |
298 Lisp_Object fun; | 297 Lisp_Object fun; |
299 Lisp_Object doc; | 298 Lisp_Object doc; |
300 | 299 |
382 UNGCPRO; | 381 UNGCPRO; |
383 } | 382 } |
384 return doc; | 383 return doc; |
385 } | 384 } |
386 | 385 |
387 DEFUN ("documentation-property", Fdocumentation_property, | 386 DEFUN ("documentation-property", Fdocumentation_property, 2, 3, 0, /* |
388 Sdocumentation_property, 2, 3, 0 /* | |
389 Return the documentation string that is SYMBOL's PROP property. | 387 Return the documentation string that is SYMBOL's PROP property. |
390 This is like `get', but it can refer to strings stored in the | 388 This is like `get', but it can refer to strings stored in the |
391 `doc-directory/DOC' file; and if the value is a string, it is passed | 389 `doc-directory/DOC' file; and if the value is a string, it is passed |
392 through `substitute-command-keys'. A non-nil third argument avoids this | 390 through `substitute-command-keys'. A non-nil third argument avoids this |
393 translation. | 391 translation. |
394 */ ) | 392 */ |
395 (sym, prop, raw) | 393 (sym, prop, raw)) |
396 Lisp_Object sym, prop, raw; | |
397 { | 394 { |
398 /* This function can GC */ | 395 /* This function can GC */ |
399 REGISTER Lisp_Object doc; | 396 REGISTER Lisp_Object doc; |
400 #ifdef I18N3 | 397 #ifdef I18N3 |
401 REGISTER Lisp_Object domain; | 398 REGISTER Lisp_Object domain; |
430 message ("Note: Strange doc (%s) for %s %s @ %d", | 427 message ("Note: Strange doc (%s) for %s %s @ %d", |
431 weirdness, type, string_data (XSYMBOL (sym)->name), pos); | 428 weirdness, type, string_data (XSYMBOL (sym)->name), pos); |
432 } | 429 } |
433 | 430 |
434 | 431 |
435 DEFUN ("Snarf-documentation", Fsnarf_documentation, Ssnarf_documentation, | 432 DEFUN ("Snarf-documentation", Fsnarf_documentation, 1, 1, 0, /* |
436 1, 1, 0 /* | |
437 Used during Emacs initialization, before dumping runnable Emacs, | 433 Used during Emacs initialization, before dumping runnable Emacs, |
438 to find pointers to doc strings stored in `.../lib-src/DOC' and | 434 to find pointers to doc strings stored in `.../lib-src/DOC' and |
439 record them in function definitions. | 435 record them in function definitions. |
440 One arg, FILENAME, a string which does not include a directory. | 436 One arg, FILENAME, a string which does not include a directory. |
441 The file is written to `../lib-src', and later found in `exec-directory' | 437 The file is written to `../lib-src', and later found in `exec-directory' |
442 when doc strings are referred to in the dumped Emacs. | 438 when doc strings are referred to in the dumped Emacs. |
443 */ ) | 439 */ |
444 (filename) | 440 (filename)) |
445 Lisp_Object filename; | |
446 { | 441 { |
447 /* !!#### This function has not been Mule-ized */ | 442 /* !!#### This function has not been Mule-ized */ |
448 int fd; | 443 int fd; |
449 char buf[1024 + 1]; | 444 char buf[1024 + 1]; |
450 REGISTER int filled; | 445 REGISTER int filled; |
734 XCDR (closure) = Qt; | 729 XCDR (closure) = Qt; |
735 } | 730 } |
736 } | 731 } |
737 } | 732 } |
738 | 733 |
739 DEFUN ("Verify-documentation", Fverify_documentation, Sverify_documentation, | 734 DEFUN ("Verify-documentation", Fverify_documentation, 0, 0, 0, /* |
740 0, 0, 0 /* | |
741 Used to make sure everything went well with Snarf-documentation. | 735 Used to make sure everything went well with Snarf-documentation. |
742 Writes to stderr if not. | 736 Writes to stderr if not. |
743 */ ) | 737 */ |
744 () | 738 ()) |
745 { | 739 { |
746 Lisp_Object closure = Fcons (Qnil, Qnil); | 740 Lisp_Object closure = Fcons (Qnil, Qnil); |
747 struct gcpro gcpro1; | 741 struct gcpro gcpro1; |
748 GCPRO1 (closure); | 742 GCPRO1 (closure); |
749 map_obarray (Vobarray, verify_doc_mapper, closure); | 743 map_obarray (Vobarray, verify_doc_mapper, closure); |
754 UNGCPRO; | 748 UNGCPRO; |
755 return (NILP (Fcdr (closure)) ? Qt : Qnil); | 749 return (NILP (Fcdr (closure)) ? Qt : Qnil); |
756 } | 750 } |
757 | 751 |
758 | 752 |
759 DEFUN ("substitute-command-keys", Fsubstitute_command_keys, | 753 DEFUN ("substitute-command-keys", Fsubstitute_command_keys, 1, 1, 0, /* |
760 Ssubstitute_command_keys, 1, 1, 0 /* | |
761 Substitute key descriptions for command names in STRING. | 754 Substitute key descriptions for command names in STRING. |
762 Return a new string which is STRING with substrings of the form \\=\\[COMMAND] | 755 Return a new string which is STRING with substrings of the form \\=\\[COMMAND] |
763 replaced by either: a keystroke sequence that will invoke COMMAND, | 756 replaced by either: a keystroke sequence that will invoke COMMAND, |
764 or \"M-x COMMAND\" if COMMAND is not on any keys. | 757 or \"M-x COMMAND\" if COMMAND is not on any keys. |
765 Substrings of the form \\=\\{MAPVAR} are replaced by summaries | 758 Substrings of the form \\=\\{MAPVAR} are replaced by summaries |
766 \(made by describe-bindings) of the value of MAPVAR, taken as a keymap. | 759 \(made by describe-bindings) of the value of MAPVAR, taken as a keymap. |
767 Substrings of the form \\=\\<MAPVAR> specify to use the value of MAPVAR | 760 Substrings of the form \\=\\<MAPVAR> specify to use the value of MAPVAR |
768 as the keymap for future \\=\\[COMMAND] substrings. | 761 as the keymap for future \\=\\[COMMAND] substrings. |
769 \\=\\= quotes the following character and is discarded; | 762 \\=\\= quotes the following character and is discarded; |
770 thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ into the output. | 763 thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ into the output. |
771 */ ) | 764 */ |
772 (str) | 765 (str)) |
773 Lisp_Object str; | |
774 { | 766 { |
775 /* This function can GC */ | 767 /* This function can GC */ |
776 Bufbyte *buf; | 768 Bufbyte *buf; |
777 int changed = 0; | 769 int changed = 0; |
778 REGISTER Bufbyte *strdata; | 770 REGISTER Bufbyte *strdata; |
999 /************************************************************************/ | 991 /************************************************************************/ |
1000 | 992 |
1001 void | 993 void |
1002 syms_of_doc (void) | 994 syms_of_doc (void) |
1003 { | 995 { |
1004 defsubr (&Sdocumentation); | 996 DEFSUBR (Fdocumentation); |
1005 defsubr (&Sdocumentation_property); | 997 DEFSUBR (Fdocumentation_property); |
1006 defsubr (&Ssnarf_documentation); | 998 DEFSUBR (Fsnarf_documentation); |
1007 defsubr (&Sverify_documentation); | 999 DEFSUBR (Fverify_documentation); |
1008 defsubr (&Ssubstitute_command_keys); | 1000 DEFSUBR (Fsubstitute_command_keys); |
1009 } | 1001 } |
1010 | 1002 |
1011 void | 1003 void |
1012 vars_of_doc (void) | 1004 vars_of_doc (void) |
1013 { | 1005 { |