diff options
| author | Stefan Monnier | 2013-10-06 23:46:32 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2013-10-06 23:46:32 -0400 |
| commit | 6de913c47e8efa3d2e234cb78c4c28ad681cfd21 (patch) | |
| tree | bd90bcdc598dad78f52b4e9febccad0af9c744ce /doc | |
| parent | 7ccae3b126e1b01814e8bed7f903f5e2b6d448bd (diff) | |
| download | emacs-6de913c47e8efa3d2e234cb78c4c28ad681cfd21.tar.gz emacs-6de913c47e8efa3d2e234cb78c4c28ad681cfd21.zip | |
* doc/lispref/tips.texi (Comment Tips): Discourage use of triple semi-colons
for non-headings.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/lispref/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/lispref/tips.texi | 30 |
2 files changed, 12 insertions, 23 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index ce2ff2e1665..0a89dbea3d9 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-10-07 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * tips.texi (Comment Tips): Discourage use of triple semi-colons for | ||
| 4 | non-headings. | ||
| 5 | |||
| 1 | 2013-10-05 Xue Fuqiao <xfq.free@gmail.com> | 6 | 2013-10-05 Xue Fuqiao <xfq.free@gmail.com> |
| 2 | 7 | ||
| 3 | * syntax.texi (Categories): Add an index for category sets. | 8 | * syntax.texi (Categories): Add an index for category sets. |
diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi index 2e3760e573e..26d81f738fc 100644 --- a/doc/lispref/tips.texi +++ b/doc/lispref/tips.texi | |||
| @@ -836,10 +836,10 @@ For example: | |||
| 836 | 836 | ||
| 837 | @smallexample | 837 | @smallexample |
| 838 | @group | 838 | @group |
| 839 | (setq base-version-list ; there was a base | 839 | (setq base-version-list ; There was a base |
| 840 | (assoc (substring fn 0 start-vn) ; version to which | 840 | (assoc (substring fn 0 start-vn) ; version to which |
| 841 | file-version-assoc-list)) ; this looks like | 841 | file-version-assoc-list)) ; this looks like |
| 842 | ; a subversion | 842 | ; a subversion. |
| 843 | @end group | 843 | @end group |
| 844 | @end smallexample | 844 | @end smallexample |
| 845 | 845 | ||
| @@ -877,30 +877,14 @@ strings, though. | |||
| 877 | 877 | ||
| 878 | @item ;;; | 878 | @item ;;; |
| 879 | Comments that start with three semicolons, @samp{;;;}, should start at | 879 | Comments that start with three semicolons, @samp{;;;}, should start at |
| 880 | the left margin. These are used, occasionally, for comments within | 880 | the left margin. We use them |
| 881 | functions that should start at the margin. We also use them sometimes | 881 | for comments which should be considered a |
| 882 | for comments that are between functions---whether to use two or three | ||
| 883 | semicolons depends on whether the comment should be considered a | ||
| 884 | ``heading'' by Outline minor mode. By default, comments starting with | 882 | ``heading'' by Outline minor mode. By default, comments starting with |
| 885 | at least three semicolons (followed by a single space and a | 883 | at least three semicolons (followed by a single space and a |
| 886 | non-whitespace character) are considered headings, comments starting | 884 | non-whitespace character) are considered headings, comments starting |
| 887 | with two or fewer are not. | 885 | with two or fewer are not. Historically, triple-semicolon comments have |
| 888 | 886 | also been used for commenting out lines within a function, but this use | |
| 889 | Another use for triple-semicolon comments is for commenting out lines | 887 | is discouraged. |
| 890 | within a function. We use three semicolons for this precisely so that | ||
| 891 | they remain at the left margin. By default, Outline minor mode does | ||
| 892 | not consider a comment to be a heading (even if it starts with at | ||
| 893 | least three semicolons) if the semicolons are followed by at least two | ||
| 894 | spaces. Thus, if you add an introductory comment to the commented out | ||
| 895 | code, make sure to indent it by at least two spaces after the three | ||
| 896 | semicolons. | ||
| 897 | |||
| 898 | @smallexample | ||
| 899 | (defun foo (a) | ||
| 900 | ;;; This is no longer necessary. | ||
| 901 | ;;; (force-mode-line-update) | ||
| 902 | (message "Finished with %s" a)) | ||
| 903 | @end smallexample | ||
| 904 | 888 | ||
| 905 | When commenting out entire functions, use two semicolons. | 889 | When commenting out entire functions, use two semicolons. |
| 906 | 890 | ||