Mercurial > emacs
comparison lispref/tips.texi @ 53924:ed40e77a5176
(Comment Tips): Document the new conventions for commenting out code.
author | Luc Teirlinck <teirllm@auburn.edu> |
---|---|
date | Thu, 12 Feb 2004 01:55:59 +0000 |
parents | 3bd5e3d6a230 |
children | ff694e194b01 |
comparison
equal
deleted
inserted
replaced
53923:3517efa33c1f | 53924:ed40e77a5176 |
---|---|
800 @item ;;; | 800 @item ;;; |
801 Comments that start with three semicolons, @samp{;;;}, should start at | 801 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 |
826 | |
827 When commenting out entire functions, use two semicolons. | |
817 | 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 |
821 program. For example: | 832 program. For example: |