diff options
| author | Alan Mackenzie | 2006-02-24 12:20:45 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2006-02-24 12:20:45 +0000 |
| commit | 0d566910540fa519c48f90455bdecd4565cea948 (patch) | |
| tree | 93b136b56e067f585d82f86583d04ee87b8ff7c7 | |
| parent | 18f34551f4003fc3f18d85b8056d462fba8a7770 (diff) | |
| download | emacs-0d566910540fa519c48f90455bdecd4565cea948.tar.gz emacs-0d566910540fa519c48f90455bdecd4565cea948.zip | |
(Hungry WS Deletion): Rename c-hungry-backspace to
c-hungry-delete-backwards, at the request of RMS. Leave the old name as
an alias.
(Movement Commands): Correct the definition of c-beginning-of-defun, to include the
function header within the defun.
(Comment Commands): State that C-u M-; kills any existing comment.
(Electric Keys): Add a justification for electric indentation.
(Hungry WS Deletion): Clear up the names and complications of the
BACKSPACE and DELETE keys.
Correct two typos.
| -rw-r--r-- | man/cc-mode.texi | 103 |
1 files changed, 55 insertions, 48 deletions
diff --git a/man/cc-mode.texi b/man/cc-mode.texi index fcc3c59c1f6..80aff8b1604 100644 --- a/man/cc-mode.texi +++ b/man/cc-mode.texi | |||
| @@ -208,9 +208,9 @@ license to the document, as described in section 6 of the license. | |||
| 208 | @vskip 0pt plus 1filll | 208 | @vskip 0pt plus 1filll |
| 209 | @insertcopying | 209 | @insertcopying |
| 210 | 210 | ||
| 211 | This manual was generated from $Revision: 1.34 $ of $RCSfile: cc-mode.texi,v $, which can be | 211 | This manual was generated from $Revision: 1.35 $ of $RCSfile: cc-mode.texi,v $, which can be |
| 212 | downloaded from | 212 | downloaded from |
| 213 | @url{http://cvs.sf.net/viewcvs.py/cc-mode/cc-mode/cc-mode.texi}. | 213 | @url{http://cvs.savannah.gnu.org/viewcvs/emacs/emacs/man/cc-mode.texi}. |
| 214 | @end titlepage | 214 | @end titlepage |
| 215 | 215 | ||
| 216 | @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 216 | @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| @@ -447,7 +447,7 @@ depending on your needs. It describes the @ccmode{} style system and | |||
| 447 | lists the standard styles that @ccmode{} supplies. | 447 | lists the standard styles that @ccmode{} supplies. |
| 448 | 448 | ||
| 449 | @item | 449 | @item |
| 450 | The next few chapters, describe in detail how to customize the various | 450 | The next few chapters describe in detail how to customize the various |
| 451 | features of @ccmode{}. | 451 | features of @ccmode{}. |
| 452 | 452 | ||
| 453 | @item | 453 | @item |
| @@ -525,7 +525,7 @@ Normally, when you type ``punctuation'' characters such as @samp{;} or | |||
| 525 | be disconcerting until you get used to it. To disable @dfn{electric | 525 | be disconcerting until you get used to it. To disable @dfn{electric |
| 526 | indentation} in the current buffer, type @kbd{C-c C-l}. Type the same | 526 | indentation} in the current buffer, type @kbd{C-c C-l}. Type the same |
| 527 | thing to enable it again. To have electric indentation disabled by | 527 | thing to enable it again. To have electric indentation disabled by |
| 528 | default, put the following into your @file{.emacs} mode@footnote{There | 528 | default, put the following into your @file{.emacs} file@footnote{There |
| 529 | is no ``easy customization'' facility for making this change.}: | 529 | is no ``easy customization'' facility for making this change.}: |
| 530 | 530 | ||
| 531 | @example | 531 | @example |
| @@ -836,8 +836,9 @@ already. Then reindent the comment according to @code{comment-column} | |||
| 836 | (@pxref{Comments,,, xemacs, XEmacs User's Manual}) | 836 | (@pxref{Comments,,, xemacs, XEmacs User's Manual}) |
| 837 | @end ifset | 837 | @end ifset |
| 838 | and the variables below. Finally, position the point after the | 838 | and the variables below. Finally, position the point after the |
| 839 | comment starter. This is a standard Emacs command, but @ccmode{} | 839 | comment starter. @kbd{C-u M-;} kills any comment on the current line, |
| 840 | enhances it a bit with two variables: | 840 | together with any whitespace before it. This is a standard Emacs |
| 841 | command, but @ccmode{} enhances it a bit with two variables: | ||
| 841 | 842 | ||
| 842 | @defopt c-indent-comment-alist | 843 | @defopt c-indent-comment-alist |
| 843 | @vindex indent-comment-alist (c-) | 844 | @vindex indent-comment-alist (c-) |
| @@ -887,12 +888,14 @@ lines. | |||
| 887 | @findex end-of-defun (c-) | 888 | @findex end-of-defun (c-) |
| 888 | @findex beginning-of-defun | 889 | @findex beginning-of-defun |
| 889 | @findex end-of-defun | 890 | @findex end-of-defun |
| 890 | Move to the start or end of the current top-level definition, this | 891 | Move to the start or end of the current top-level definition. This is |
| 891 | being the outermost brace pair which encloses point. These functions | 892 | the outermost brace pair which encloses point, together with the |
| 892 | are analogous to the Emacs built-in commands @code{beginning-of-defun} | 893 | function header or similar preamble which precedes the opening brace. |
| 893 | and @code{end-of-defun}, except they eliminate the constraint that the | 894 | These functions are analogous to the Emacs built-in commands |
| 894 | top-level opening brace of the defun must be in column zero. See | 895 | @code{beginning-of-defun} and @code{end-of-defun}, except they |
| 895 | @ref{Defuns,,,@emacsman{}, @emacsmantitle{}}, for more information. | 896 | eliminate the constraint that the top-level opening brace of the defun |
| 897 | must be in column zero. See @ref{Defuns,,,@emacsman{}, | ||
| 898 | @emacsmantitle{}}, for more information. | ||
| 896 | 899 | ||
| 897 | Depending on the coding style you're using, you might prefer these two | 900 | Depending on the coding style you're using, you might prefer these two |
| 898 | commands to the standard Emacs ones. If so, consider binding them to | 901 | commands to the standard Emacs ones. If so, consider binding them to |
| @@ -1220,15 +1223,16 @@ turn it (or them) off. | |||
| 1220 | 1223 | ||
| 1221 | Most punctuation keys provide @dfn{electric} behavior - as well as | 1224 | Most punctuation keys provide @dfn{electric} behavior - as well as |
| 1222 | inserting themselves they perform some other action, such as | 1225 | inserting themselves they perform some other action, such as |
| 1223 | reindenting the line. A few keywords, such as @code{else}, also | 1226 | reindenting the line. This reindentation saves you from having to |
| 1224 | trigger electric action. | 1227 | reindent a line manually after typing, say, a @samp{@}}. A few |
| 1228 | keywords, such as @code{else}, also trigger electric action. | ||
| 1225 | 1229 | ||
| 1226 | You can inhibit the electric behaviour described here by disabling | 1230 | You can inhibit the electric behaviour described here by disabling |
| 1227 | electric minor mode (@pxref{Minor Modes}.) | 1231 | electric minor mode (@pxref{Minor Modes}). |
| 1228 | 1232 | ||
| 1229 | Common to all of them is that they only behave electrically when used | 1233 | Common to all these keys is that they only behave electrically when |
| 1230 | in normal code (as contrasted with getting typed in a string literal | 1234 | used in normal code (as contrasted with getting typed in a string |
| 1231 | or comment). Those which cause re-indentation do so only when | 1235 | literal or comment). Those which cause re-indentation do so only when |
| 1232 | @code{c-syntactic-indentation} has a non-@code{nil} value (which it | 1236 | @code{c-syntactic-indentation} has a non-@code{nil} value (which it |
| 1233 | does by default). | 1237 | does by default). |
| 1234 | 1238 | ||
| @@ -1453,8 +1457,6 @@ clean-ups listed by key. | |||
| 1453 | @cindex hungry-deletion | 1457 | @cindex hungry-deletion |
| 1454 | @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 1458 | @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 1455 | 1459 | ||
| 1456 | @kindex C-d | ||
| 1457 | |||
| 1458 | If you want to delete an entire block of whitespace at point, you can | 1460 | If you want to delete an entire block of whitespace at point, you can |
| 1459 | use @dfn{hungry deletion}. This deletes all the contiguous whitespace | 1461 | use @dfn{hungry deletion}. This deletes all the contiguous whitespace |
| 1460 | either before point or after point in a single operation. | 1462 | either before point or after point in a single operation. |
| @@ -1468,6 +1470,10 @@ Hungry deletion is a simple feature that some people find extremely | |||
| 1468 | useful. In fact, you might find yourself wanting it in @strong{all} | 1470 | useful. In fact, you might find yourself wanting it in @strong{all} |
| 1469 | your editing modes! | 1471 | your editing modes! |
| 1470 | 1472 | ||
| 1473 | Loosely speaking, in what follows, @dfn{@key{DEL}} means ``the | ||
| 1474 | backspace key'' and @dfn{@key{DELETE}} means ``the forward delete | ||
| 1475 | key''. This is discussed in more detail below. | ||
| 1476 | |||
| 1471 | There are two different ways you can use hungry deletion: | 1477 | There are two different ways you can use hungry deletion: |
| 1472 | 1478 | ||
| 1473 | @table @asis | 1479 | @table @asis |
| @@ -1476,7 +1482,7 @@ Here you toggle Hungry Delete minor mode with @kbd{M-x | |||
| 1476 | c-toggle-hungry-state}@footnote{Prior to @ccmode{} 5.31, this command | 1482 | c-toggle-hungry-state}@footnote{Prior to @ccmode{} 5.31, this command |
| 1477 | was bound to @kbd{C-c C-d}. @kbd{C-c C-d} is now the default binding | 1483 | was bound to @kbd{C-c C-d}. @kbd{C-c C-d} is now the default binding |
| 1478 | for @code{c-hungry-delete-forward}.} (@pxref{Minor Modes}.) This | 1484 | for @code{c-hungry-delete-forward}.} (@pxref{Minor Modes}.) This |
| 1479 | makes @kbd{@key{DEL}} and @kbd{C-d} do forward and backwards hungry | 1485 | makes @kbd{@key{DEL}} and @kbd{C-d} do backwards and forward hungry |
| 1480 | deletion. | 1486 | deletion. |
| 1481 | 1487 | ||
| 1482 | @table @asis | 1488 | @table @asis |
| @@ -1524,61 +1530,62 @@ default value is @code{delete-char}. | |||
| 1524 | 1530 | ||
| 1525 | @item Using Distinct Bindings | 1531 | @item Using Distinct Bindings |
| 1526 | The other (newer and recommended) way to use hungry deletion is to | 1532 | The other (newer and recommended) way to use hungry deletion is to |
| 1527 | perform @code{c-hungry-backspace} and @code{c-hungry-delete-forward} | 1533 | perform @code{c-hungry-delete-backwards} and |
| 1528 | directly through their key sequences rather than using the minor mode | 1534 | @code{c-hungry-delete-forward} directly through their key sequences |
| 1529 | toggling. | 1535 | rather than using the minor mode toggling. |
| 1530 | 1536 | ||
| 1531 | @table @asis | 1537 | @table @asis |
| 1532 | @item @kbd{C-c C-@key{Backspace}}, @kbd{C-c DEL}, or @kbd{C-c @key{Backspace}} (@code{c-hungry-backspace}) | 1538 | @item @kbd{C-c C-@key{DEL}}, or @kbd{C-c @key{DEL}} (@code{c-hungry-delete-backwards})@footnote{This command was formerly known as @code{c-hungry-backspace}.} |
| 1533 | @kindex C-c C-<backspace> | 1539 | @kindex C-c C-<backspace> |
| 1534 | @kindex C-c DEL | ||
| 1535 | @kindex C-c <backspace> | 1540 | @kindex C-c <backspace> |
| 1536 | @findex c-hungry-backspace | 1541 | @kindex C-c C-DEL |
| 1537 | @findex hungry-backspace (c-) | 1542 | @kindex C-c DEL |
| 1543 | @findex c-hungry-delete-backwards | ||
| 1544 | @findex hungry-delete-backwards (c-) | ||
| 1538 | Delete any amount of whitespace in the backwards direction (regardless | 1545 | Delete any amount of whitespace in the backwards direction (regardless |
| 1539 | whether hungry-delete mode is enabled or not). This command is bound | 1546 | whether hungry-delete mode is enabled or not). This command is bound |
| 1540 | to both @kbd{C-c C-@key{Backspace}} and @kbd{C-c @key{Backspace}}, | 1547 | to both @kbd{C-c C-@key{DEL}} and @kbd{C-c @key{DEL}}, since the more |
| 1541 | since the more natural one, @kbd{C-c C-@key{Backspace}}, is sometimes | 1548 | natural one, @kbd{C-c C-@key{DEL}}, is sometimes difficult to type at |
| 1542 | difficult to type at a character terminal. | 1549 | a character terminal. |
| 1543 | 1550 | ||
| 1544 | @item @kbd{C-c C-@key{Delete}}, @kbd{C-c C-d}, or @kbd{C-c @key{Delete}} (@code{c-hungry-delete-forward}) | 1551 | @item @kbd{C-c C-d}, @kbd{C-c C-@key{DELETE}}, or @kbd{C-c @key{DELETE}} (@code{c-hungry-delete-forward}) |
| 1545 | @kindex C-c C-<delete> | ||
| 1546 | @kindex C-c C-d | 1552 | @kindex C-c C-d |
| 1547 | @kindex C-c <delete> | 1553 | @kindex C-c C-<DELETE> |
| 1554 | @kindex C-c <DELETE> | ||
| 1548 | @findex c-hungry-delete-forward | 1555 | @findex c-hungry-delete-forward |
| 1549 | @findex hungry-delete-forward (c-) | 1556 | @findex hungry-delete-forward (c-) |
| 1550 | Delete any amount of whitespace in the forward direction (regardless | 1557 | Delete any amount of whitespace in the forward direction (regardless |
| 1551 | whether hungry-delete mode is enabled or not). This command is bound | 1558 | whether hungry-delete mode is enabled or not). This command is bound |
| 1552 | to both @kbd{C-c C-@key{Delete}} and @kbd{C-c @key{Delete}} for the | 1559 | to both @kbd{C-c C-@key{DELETE}} and @kbd{C-c @key{DELETE}} for the |
| 1553 | same reason as for @key{Backspace} above. | 1560 | same reason as for @key{DEL} above. |
| 1554 | @end table | 1561 | @end table |
| 1555 | @end table | 1562 | @end table |
| 1556 | 1563 | ||
| 1557 | @kindex <delete> | 1564 | @kindex <delete> |
| 1558 | @kindex <backspace> | 1565 | @kindex <backspace> |
| 1559 | 1566 | ||
| 1560 | When we talk about @kbd{DEL}, @kbd{C-d}, @key{Backspace} and | 1567 | When we talk about @kbd{@key{DEL}}, and @kbd{@key{DELETE}} above, we |
| 1561 | @key{Delete} above, we actually do so without connecting them to the | 1568 | actually do so without connecting them to the physical keys commonly |
| 1562 | physical keys commonly known as @key{Backspace} and @key{Delete}. The | 1569 | known as @key{Backspace} and @key{Delete}. The default bindings to |
| 1563 | default bindings to those two keys depends on the flavor of (X)Emacs | 1570 | those two keys depends on the flavor of (X)Emacs you are using. |
| 1564 | you are using. | ||
| 1565 | 1571 | ||
| 1566 | @findex c-electric-delete | 1572 | @findex c-electric-delete |
| 1567 | @findex electric-delete (c-) | 1573 | @findex electric-delete (c-) |
| 1568 | @findex c-hungry-delete | 1574 | @findex c-hungry-delete |
| 1569 | @findex hungry-delete (c-) | 1575 | @findex hungry-delete (c-) |
| 1570 | @vindex delete-key-deletes-forward | 1576 | @vindex delete-key-deletes-forward |
| 1571 | |||
| 1572 | In XEmacs 20.3 and beyond, the @key{Backspace} key is bound to | 1577 | In XEmacs 20.3 and beyond, the @key{Backspace} key is bound to |
| 1573 | @code{c-electric-backspace} and the @key{Delete} key is bound to | 1578 | @code{c-electric-backspace} and the @key{Delete} key is bound to |
| 1574 | @code{c-electric-delete}. You control the direction it deletes in by | 1579 | @code{c-electric-delete}. You control the direction it deletes in by |
| 1575 | setting the variable @code{delete-key-deletes-forward}, a standard | 1580 | setting the variable @code{delete-key-deletes-forward}, a standard |
| 1576 | XEmacs variable. When this variable is non-@code{nil}, | 1581 | XEmacs variable. |
| 1577 | @code{c-electric-delete} will do forward deletion with | 1582 | @c This variable is encapsulated by XEmacs's (defsubst delete-forward-p ...). |
| 1578 | @code{c-electric-delete-forward}, otherwise it does backward deletion | 1583 | When this variable is non-@code{nil}, @code{c-electric-delete} will do |
| 1579 | with @code{c-electric-backspace}. Similarly, @kbd{C-c @key{Delete}} | 1584 | forward deletion with @code{c-electric-delete-forward}, otherwise it |
| 1580 | and @kbd{C-c C-@key{Delete}} are bound to @code{c-hungry-delete} which | 1585 | does backward deletion with @code{c-electric-backspace}. Similarly, |
| 1581 | is controlled in the same way by @code{delete-key-deletes-forward}. | 1586 | @kbd{C-c @key{Delete}} and @kbd{C-c C-@key{Delete}} are bound to |
| 1587 | @code{c-hungry-delete} which is controlled in the same way by | ||
| 1588 | @code{delete-key-deletes-forward}. | ||
| 1582 | 1589 | ||
| 1583 | @findex normal-erase-is-backspace-mode | 1590 | @findex normal-erase-is-backspace-mode |
| 1584 | 1591 | ||