aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuc Teirlinck2004-02-12 01:55:59 +0000
committerLuc Teirlinck2004-02-12 01:55:59 +0000
commitdd4a1d28d571731f3d92a7cebf14bc6284a4e782 (patch)
tree3a688f25df84a1416ce5448d6563617d76a49c3b
parent6827d7308dca8bdef1836dd572942ea5bbae780f (diff)
downloademacs-dd4a1d28d571731f3d92a7cebf14bc6284a4e782.tar.gz
emacs-dd4a1d28d571731f3d92a7cebf14bc6284a4e782.zip
(Comment Tips): Document the new conventions for commenting out code.
-rw-r--r--lispref/tips.texi17
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
802the left margin. These are used, occasionally, for comments within 802the left margin. These are used, occasionally, for comments within
803functions that should start at the margin. We also use them sometimes 803functions that should start at the margin. We also use them sometimes
804for comments that are between functions---whether to use two or three 804for comments that are between functions---whether to use two or three
805semicolons there is a matter of style. 805semicolons depends on whether the comment should be considered a
806``heading'' by Outline minor mode. By default, comments starting with
807at least three semicolons (followed by a single space and a
808non-whitespace character) are considered headings, comments starting
809with two or less are not.
806 810
807Another use for triple-semicolon comments is for commenting out lines 811Another use for triple-semicolon comments is for commenting out lines
808within a function. We use three semicolons for this precisely so that 812within a function. We use three semicolons for this precisely so that
809they remain at the left margin. 813they remain at the left margin. By default, Outline minor mode does
814not consider a comment to be a heading (even if it starts with at
815least three semicolons) if the semicolons are followed by at least two
816spaces. Thus, if you add an introductory comment to the commented out
817code, make sure to indent it by at least two spaces after the three
818semicolons.
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
827When commenting out entire functions, use two semicolons.
828
818@item ;;;; 829@item ;;;;
819Comments that start with four semicolons, @samp{;;;;}, should be aligned 830Comments that start with four semicolons, @samp{;;;;}, should be aligned
820to the left margin and are used for headings of major sections of a 831to the left margin and are used for headings of major sections of a