aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorStefan Monnier2013-10-06 23:46:32 -0400
committerStefan Monnier2013-10-06 23:46:32 -0400
commit6de913c47e8efa3d2e234cb78c4c28ad681cfd21 (patch)
treebd90bcdc598dad78f52b4e9febccad0af9c744ce /doc
parent7ccae3b126e1b01814e8bed7f903f5e2b6d448bd (diff)
downloademacs-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/ChangeLog5
-rw-r--r--doc/lispref/tips.texi30
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 @@
12013-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
12013-10-05 Xue Fuqiao <xfq.free@gmail.com> 62013-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 ;;;
879Comments that start with three semicolons, @samp{;;;}, should start at 879Comments that start with three semicolons, @samp{;;;}, should start at
880the left margin. These are used, occasionally, for comments within 880the left margin. We use them
881functions that should start at the margin. We also use them sometimes 881for comments which should be considered a
882for comments that are between functions---whether to use two or three
883semicolons 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
885at least three semicolons (followed by a single space and a 883at least three semicolons (followed by a single space and a
886non-whitespace character) are considered headings, comments starting 884non-whitespace character) are considered headings, comments starting
887with two or fewer are not. 885with two or fewer are not. Historically, triple-semicolon comments have
888 886also been used for commenting out lines within a function, but this use
889Another use for triple-semicolon comments is for commenting out lines 887is discouraged.
890within a function. We use three semicolons for this precisely so that
891they remain at the left margin. By default, Outline minor mode does
892not consider a comment to be a heading (even if it starts with at
893least three semicolons) if the semicolons are followed by at least two
894spaces. Thus, if you add an introductory comment to the commented out
895code, make sure to indent it by at least two spaces after the three
896semicolons.
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
905When commenting out entire functions, use two semicolons. 889When commenting out entire functions, use two semicolons.
906 890