diff options
| author | Richard M. Stallman | 2001-10-30 18:26:30 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2001-10-30 18:26:30 +0000 |
| commit | 5c5b7d3e7de97c604de26580828d32ecaf355cf7 (patch) | |
| tree | 490d4d6728384643fe446c4a8f1201a018c3e896 | |
| parent | 2dc96f0f8e2307d827eaa72da4d886e526d10bdb (diff) | |
| download | emacs-5c5b7d3e7de97c604de26580828d32ecaf355cf7.tar.gz emacs-5c5b7d3e7de97c604de26580828d32ecaf355cf7.zip | |
Document textual convention for doc strings of predicates.
Say never to change the case of a symbol.
| -rw-r--r-- | lispref/tips.texi | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lispref/tips.texi b/lispref/tips.texi index 20fe774d185..3031ac5ce92 100644 --- a/lispref/tips.texi +++ b/lispref/tips.texi | |||
| @@ -562,6 +562,13 @@ all non-@code{nil} values are equivalent and indicate explicitly what | |||
| 562 | @code{nil} and non-@code{nil} mean. | 562 | @code{nil} and non-@code{nil} mean. |
| 563 | 563 | ||
| 564 | @item | 564 | @item |
| 565 | The documentation string for a function that is a yes-or-no predicate | ||
| 566 | should start with words such as ``Return t if @dots{}'', to indicate | ||
| 567 | explicitly what constitutes ``truth''. The word ``return'' avoids | ||
| 568 | starting the sentence with lower-case ``t'', which is somewhat | ||
| 569 | distracting. | ||
| 570 | |||
| 571 | @item | ||
| 565 | When a function's documentation string mentions the value of an argument | 572 | When a function's documentation string mentions the value of an argument |
| 566 | of the function, use the argument name in capital letters as if it were | 573 | of the function, use the argument name in capital letters as if it were |
| 567 | a name for that value. Thus, the documentation string of the function | 574 | a name for that value. Thus, the documentation string of the function |
| @@ -583,6 +590,20 @@ have the form (KEY . VALUE). Here, KEY is ... | |||
| 583 | @end example | 590 | @end example |
| 584 | 591 | ||
| 585 | @item | 592 | @item |
| 593 | Never change the case of a Lisp symbol when you mention it in a doc | ||
| 594 | string. If the symbol's name is @code{foo}, write ``foo'', not | ||
| 595 | ``Foo'' (which is a different symbol). | ||
| 596 | |||
| 597 | This might appear to contradict the policy of writing function | ||
| 598 | argument values, but there is no real contradiction; the argument | ||
| 599 | @emph{value} is not the same thing as the @emph{symbol} which the | ||
| 600 | function uses to hold the value. | ||
| 601 | |||
| 602 | If this puts a lower-case letter at the beginning of a sentence | ||
| 603 | and that annoys you, rewrite the sentence so that the symbol | ||
| 604 | is not at the start of it. | ||
| 605 | |||
| 606 | @item | ||
| 586 | If a line in a documentation string begins with an open-parenthesis, | 607 | If a line in a documentation string begins with an open-parenthesis, |
| 587 | write a backslash before the open-parenthesis, like this: | 608 | write a backslash before the open-parenthesis, like this: |
| 588 | 609 | ||