aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2008-11-30 22:10:02 +0000
committerChong Yidong2008-11-30 22:10:02 +0000
commit8474de5b4b51f3b2f7c2edee587c1e3b9734ec26 (patch)
tree47bda474e3009af6f273a1fdec9cc0b1a9c6b867
parent72e6decd6065e54f36eec997305ee42d1311fa62 (diff)
downloademacs-8474de5b4b51f3b2f7c2edee587c1e3b9734ec26.tar.gz
emacs-8474de5b4b51f3b2f7c2edee587c1e3b9734ec26.zip
(Other C Commands): Document hide-ifdef-shadow.
(Comment Commands): Discuss region-active behavior of M-; first.
-rw-r--r--doc/emacs/programs.texi53
1 files changed, 29 insertions, 24 deletions
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi
index f42434a3cb7..cb528710acf 100644
--- a/doc/emacs/programs.texi
+++ b/doc/emacs/programs.texi
@@ -910,17 +910,27 @@ I Mean''; it indicates that this command can be used for many
910different jobs relating to comments, depending on the situation where 910different jobs relating to comments, depending on the situation where
911you use it. 911you use it.
912 912
913 If there is no comment already on the line, @kbd{M-;} inserts a new 913 When a region is active, @kbd{M-;} either adds or removes comment
914comment, aligned at a specific column called the @dfn{comment column}. 914delimiters on each line of the region. @xref{Mark}. If every line in
915The new comment begins with the string Emacs thinks comments should 915the region is a comment, it removes comment delimiters from each;
916start with (the value of @code{comment-start}; see below). Point is 916otherwise, it adds comment delimiters to each. You can also use the
917after that string, so you can insert the text of the comment right 917commands @code{comment-region} and @code{uncomment-region} to
918away. If the major mode has specified a string to terminate comments, 918explicitly comment or uncomment the text in the region
919@kbd{M-;} inserts that after point, to keep the syntax valid. 919(@pxref{Multi-Line Comments}). If you supply a prefix argument to
920 920@kbd{M-;} when a region is active, that specifies how many comment
921 If the text of the line extends past the comment column, this 921delimiters to add or how many to delete.
922command aligns the comment start string to a suitable boundary 922
923(usually, at least one space is inserted). 923 If the region is not active, @kbd{M-;} inserts a new comment if
924there is no comment already on the line. The new comment is normally
925aligned at a specific column called the @dfn{comment column}; if the
926text of the line extends past the comment column, @kbd{M-;} aligns the
927comment start string to a suitable boundary (usually, at least one
928space is inserted). The comment begins with the string Emacs thinks
929comments should start with (the value of @code{comment-start}; see
930below). Emacs places point after that string, so you can insert the
931text of the comment right away. If the major mode has specified a
932string to terminate comments, @kbd{M-;} inserts that string after
933point, to keep the syntax valid.
924 934
925 You can also use @kbd{M-;} to align an existing comment. If a line 935 You can also use @kbd{M-;} to align an existing comment. If a line
926already contains the comment-start string, @kbd{M-;} realigns it to 936already contains the comment-start string, @kbd{M-;} realigns it to
@@ -942,15 +952,6 @@ programmed so that when it receives a prefix argument it calls
942@code{comment-kill}. However, @code{comment-kill} is a valid command 952@code{comment-kill}. However, @code{comment-kill} is a valid command
943in its own right, and you can bind it directly to a key if you wish. 953in its own right, and you can bind it directly to a key if you wish.
944 954
945 When a region is active, @kbd{M-;} either adds or removes comment
946delimiters on each line of the region. @xref{Mark}. If every line in
947the region is a comment, it removes comment delimiters from each;
948otherwise, it adds comment delimiters to each. You can also use the
949commands @code{comment-region} and @code{uncomment-region} to do these
950jobs (@pxref{Multi-Line Comments}). A prefix argument used in these
951circumstances specifies how many comment delimiters to add or how many
952to delete.
953
954 Some major modes have special rules for aligning certain kinds of 955 Some major modes have special rules for aligning certain kinds of
955comments in certain contexts. For example, in Lisp code, comments which 956comments in certain contexts. For example, in Lisp code, comments which
956start with two semicolons are indented as if they were lines of code, 957start with two semicolons are indented as if they were lines of code,
@@ -1330,8 +1331,8 @@ it can determine from the partial name.
1330 1331
1331 If your window manager defines @kbd{M-@key{TAB}} to switch windows, 1332 If your window manager defines @kbd{M-@key{TAB}} to switch windows,
1332you can type @kbd{@key{ESC} @key{TAB}} or @kbd{C-M-i} instead. 1333you can type @kbd{@key{ESC} @key{TAB}} or @kbd{C-M-i} instead.
1333However, most window managers let you customize these shortcuts, and 1334However, most window managers let you customize these shortcuts, so
1334we recommend that you change any that get in the way of use of Emacs. 1335you can change any that interfere with the way you use Emacs.
1335 1336
1336 If the partial name in the buffer has multiple possible completions 1337 If the partial name in the buffer has multiple possible completions
1337that differ in the very next character, so that it is impossible to 1338that differ in the very next character, so that it is impossible to
@@ -1722,9 +1723,13 @@ it work.
1722@item M-x hide-ifdef-mode 1723@item M-x hide-ifdef-mode
1723@findex hide-ifdef-mode 1724@findex hide-ifdef-mode
1724@cindex Hide-ifdef mode 1725@cindex Hide-ifdef mode
1726@vindex hide-ifdef-shadow
1725Hide-ifdef minor mode hides selected code within @samp{#if} and 1727Hide-ifdef minor mode hides selected code within @samp{#if} and
1726@samp{#ifdef} preprocessor blocks. See the documentation string of 1728@samp{#ifdef} preprocessor blocks. If you change the variable
1727@code{hide-ifdef-mode} for more information. 1729@code{hide-ifdef-shadow} to @code{t}, Hide-ifdef minor mode
1730``shadows'' preprocessor blocks by displaying them with a less
1731prominent face, instead of hiding them entirely. See the
1732documentation string of @code{hide-ifdef-mode} for more information.
1728 1733
1729@item M-x ff-find-related-file 1734@item M-x ff-find-related-file
1730@cindex related files 1735@cindex related files