diff options
| author | Chong Yidong | 2008-11-30 22:10:02 +0000 |
|---|---|---|
| committer | Chong Yidong | 2008-11-30 22:10:02 +0000 |
| commit | 8474de5b4b51f3b2f7c2edee587c1e3b9734ec26 (patch) | |
| tree | 47bda474e3009af6f273a1fdec9cc0b1a9c6b867 | |
| parent | 72e6decd6065e54f36eec997305ee42d1311fa62 (diff) | |
| download | emacs-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.texi | 53 |
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 | |||
| 910 | different jobs relating to comments, depending on the situation where | 910 | different jobs relating to comments, depending on the situation where |
| 911 | you use it. | 911 | you 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 |
| 914 | comment, aligned at a specific column called the @dfn{comment column}. | 914 | delimiters on each line of the region. @xref{Mark}. If every line in |
| 915 | The new comment begins with the string Emacs thinks comments should | 915 | the region is a comment, it removes comment delimiters from each; |
| 916 | start with (the value of @code{comment-start}; see below). Point is | 916 | otherwise, it adds comment delimiters to each. You can also use the |
| 917 | after that string, so you can insert the text of the comment right | 917 | commands @code{comment-region} and @code{uncomment-region} to |
| 918 | away. If the major mode has specified a string to terminate comments, | 918 | explicitly 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 | 921 | delimiters to add or how many to delete. |
| 922 | command 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 |
| 924 | there is no comment already on the line. The new comment is normally | ||
| 925 | aligned at a specific column called the @dfn{comment column}; if the | ||
| 926 | text of the line extends past the comment column, @kbd{M-;} aligns the | ||
| 927 | comment start string to a suitable boundary (usually, at least one | ||
| 928 | space is inserted). The comment begins with the string Emacs thinks | ||
| 929 | comments should start with (the value of @code{comment-start}; see | ||
| 930 | below). Emacs places point after that string, so you can insert the | ||
| 931 | text of the comment right away. If the major mode has specified a | ||
| 932 | string to terminate comments, @kbd{M-;} inserts that string after | ||
| 933 | point, 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 |
| 926 | already contains the comment-start string, @kbd{M-;} realigns it to | 936 | already 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 |
| 943 | in its own right, and you can bind it directly to a key if you wish. | 953 | in 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 | ||
| 946 | delimiters on each line of the region. @xref{Mark}. If every line in | ||
| 947 | the region is a comment, it removes comment delimiters from each; | ||
| 948 | otherwise, it adds comment delimiters to each. You can also use the | ||
| 949 | commands @code{comment-region} and @code{uncomment-region} to do these | ||
| 950 | jobs (@pxref{Multi-Line Comments}). A prefix argument used in these | ||
| 951 | circumstances specifies how many comment delimiters to add or how many | ||
| 952 | to 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 |
| 955 | comments in certain contexts. For example, in Lisp code, comments which | 956 | comments in certain contexts. For example, in Lisp code, comments which |
| 956 | start with two semicolons are indented as if they were lines of code, | 957 | start 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, |
| 1332 | you can type @kbd{@key{ESC} @key{TAB}} or @kbd{C-M-i} instead. | 1333 | you can type @kbd{@key{ESC} @key{TAB}} or @kbd{C-M-i} instead. |
| 1333 | However, most window managers let you customize these shortcuts, and | 1334 | However, most window managers let you customize these shortcuts, so |
| 1334 | we recommend that you change any that get in the way of use of Emacs. | 1335 | you 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 |
| 1337 | that differ in the very next character, so that it is impossible to | 1338 | that 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 | ||
| 1725 | Hide-ifdef minor mode hides selected code within @samp{#if} and | 1727 | Hide-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 | ||
| 1731 | prominent face, instead of hiding them entirely. See the | ||
| 1732 | documentation 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 |