[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r116578: Some doc about electric-indent-mode.
From: |
Xue Fuqiao |
Subject: |
[Emacs-diffs] trunk r116578: Some doc about electric-indent-mode. |
Date: |
Thu, 27 Feb 2014 12:00:45 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 116578 [merge]
revision-id: address@hidden
parent: address@hidden
parent: address@hidden
committer: Xue Fuqiao <address@hidden>
branch nick: trunk
timestamp: Thu 2014-02-27 20:00:30 +0800
message:
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.
modified:
doc/emacs/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-6227
doc/emacs/basic.texi basic.texi-20091113204419-o5vbwnq5f7feedwu-6233
doc/emacs/indent.texi
indent.texi-20091113204419-o5vbwnq5f7feedwu-6257
doc/emacs/programs.texi
programs.texi-20091113204419-o5vbwnq5f7feedwu-6272
doc/lispref/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-6155
doc/lispref/text.texi text.texi-20091113204419-o5vbwnq5f7feedwu-6215
doc/misc/cc-mode.texi
ccmode.texi-20091113204419-o5vbwnq5f7feedwu-6291
doc/misc/octave-mode.texi
docmiscoctavemode.te-20131211135130-mke18k9sh7x9vmyx-1
doc/misc/vip.texi vip.texi-20091113204419-o5vbwnq5f7feedwu-6327
=== modified file 'doc/emacs/ChangeLog'
--- a/doc/emacs/ChangeLog 2014-02-25 08:41:47 +0000
+++ b/doc/emacs/ChangeLog 2014-02-27 11:59:35 +0000
@@ -1,3 +1,12 @@
+2014-02-27 Xue Fuqiao <address@hidden>
+
+ * programs.texi (Basic Indent):
+ (Other C Commands): Fix the description of RET and `C-j'.
+
+ * indent.texi (Indentation Commands): Move the description of
+ `C-j' from here...
+ * basic.texi (Inserting Text): ... to here.
+
2014-02-25 Glenn Morris <address@hidden>
* custom.texi (Terminal Init):
=== modified file 'doc/emacs/basic.texi'
--- a/doc/emacs/basic.texi 2014-01-31 09:41:54 +0000
+++ b/doc/emacs/basic.texi 2014-02-27 11:59:35 +0000
@@ -40,14 +40,20 @@
@xref{Point}.
@kindex RET
address@hidden C-j
@cindex newline
address@hidden electric-indent-just-newline
To end a line and start a new one, type @key{RET} (@code{newline}).
(The @key{RET} key may be labeled @key{Return} or @key{Enter} on your
keyboard, but we refer to it as @key{RET} in this manual.) This
-command inserts a newline character into the buffer. If point is at
-the end of the line, the effect is to create a new blank line after
-it; if point is in the middle of a line, the line is split at that
-position.
+command inserts a newline character into the buffer, then indent
+(@pxref{Indentation}) accroding to major mode. If point is at the end
+of the line, the effect is to create a new blank line after it and
+indent the new line; if point is in the middle of a line, the line is
+split at that position. To turn off the auto-indentation, you can
+either desable Electric Indent mode (@pxref{Indent Convenience}) or
+type @kbd{C-j}, which inserts just a newline, without any
+auto-indentation.
As we explain later in this manual, you can change the way Emacs
handles text insertion by turning on @dfn{minor modes}. For instance,
=== modified file 'doc/emacs/indent.texi'
--- a/doc/emacs/indent.texi 2014-01-28 02:17:51 +0000
+++ b/doc/emacs/indent.texi 2014-02-27 11:59:35 +0000
@@ -64,11 +64,6 @@
ways.
@table @kbd
address@hidden C-j
address@hidden C-j
address@hidden newline-and-indent
-Perform @key{RET} followed by @key{TAB} (@code{newline-and-indent}).
-
@item C-M-o
@kindex C-M-o
@findex split-line
=== modified file 'doc/emacs/programs.texi'
--- a/doc/emacs/programs.texi 2014-02-17 18:04:17 +0000
+++ b/doc/emacs/programs.texi 2014-02-27 11:59:35 +0000
@@ -366,9 +366,9 @@
@table @kbd
@item @key{TAB}
Adjust indentation of current line (@code{indent-for-tab-command}).
address@hidden C-j
address@hidden @key{RET}
Insert a newline, then adjust indentation of following line
-(@code{newline-and-indent}).
+(@code{newline}).
@end table
@kindex TAB @r{(programming modes)}
@@ -382,12 +382,9 @@
the preceding lines; if the region is active, @key{TAB} indents each
line within the region, not just the current line.
address@hidden C-j @r{(indenting source code)}
address@hidden newline-and-indent
- The command @kbd{C-j} (@code{newline-and-indent}), which was
-documented in @ref{Indentation Commands}, does the same as @key{RET}
-followed by @key{TAB}: it inserts a new line, then adjusts the line's
-indentation.
+ The command @key{RET} (@code{newline}), which was documented in
address@hidden Text}, does the same as @key{C-j} followed by
address@hidden: it inserts a new line, then adjusts the line's indentation.
When indenting a line that starts within a parenthetical grouping,
Emacs usually places the start of the line under the preceding line
@@ -1681,18 +1678,18 @@
@findex c-context-line-break
This command inserts a line break and indents the new line in a manner
appropriate to the context. In normal code, it does the work of
address@hidden (@code{newline-and-indent}), in a C preprocessor line it
-additionally inserts a @samp{\} at the line break, and within comments
-it's like @kbd{M-j} (@code{c-indent-new-comment-line}).
address@hidden (@code{newline}), in a C preprocessor line it additionally
+inserts a @samp{\} at the line break, and within comments it's like
address@hidden (@code{c-indent-new-comment-line}).
@code{c-context-line-break} isn't bound to a key by default, but it
needs a binding to be useful. The following code will bind it to
address@hidden We use @code{c-initialization-hook} here to make sure
address@hidden We use @code{c-initialization-hook} here to make sure
the keymap is loaded before we try to change it.
@example
(defun my-bind-clb ()
- (define-key c-mode-base-map "\C-j"
+ (define-key c-mode-base-map "\C-m"
'c-context-line-break))
(add-hook 'c-initialization-hook 'my-bind-clb)
@end example
@@ -1812,6 +1809,7 @@
@table @kbd
@item @key{TAB}
@code{tab-to-tab-stop}.
address@hidden FIXME: Maybe this should be consistent with other programming
modes.
@item C-j
Insert a newline and then indent using @code{tab-to-tab-stop}.
@item :
=== modified file 'doc/lispref/ChangeLog'
--- a/doc/lispref/ChangeLog 2014-02-27 10:15:52 +0000
+++ b/doc/lispref/ChangeLog 2014-02-27 11:59:35 +0000
@@ -1,5 +1,7 @@
2014-02-27 Xue Fuqiao <address@hidden>
+ * text.texi (Margins): Fix the description of RET and `C-j'.
+
* frames.texi (Multiple Terminals): Document
`display-monitor-attributes-list' and `display-monitor-attributes'.
(Display Feature Testing): Add some notes about multi-monitor.
=== modified file 'doc/lispref/text.texi'
--- a/doc/lispref/text.texi 2014-02-10 02:37:43 +0000
+++ b/doc/lispref/text.texi 2014-02-27 11:59:35 +0000
@@ -1717,7 +1717,7 @@
@defopt left-margin
This variable specifies the base left margin column. In Fundamental
-mode, @kbd{C-j} indents to this column. This variable automatically
+mode, @kbd{RET} indents to this column. This variable automatically
becomes buffer-local when set in any fashion.
@end defopt
=== modified file 'doc/misc/cc-mode.texi'
--- a/doc/misc/cc-mode.texi 2014-01-25 04:53:33 +0000
+++ b/doc/misc/cc-mode.texi 2014-02-27 11:59:35 +0000
@@ -751,6 +751,7 @@
@end itemize
@table @asis
address@hidden FIXME: This should be `electric-indent-just-newline' since GNU
Emacs 24.4.
@item @kbd{C-j} (@code{newline-and-indent})
@kindex C-j
@findex newline-and-indent
@@ -7054,6 +7055,7 @@
@kindex RET
@kindex C-j
@emph{Why doesn't the @kbd{RET} key indent the new line?}
address@hidden FIXME: `electric-indent-mode' is enabled by default in GNU Emacs
24.4.
Emacs's convention is that @kbd{RET} just adds a newline, and that
@kbd{C-j} adds a newline and indents it. You can make @kbd{RET} do this
=== modified file 'doc/misc/octave-mode.texi'
--- a/doc/misc/octave-mode.texi 2014-01-06 05:25:46 +0000
+++ b/doc/misc/octave-mode.texi 2014-02-27 11:59:35 +0000
@@ -148,6 +148,7 @@
in one of your Emacs startup files.
@end table
address@hidden FIXME: `electric-indent-mode' is enabled by default in GNU Emacs
24.4.
A common problem is that the @key{RET} key does @emph{not} indent the
line to where the new text should go after inserting the newline. This
is because the standard Emacs convention is that @key{RET} (aka
=== modified file 'doc/misc/vip.texi'
--- a/doc/misc/vip.texi 2014-02-25 08:41:47 +0000
+++ b/doc/misc/vip.texi 2014-02-27 11:59:35 +0000
@@ -1568,6 +1568,7 @@
@kindex 011 TAB (@code{indent-for-tab-command})
Indent line for current major mode (@code{indent-for-tab-command}).
@item C-j
address@hidden FIXME: This should be `electric-indent-just-newline' since GNU
Emacs 24.4.
@kindex 012 @kbd{C-j} (@code{newline-and-indent})
Insert a newline, then indent according to mode (@code{newline-and-indent}).
@item C-k
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r116578: Some doc about electric-indent-mode.,
Xue Fuqiao <=