Mercurial > emacs
comparison lispref/tips.texi @ 42979:7359d6d75a9c
Minor cleanups.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 26 Jan 2002 22:43:53 +0000 |
parents | fb31125d0d7b |
children | 774d49397ece |
comparison
equal
deleted
inserted
replaced
42978:dcc8ffab2cec | 42979:7359d6d75a9c |
---|---|
481 by using a comment instead of a documentation string, but that is no | 481 by using a comment instead of a documentation string, but that is no |
482 longer the case---documentation strings now take up very little space in | 482 longer the case---documentation strings now take up very little space in |
483 a running Emacs. | 483 a running Emacs. |
484 | 484 |
485 @item | 485 @item |
486 Format the documentation string so that it fits in an Emacs window on an | |
487 80-column screen. It is a good idea for most lines to be no wider than | |
488 60 characters. The first line should not be wider than 67 characters | |
489 or it will look bad in the output of @code{apropos}. | |
490 | |
491 You can fill the text if that looks good. However, rather than blindly | |
492 filling the entire documentation string, you can often make it much more | |
493 readable by choosing certain line breaks with care. Use blank lines | |
494 between topics if the documentation string is long. | |
495 | |
496 @item | |
486 The first line of the documentation string should consist of one or two | 497 The first line of the documentation string should consist of one or two |
487 complete sentences that stand on their own as a summary. @kbd{M-x | 498 complete sentences that stand on their own as a summary. @kbd{M-x |
488 apropos} displays just the first line, and if that line's contents don't | 499 apropos} displays just the first line, and if that line's contents don't |
489 stand on their own, the result looks bad. In particular, start the | 500 stand on their own, the result looks bad. In particular, start the |
490 first line with a capital letter and end with a period. | 501 first line with a capital letter and end with a period. |
501 For consistency, phrase the verb in the first sentence of a function's | 512 For consistency, phrase the verb in the first sentence of a function's |
502 documentation string as an imperative--for instance, use ``Return the | 513 documentation string as an imperative--for instance, use ``Return the |
503 cons of A and B.'' in preference to ``Returns the cons of A and B@.'' | 514 cons of A and B.'' in preference to ``Returns the cons of A and B@.'' |
504 Usually it looks good to do likewise for the rest of the first | 515 Usually it looks good to do likewise for the rest of the first |
505 paragraph. Subsequent paragraphs usually look better if each sentence | 516 paragraph. Subsequent paragraphs usually look better if each sentence |
506 has a proper subject. | 517 is indicative and has a proper subject. |
507 | 518 |
508 @item | 519 @item |
509 Write documentation strings in the active voice, not the passive, and in | 520 Write documentation strings in the active voice, not the passive, and in |
510 the present tense, not the future. For instance, use ``Return a list | 521 the present tense, not the future. For instance, use ``Return a list |
511 containing A and B.'' instead of ``A list containing A and B will be | 522 containing A and B.'' instead of ``A list containing A and B will be |
525 In Dired, visit the file or directory named on this line. | 536 In Dired, visit the file or directory named on this line. |
526 @end example | 537 @end example |
527 | 538 |
528 @item | 539 @item |
529 Do not start or end a documentation string with whitespace. | 540 Do not start or end a documentation string with whitespace. |
530 | |
531 @item | |
532 Format the documentation string so that it fits in an Emacs window on an | |
533 80-column screen. It is a good idea for most lines to be no wider than | |
534 60 characters. The first line should not be wider than 67 characters | |
535 or it will look bad in the output of @code{apropos}. | |
536 | |
537 You can fill the text if that looks good. However, rather than blindly | |
538 filling the entire documentation string, you can often make it much more | |
539 readable by choosing certain line breaks with care. Use blank lines | |
540 between topics if the documentation string is long. | |
541 | 541 |
542 @item | 542 @item |
543 @strong{Do not} indent subsequent lines of a documentation string so | 543 @strong{Do not} indent subsequent lines of a documentation string so |
544 that the text is lined up in the source code with the text of the first | 544 that the text is lined up in the source code with the text of the first |
545 line. This looks nice in the source code, but looks bizarre when users | 545 line. This looks nice in the source code, but looks bizarre when users |