diff options
| author | Luc Teirlinck | 2004-02-12 01:55:59 +0000 |
|---|---|---|
| committer | Luc Teirlinck | 2004-02-12 01:55:59 +0000 |
| commit | dd4a1d28d571731f3d92a7cebf14bc6284a4e782 (patch) | |
| tree | 3a688f25df84a1416ce5448d6563617d76a49c3b | |
| parent | 6827d7308dca8bdef1836dd572942ea5bbae780f (diff) | |
| download | emacs-dd4a1d28d571731f3d92a7cebf14bc6284a4e782.tar.gz emacs-dd4a1d28d571731f3d92a7cebf14bc6284a4e782.zip | |
(Comment Tips): Document the new conventions for commenting out code.
| -rw-r--r-- | lispref/tips.texi | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/lispref/tips.texi b/lispref/tips.texi index 585ec8ee475..c78d13f947e 100644 --- a/lispref/tips.texi +++ b/lispref/tips.texi | |||
| @@ -802,19 +802,30 @@ Comments that start with three semicolons, @samp{;;;}, should start at | |||
| 802 | the left margin. These are used, occasionally, for comments within | 802 | the left margin. These are used, occasionally, for comments within |
| 803 | functions that should start at the margin. We also use them sometimes | 803 | functions that should start at the margin. We also use them sometimes |
| 804 | for comments that are between functions---whether to use two or three | 804 | for comments that are between functions---whether to use two or three |
| 805 | semicolons there is a matter of style. | 805 | semicolons depends on whether the comment should be considered a |
| 806 | ``heading'' by Outline minor mode. By default, comments starting with | ||
| 807 | at least three semicolons (followed by a single space and a | ||
| 808 | non-whitespace character) are considered headings, comments starting | ||
| 809 | with two or less are not. | ||
| 806 | 810 | ||
| 807 | Another use for triple-semicolon comments is for commenting out lines | 811 | Another use for triple-semicolon comments is for commenting out lines |
| 808 | within a function. We use three semicolons for this precisely so that | 812 | within a function. We use three semicolons for this precisely so that |
| 809 | they remain at the left margin. | 813 | they remain at the left margin. By default, Outline minor mode does |
| 814 | not consider a comment to be a heading (even if it starts with at | ||
| 815 | least three semicolons) if the semicolons are followed by at least two | ||
| 816 | spaces. Thus, if you add an introductory comment to the commented out | ||
| 817 | code, make sure to indent it by at least two spaces after the three | ||
| 818 | semicolons. | ||
| 810 | 819 | ||
| 811 | @smallexample | 820 | @smallexample |
| 812 | (defun foo (a) | 821 | (defun foo (a) |
| 813 | ;;; This is no longer necessary. | 822 | ;;; This is no longer necessary. |
| 814 | ;;; (force-mode-line-update) | 823 | ;;; (force-mode-line-update) |
| 815 | (message "Finished with %s" a)) | 824 | (message "Finished with %s" a)) |
| 816 | @end smallexample | 825 | @end smallexample |
| 817 | 826 | ||
| 827 | When commenting out entire functions, use two semicolons. | ||
| 828 | |||
| 818 | @item ;;;; | 829 | @item ;;;; |
| 819 | Comments that start with four semicolons, @samp{;;;;}, should be aligned | 830 | Comments that start with four semicolons, @samp{;;;;}, should be aligned |
| 820 | to the left margin and are used for headings of major sections of a | 831 | to the left margin and are used for headings of major sections of a |