diff options
| author | Chong Yidong | 2008-03-28 19:04:23 +0000 |
|---|---|---|
| committer | Chong Yidong | 2008-03-28 19:04:23 +0000 |
| commit | 25716538ef22736ff5d9f04ef3644019eb98dd9a (patch) | |
| tree | 9073e80074cf96ce53f7b7349e6fc6b0db6fa804 | |
| parent | 4c987d7128087de46f87cfb9b0eebe837e7b4cc7 (diff) | |
| download | emacs-25716538ef22736ff5d9f04ef3644019eb98dd9a.tar.gz emacs-25716538ef22736ff5d9f04ef3644019eb98dd9a.zip | |
(Moving by Defuns, Expressions, Comment Commands): Describe Transient
Mark mode as the default.
| -rw-r--r-- | doc/emacs/programs.texi | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index 9c12199b00c..2b8cbf895fa 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi | |||
| @@ -257,14 +257,15 @@ the same as @kbd{C-M-a} with a positive argument. | |||
| 257 | 257 | ||
| 258 | @kindex C-M-h @r{(C mode)} | 258 | @kindex C-M-h @r{(C mode)} |
| 259 | @findex c-mark-function | 259 | @findex c-mark-function |
| 260 | To operate on the current defun, use @kbd{C-M-h} (@code{mark-defun}) | 260 | To operate on the current defun, use @kbd{C-M-h} |
| 261 | which puts point at the beginning and mark at the end of the current | 261 | (@code{mark-defun}), which sets the mark at the end of the current |
| 262 | defun. This is the easiest way to get ready to kill the defun in | 262 | defun and puts point at its beginning. @xref{Marking Objects}. This |
| 263 | order to move it to a different place in the file. If you use the | 263 | is the easiest way to get ready to kill the defun in order to move it |
| 264 | command while point is between defuns, it uses the following defun. | 264 | to a different place in the file. If you use the command while point |
| 265 | Successive uses of @kbd{C-M-h}, or using it in Transient Mark mode | 265 | is between defuns, it uses the following defun. If you use the |
| 266 | when the mark is active, extends the end of the region to include one | 266 | command while the mark is already active, it sets the mark but does |
| 267 | more defun each time. | 267 | not move point; furthermore, each successive use of @kbd{C-M-h} |
| 268 | extends the end of the region to include one more defun. | ||
| 268 | 269 | ||
| 269 | In C mode, @kbd{C-M-h} runs the function @code{c-mark-function}, | 270 | In C mode, @kbd{C-M-h} runs the function @code{c-mark-function}, |
| 270 | which is almost the same as @code{mark-defun}; the difference is that | 271 | which is almost the same as @code{mark-defun}; the difference is that |
| @@ -739,13 +740,14 @@ after point and the mark. | |||
| 739 | @kindex C-M-@key{SPC} | 740 | @kindex C-M-@key{SPC} |
| 740 | @findex mark-sexp | 741 | @findex mark-sexp |
| 741 | To set the region around the next balanced expression in the buffer, | 742 | To set the region around the next balanced expression in the buffer, |
| 742 | use @kbd{C-M-@@} (@code{mark-sexp}), which sets mark at the same place | 743 | use @kbd{C-M-@key{SPC}} (@code{mark-sexp}), which sets mark at the |
| 743 | that @kbd{C-M-f} would move to. @kbd{C-M-@@} takes arguments like | 744 | same place that @kbd{C-M-f} would move to. @kbd{C-M-@key{SPC}} treats |
| 744 | @kbd{C-M-f}. In particular, a negative argument is useful for putting | 745 | numeric arguments in the same way as @kbd{C-M-f}; in particular, a |
| 745 | the mark at the beginning of the previous balanced expression. The | 746 | negative argument puts the mark at the beginning of the previous |
| 746 | alias @kbd{C-M-@key{SPC}} is equivalent to @kbd{C-M-@@}. When you | 747 | balanced expression. The alias @kbd{C-M-@@} is equivalent to |
| 747 | repeat this command, or use it in Transient Mark mode when the mark is | 748 | @kbd{C-M-@key{SPC}}. While the mark is active, each successive use of |
| 748 | active, it extends the end of the region by one sexp each time. | 749 | @kbd{C-M-@key{SPC}} extends the region by shifting the mark by one |
| 750 | sexp. | ||
| 749 | 751 | ||
| 750 | In languages that use infix operators, such as C, it is not possible | 752 | In languages that use infix operators, such as C, it is not possible |
| 751 | to recognize all balanced expressions as such because there can be | 753 | to recognize all balanced expressions as such because there can be |
| @@ -941,16 +943,14 @@ programmed so that when it receives a prefix argument it calls | |||
| 941 | @code{comment-kill}. However, @code{comment-kill} is a valid command | 943 | @code{comment-kill}. However, @code{comment-kill} is a valid command |
| 942 | in its own right, and you can bind it directly to a key if you wish. | 944 | in its own right, and you can bind it directly to a key if you wish. |
| 943 | 945 | ||
| 944 | @kbd{M-;} does two other jobs when used with an active region in | 946 | When a region is active, @kbd{M-;} does either adds or removes |
| 945 | Transient Mark mode (@pxref{Transient Mark}). Then it either adds or | 947 | comment delimiters on each line of the region. @xref{Mark}. If every |
| 946 | removes comment delimiters on each line of the region. (If every line | 948 | line in the region is a comment, it removes comment delimiters from |
| 947 | is a comment, it removes comment delimiters from each; otherwise, it | 949 | each; otherwise, it adds comment delimiters to each. You can also use |
| 948 | adds comment delimiters to each.) If you are not using Transient Mark | 950 | the commands @code{comment-region} and @code{uncomment-region} to do |
| 949 | mode, then you should use the commands @code{comment-region} and | 951 | these jobs (@pxref{Multi-Line Comments}). A prefix argument used in |
| 950 | @code{uncomment-region} to do these jobs (@pxref{Multi-Line Comments}), | 952 | these circumstances specifies how many comment delimiters to add or |
| 951 | or else enable Transient Mark mode momentarily (@pxref{Momentary Mark}). | 953 | how many to delete. |
| 952 | A prefix argument used in these circumstances specifies how many | ||
| 953 | comment delimiters to add or how many to delete. | ||
| 954 | 954 | ||
| 955 | Some major modes have special rules for aligning certain kinds of | 955 | Some major modes have special rules for aligning certain kinds of |
| 956 | comments in certain contexts. For example, in Lisp code, comments which | 956 | comments in certain contexts. For example, in Lisp code, comments which |