diff options
| author | Xue Fuqiao | 2014-02-27 20:00:30 +0800 |
|---|---|---|
| committer | Xue Fuqiao | 2014-02-27 20:00:30 +0800 |
| commit | 6be7660863fa4a1f4621757dcc57864a23742d36 (patch) | |
| tree | 14fbfb9b3c2e69ab8e90aadde220e617fc0f2ef8 /doc | |
| parent | c22c16140eaa4cf391060360d36ab498fa57fdcb (diff) | |
| parent | 8603bdb3b7ab4c4faa10ddadcdc2708228717220 (diff) | |
| download | emacs-6be7660863fa4a1f4621757dcc57864a23742d36.tar.gz emacs-6be7660863fa4a1f4621757dcc57864a23742d36.zip | |
Some doc about electric-indent-mode.
* doc/lispref/text.texi (Margins): Fix the description of RET and `C-j'.
* doc/emacs/programs.texi (Basic Indent):
(Other C Commands): Fix the description of RET and `C-j'.
* doc/emacs/indent.texi (Indentation Commands): Move the description of
`C-j' from here...
* doc/emacs/basic.texi (Inserting Text): ... to here.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/emacs/ChangeLog | 9 | ||||
| -rw-r--r-- | doc/emacs/basic.texi | 14 | ||||
| -rw-r--r-- | doc/emacs/indent.texi | 5 | ||||
| -rw-r--r-- | doc/emacs/programs.texi | 24 | ||||
| -rw-r--r-- | doc/lispref/ChangeLog | 2 | ||||
| -rw-r--r-- | doc/lispref/text.texi | 2 | ||||
| -rw-r--r-- | doc/misc/cc-mode.texi | 2 | ||||
| -rw-r--r-- | doc/misc/octave-mode.texi | 1 | ||||
| -rw-r--r-- | doc/misc/vip.texi | 1 |
9 files changed, 37 insertions, 23 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 55c92de2462..2433e3c8b8f 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2014-02-27 Xue Fuqiao <xfq@gnu.org> | ||
| 2 | |||
| 3 | * programs.texi (Basic Indent): | ||
| 4 | (Other C Commands): Fix the description of RET and `C-j'. | ||
| 5 | |||
| 6 | * indent.texi (Indentation Commands): Move the description of | ||
| 7 | `C-j' from here... | ||
| 8 | * basic.texi (Inserting Text): ... to here. | ||
| 9 | |||
| 1 | 2014-02-25 Glenn Morris <rgm@gnu.org> | 10 | 2014-02-25 Glenn Morris <rgm@gnu.org> |
| 2 | 11 | ||
| 3 | * custom.texi (Terminal Init): | 12 | * custom.texi (Terminal Init): |
diff --git a/doc/emacs/basic.texi b/doc/emacs/basic.texi index 27a8ba9438e..f2ec11c2c1e 100644 --- a/doc/emacs/basic.texi +++ b/doc/emacs/basic.texi | |||
| @@ -40,14 +40,20 @@ forward, so that point remains just after the inserted text. | |||
| 40 | @xref{Point}. | 40 | @xref{Point}. |
| 41 | 41 | ||
| 42 | @kindex RET | 42 | @kindex RET |
| 43 | @kindex C-j | ||
| 43 | @cindex newline | 44 | @cindex newline |
| 45 | @findex electric-indent-just-newline | ||
| 44 | To end a line and start a new one, type @key{RET} (@code{newline}). | 46 | To end a line and start a new one, type @key{RET} (@code{newline}). |
| 45 | (The @key{RET} key may be labeled @key{Return} or @key{Enter} on your | 47 | (The @key{RET} key may be labeled @key{Return} or @key{Enter} on your |
| 46 | keyboard, but we refer to it as @key{RET} in this manual.) This | 48 | keyboard, but we refer to it as @key{RET} in this manual.) This |
| 47 | command inserts a newline character into the buffer. If point is at | 49 | command inserts a newline character into the buffer, then indent |
| 48 | the end of the line, the effect is to create a new blank line after | 50 | (@pxref{Indentation}) accroding to major mode. If point is at the end |
| 49 | it; if point is in the middle of a line, the line is split at that | 51 | of the line, the effect is to create a new blank line after it and |
| 50 | position. | 52 | indent the new line; if point is in the middle of a line, the line is |
| 53 | split at that position. To turn off the auto-indentation, you can | ||
| 54 | either desable Electric Indent mode (@pxref{Indent Convenience}) or | ||
| 55 | type @kbd{C-j}, which inserts just a newline, without any | ||
| 56 | auto-indentation. | ||
| 51 | 57 | ||
| 52 | As we explain later in this manual, you can change the way Emacs | 58 | As we explain later in this manual, you can change the way Emacs |
| 53 | handles text insertion by turning on @dfn{minor modes}. For instance, | 59 | handles text insertion by turning on @dfn{minor modes}. For instance, |
diff --git a/doc/emacs/indent.texi b/doc/emacs/indent.texi index 9aec6202de6..78e2e925e41 100644 --- a/doc/emacs/indent.texi +++ b/doc/emacs/indent.texi | |||
| @@ -64,11 +64,6 @@ Emacs provides a variety of commands to perform indentation in other | |||
| 64 | ways. | 64 | ways. |
| 65 | 65 | ||
| 66 | @table @kbd | 66 | @table @kbd |
| 67 | @item C-j | ||
| 68 | @kindex C-j | ||
| 69 | @findex newline-and-indent | ||
| 70 | Perform @key{RET} followed by @key{TAB} (@code{newline-and-indent}). | ||
| 71 | |||
| 72 | @item C-M-o | 67 | @item C-M-o |
| 73 | @kindex C-M-o | 68 | @kindex C-M-o |
| 74 | @findex split-line | 69 | @findex split-line |
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index 26e9539d750..4a6da9e4fd6 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi | |||
| @@ -366,9 +366,9 @@ which reformats Lisp objects with nice-looking indentation. | |||
| 366 | @table @kbd | 366 | @table @kbd |
| 367 | @item @key{TAB} | 367 | @item @key{TAB} |
| 368 | Adjust indentation of current line (@code{indent-for-tab-command}). | 368 | Adjust indentation of current line (@code{indent-for-tab-command}). |
| 369 | @item C-j | 369 | @item @key{RET} |
| 370 | Insert a newline, then adjust indentation of following line | 370 | Insert a newline, then adjust indentation of following line |
| 371 | (@code{newline-and-indent}). | 371 | (@code{newline}). |
| 372 | @end table | 372 | @end table |
| 373 | 373 | ||
| 374 | @kindex TAB @r{(programming modes)} | 374 | @kindex TAB @r{(programming modes)} |
| @@ -382,12 +382,9 @@ the current line, based on the indentation and syntactic content of | |||
| 382 | the preceding lines; if the region is active, @key{TAB} indents each | 382 | the preceding lines; if the region is active, @key{TAB} indents each |
| 383 | line within the region, not just the current line. | 383 | line within the region, not just the current line. |
| 384 | 384 | ||
| 385 | @kindex C-j @r{(indenting source code)} | 385 | The command @key{RET} (@code{newline}), which was documented in |
| 386 | @findex newline-and-indent | 386 | @ref{Inserting Text}, does the same as @key{C-j} followed by |
| 387 | The command @kbd{C-j} (@code{newline-and-indent}), which was | 387 | @key{TAB}: it inserts a new line, then adjusts the line's indentation. |
| 388 | documented in @ref{Indentation Commands}, does the same as @key{RET} | ||
| 389 | followed by @key{TAB}: it inserts a new line, then adjusts the line's | ||
| 390 | indentation. | ||
| 391 | 388 | ||
| 392 | When indenting a line that starts within a parenthetical grouping, | 389 | When indenting a line that starts within a parenthetical grouping, |
| 393 | Emacs usually places the start of the line under the preceding line | 390 | Emacs usually places the start of the line under the preceding line |
| @@ -1681,18 +1678,18 @@ hungry-delete feature is enabled. | |||
| 1681 | @findex c-context-line-break | 1678 | @findex c-context-line-break |
| 1682 | This command inserts a line break and indents the new line in a manner | 1679 | This command inserts a line break and indents the new line in a manner |
| 1683 | appropriate to the context. In normal code, it does the work of | 1680 | appropriate to the context. In normal code, it does the work of |
| 1684 | @kbd{C-j} (@code{newline-and-indent}), in a C preprocessor line it | 1681 | @key{RET} (@code{newline}), in a C preprocessor line it additionally |
| 1685 | additionally inserts a @samp{\} at the line break, and within comments | 1682 | inserts a @samp{\} at the line break, and within comments it's like |
| 1686 | it's like @kbd{M-j} (@code{c-indent-new-comment-line}). | 1683 | @kbd{M-j} (@code{c-indent-new-comment-line}). |
| 1687 | 1684 | ||
| 1688 | @code{c-context-line-break} isn't bound to a key by default, but it | 1685 | @code{c-context-line-break} isn't bound to a key by default, but it |
| 1689 | needs a binding to be useful. The following code will bind it to | 1686 | needs a binding to be useful. The following code will bind it to |
| 1690 | @kbd{C-j}. We use @code{c-initialization-hook} here to make sure | 1687 | @kbd{RET}. We use @code{c-initialization-hook} here to make sure |
| 1691 | the keymap is loaded before we try to change it. | 1688 | the keymap is loaded before we try to change it. |
| 1692 | 1689 | ||
| 1693 | @example | 1690 | @example |
| 1694 | (defun my-bind-clb () | 1691 | (defun my-bind-clb () |
| 1695 | (define-key c-mode-base-map "\C-j" | 1692 | (define-key c-mode-base-map "\C-m" |
| 1696 | 'c-context-line-break)) | 1693 | 'c-context-line-break)) |
| 1697 | (add-hook 'c-initialization-hook 'my-bind-clb) | 1694 | (add-hook 'c-initialization-hook 'my-bind-clb) |
| 1698 | @end example | 1695 | @end example |
| @@ -1812,6 +1809,7 @@ defines these commands: | |||
| 1812 | @table @kbd | 1809 | @table @kbd |
| 1813 | @item @key{TAB} | 1810 | @item @key{TAB} |
| 1814 | @code{tab-to-tab-stop}. | 1811 | @code{tab-to-tab-stop}. |
| 1812 | @c FIXME: Maybe this should be consistent with other programming modes. | ||
| 1815 | @item C-j | 1813 | @item C-j |
| 1816 | Insert a newline and then indent using @code{tab-to-tab-stop}. | 1814 | Insert a newline and then indent using @code{tab-to-tab-stop}. |
| 1817 | @item : | 1815 | @item : |
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 8d473033bd2..0e64feab6f9 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | 2014-02-27 Xue Fuqiao <xfq@gnu.org> | 1 | 2014-02-27 Xue Fuqiao <xfq@gnu.org> |
| 2 | 2 | ||
| 3 | * text.texi (Margins): Fix the description of RET and `C-j'. | ||
| 4 | |||
| 3 | * frames.texi (Multiple Terminals): Document | 5 | * frames.texi (Multiple Terminals): Document |
| 4 | `display-monitor-attributes-list' and `display-monitor-attributes'. | 6 | `display-monitor-attributes-list' and `display-monitor-attributes'. |
| 5 | (Display Feature Testing): Add some notes about multi-monitor. | 7 | (Display Feature Testing): Add some notes about multi-monitor. |
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 18701465d0f..9df6cf61e06 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi | |||
| @@ -1717,7 +1717,7 @@ is value of @code{indent-line-function} in Paragraph-Indent Text mode. | |||
| 1717 | 1717 | ||
| 1718 | @defopt left-margin | 1718 | @defopt left-margin |
| 1719 | This variable specifies the base left margin column. In Fundamental | 1719 | This variable specifies the base left margin column. In Fundamental |
| 1720 | mode, @kbd{C-j} indents to this column. This variable automatically | 1720 | mode, @kbd{RET} indents to this column. This variable automatically |
| 1721 | becomes buffer-local when set in any fashion. | 1721 | becomes buffer-local when set in any fashion. |
| 1722 | @end defopt | 1722 | @end defopt |
| 1723 | 1723 | ||
diff --git a/doc/misc/cc-mode.texi b/doc/misc/cc-mode.texi index 2d916b8416c..c7f51b4dcbe 100644 --- a/doc/misc/cc-mode.texi +++ b/doc/misc/cc-mode.texi | |||
| @@ -751,6 +751,7 @@ very useful in this case. | |||
| 751 | @end itemize | 751 | @end itemize |
| 752 | 752 | ||
| 753 | @table @asis | 753 | @table @asis |
| 754 | @c FIXME: This should be `electric-indent-just-newline' since GNU Emacs 24.4. | ||
| 754 | @item @kbd{C-j} (@code{newline-and-indent}) | 755 | @item @kbd{C-j} (@code{newline-and-indent}) |
| 755 | @kindex C-j | 756 | @kindex C-j |
| 756 | @findex newline-and-indent | 757 | @findex newline-and-indent |
| @@ -7054,6 +7055,7 @@ Set the variable @code{c-basic-offset}. @xref{Getting Started}. | |||
| 7054 | @kindex RET | 7055 | @kindex RET |
| 7055 | @kindex C-j | 7056 | @kindex C-j |
| 7056 | @emph{Why doesn't the @kbd{RET} key indent the new line?} | 7057 | @emph{Why doesn't the @kbd{RET} key indent the new line?} |
| 7058 | @c FIXME: `electric-indent-mode' is enabled by default in GNU Emacs 24.4. | ||
| 7057 | 7059 | ||
| 7058 | Emacs's convention is that @kbd{RET} just adds a newline, and that | 7060 | Emacs's convention is that @kbd{RET} just adds a newline, and that |
| 7059 | @kbd{C-j} adds a newline and indents it. You can make @kbd{RET} do this | 7061 | @kbd{C-j} adds a newline and indents it. You can make @kbd{RET} do this |
diff --git a/doc/misc/octave-mode.texi b/doc/misc/octave-mode.texi index 305a54800c1..6dde042a315 100644 --- a/doc/misc/octave-mode.texi +++ b/doc/misc/octave-mode.texi | |||
| @@ -148,6 +148,7 @@ and return values which have to be entered without parentheses | |||
| 148 | in one of your Emacs startup files. | 148 | in one of your Emacs startup files. |
| 149 | @end table | 149 | @end table |
| 150 | 150 | ||
| 151 | @c FIXME: `electric-indent-mode' is enabled by default in GNU Emacs 24.4. | ||
| 151 | A common problem is that the @key{RET} key does @emph{not} indent the | 152 | A common problem is that the @key{RET} key does @emph{not} indent the |
| 152 | line to where the new text should go after inserting the newline. This | 153 | line to where the new text should go after inserting the newline. This |
| 153 | is because the standard Emacs convention is that @key{RET} (aka | 154 | is because the standard Emacs convention is that @key{RET} (aka |
diff --git a/doc/misc/vip.texi b/doc/misc/vip.texi index 90dc3cd8dec..95f829d14ed 100644 --- a/doc/misc/vip.texi +++ b/doc/misc/vip.texi | |||
| @@ -1568,6 +1568,7 @@ Set mark and push previous mark on mark ring (@code{set-mark-command}). | |||
| 1568 | @kindex 011 TAB (@code{indent-for-tab-command}) | 1568 | @kindex 011 TAB (@code{indent-for-tab-command}) |
| 1569 | Indent line for current major mode (@code{indent-for-tab-command}). | 1569 | Indent line for current major mode (@code{indent-for-tab-command}). |
| 1570 | @item C-j | 1570 | @item C-j |
| 1571 | @c FIXME: This should be `electric-indent-just-newline' since GNU Emacs 24.4. | ||
| 1571 | @kindex 012 @kbd{C-j} (@code{newline-and-indent}) | 1572 | @kindex 012 @kbd{C-j} (@code{newline-and-indent}) |
| 1572 | Insert a newline, then indent according to mode (@code{newline-and-indent}). | 1573 | Insert a newline, then indent according to mode (@code{newline-and-indent}). |
| 1573 | @item C-k | 1574 | @item C-k |