aboutsummaryrefslogtreecommitdiffstats
path: root/doc/misc/nxml-mode.texi
diff options
context:
space:
mode:
authorChong Yidong2012-04-04 15:54:02 +0800
committerChong Yidong2012-04-04 15:54:02 +0800
commit3d439cd10fff3e71c7115263a03a5a92898ca7ea (patch)
treee79c2b0c1e66474429fec04614701d38c5bf52e7 /doc/misc/nxml-mode.texi
parent97f4a299ee49ed580beb079752bd4d0c9dee0ce7 (diff)
downloademacs-3d439cd10fff3e71c7115263a03a5a92898ca7ea.tar.gz
emacs-3d439cd10fff3e71c7115263a03a5a92898ca7ea.zip
Several miscellaneous doc changes.
* doc/lispref/display.texi (Delayed Warnings): New node. * doc/misc/gnus-faq.texi (FAQ 8-2): Mention EasyPG. * doc/misc/gnus.texi: Reduce references to obsolete pgg library. (Security): Note that epg is now the default. * doc/misc/message.texi (Using PGP/MIME): Note that epg is now the default. * doc/misc/nxml-mode.texi (Completion): C-RET is no longer bound to nxml-complete. * lisp/subr.el (delayed-warnings-hook): Doc fix. * src/keyboard.c (Vdelayed_warnings_list): Doc fix.
Diffstat (limited to 'doc/misc/nxml-mode.texi')
-rw-r--r--doc/misc/nxml-mode.texi71
1 files changed, 32 insertions, 39 deletions
diff --git a/doc/misc/nxml-mode.texi b/doc/misc/nxml-mode.texi
index 73af1ace245..c8d159e2363 100644
--- a/doc/misc/nxml-mode.texi
+++ b/doc/misc/nxml-mode.texi
@@ -5,7 +5,7 @@
5@c %**end of header 5@c %**end of header
6 6
7@copying 7@copying
8This manual documents nxml-mode, an Emacs major mode for editing 8This manual documents nXML mode, an Emacs major mode for editing
9XML with RELAX NG support. 9XML with RELAX NG support.
10 10
11Copyright @copyright{} 2007-2012 Free Software Foundation, Inc. 11Copyright @copyright{} 2007-2012 Free Software Foundation, Inc.
@@ -108,31 +108,25 @@ lists. Report any bugs with @kbd{M-x report-emacs-bug}.
108@node Completion 108@node Completion
109@chapter Completion 109@chapter Completion
110 110
111Apart from real-time validation, the most important feature that 111Apart from real-time validation, the most important feature that nXML
112nxml-mode provides for assisting in document creation is "completion". 112mode provides for assisting in document creation is "completion".
113Completion assists the user in inserting characters at point, based on 113Completion assists the user in inserting characters at point, based on
114knowledge of the schema and on the contents of the buffer before 114knowledge of the schema and on the contents of the buffer before
115point. 115point.
116 116
117The traditional GNU Emacs key combination for completion in a 117nXML mode adapts the standard GNU Emacs command for completion in a
118buffer is @kbd{M-@key{TAB}}. However, many window systems 118buffer: @code{completion-at-point}, which is bound to @kbd{C-M-i} and
119and window managers use this key combination themselves (typically for 119@kbd{M-@key{TAB}}. Note that many window systems and window managers
120switching between windows) and do not pass it to applications. It's 120use @kbd{M-@key{TAB}} themselves (typically for switching between
121hard to find key combinations in GNU Emacs that are both easy to type 121windows) and do not pass it to applications. In that case, you should
122and not taken by something else. @kbd{C-@key{RET}} (i.e. 122type @kbd{C-M-i} or @kbd{@key{ESC} @key{TAB}} for completion, or bind
123pressing the Enter or Return key, while the Ctrl key is held down) is 123@code{completion-at-point} to a key that is convenient for you. In
124available. It won't be available on a traditional terminal (because 124the following, I will assume that you type @kbd{C-M-i}.
125it is indistinguishable from Return), but it will work with a window 125
126system. Therefore we adopt the following solution by default: use 126nXML mode completion works by examining the symbol preceding point.
127@kbd{C-@key{RET}} when there's a window system and 127This is the symbol to be completed. The symbol to be completed may be
128@kbd{M-@key{TAB}} when there's not. In the following, I 128the empty. Completion considers what symbols starting with the symbol
129will assume that a window system is being used and will therefore 129to be completed would be valid replacements for the symbol to be
130refer to @kbd{C-@key{RET}}.
131
132Completion works by examining the symbol preceding point. This
133is the symbol to be completed. The symbol to be completed may be the
134empty. Completion considers what symbols starting with the symbol to
135be completed would be valid replacements for the symbol to be
136completed, given the schema and the contents of the buffer before 130completed, given the schema and the contents of the buffer before
137point. These symbols are the possible completions. An example may 131point. These symbols are the possible completions. An example may
138make this clearer. Suppose the buffer looks like this (where @point{} 132make this clearer. Suppose the buffer looks like this (where @point{}
@@ -168,7 +162,7 @@ completions are @samp{base}, @samp{isindex},
168In this case, the symbol to be completed is empty, and the possible 162In this case, the symbol to be completed is empty, and the possible
169completions are just @samp{http://www.w3.org/1999/xhtml}. 163completions are just @samp{http://www.w3.org/1999/xhtml}.
170 164
171When you type @kbd{C-@key{RET}}, what happens depends 165When you type @kbd{C-M-i}, what happens depends
172on what the set of possible completions are. 166on what the set of possible completions are.
173 167
174@itemize @bullet 168@itemize @bullet
@@ -186,7 +180,7 @@ required. For example, in this case:
186@end example 180@end example
187 181
188@noindent 182@noindent
189@kbd{C-@key{RET}} will yield 183@kbd{C-M-i} will yield
190 184
191@example 185@example
192<html xmlns="http://www.w3.org/1999/xhtml"> 186<html xmlns="http://www.w3.org/1999/xhtml">
@@ -202,18 +196,17 @@ is inserted. For example, suppose the buffer is:
202@end example 196@end example
203 197
204@noindent 198@noindent
205The symbol to be completed is @samp{x}. The possible completions 199The symbol to be completed is @samp{x}. The possible completions are
206are @samp{xmlns} and @samp{xml:lang}. These share a 200@samp{xmlns} and @samp{xml:lang}. These share a common prefix of
207common prefix of @samp{xml}. Thus, @kbd{C-@key{RET}} 201@samp{xml}. Thus, @kbd{C-M-i} will yield:
208will yield:
209 202
210@example 203@example
211<html xml@point{} 204<html xml@point{}
212@end example 205@end example
213 206
214@noindent 207@noindent
215Typically, you would do @kbd{C-@key{RET}} again, which would 208Typically, you would do @kbd{C-M-i} again, which would have the result
216have the result described in the next item. 209described in the next item.
217@item 210@item
218If there is more than one possible completion, but the 211If there is more than one possible completion, but the
219possible completions do not share a non-empty prefix, then Emacs will 212possible completions do not share a non-empty prefix, then Emacs will
@@ -251,19 +244,19 @@ If you input @kbd{xmlns}, the result will be:
251@end example 244@end example
252 245
253@noindent 246@noindent
254(If you do @kbd{C-@key{RET}} again, the namespace URI will 247(If you do @kbd{C-M-i} again, the namespace URI will be
255be inserted. Should that happen automatically?) 248inserted. Should that happen automatically?)
256@end itemize 249@end itemize
257 250
258@node Inserting end-tags 251@node Inserting end-tags
259@chapter Inserting end-tags 252@chapter Inserting end-tags
260 253
261The main redundancy in XML syntax is end-tags. nxml-mode provides 254The main redundancy in XML syntax is end-tags. nXML mode provides
262several ways to make it easier to enter end-tags. You can use all of 255several ways to make it easier to enter end-tags. You can use all of
263these without a schema. 256these without a schema.
264 257
265You can use @kbd{C-@key{RET}} after @samp{</} 258You can use @kbd{C-M-i} after @samp{</} to complete the rest of the
266to complete the rest of the end-tag. 259end-tag.
267 260
268@kbd{C-c C-f} inserts an end-tag for the element containing 261@kbd{C-c C-f} inserts an end-tag for the element containing
269point. This command is useful when you want to input the start-tag, 262point. This command is useful when you want to input the start-tag,
@@ -279,9 +272,9 @@ start-tag, point and the end-tag on successive lines, appropriately
279indented. The @samp{i} is mnemonic for inline and the 272indented. The @samp{i} is mnemonic for inline and the
280@samp{b} is mnemonic for block. 273@samp{b} is mnemonic for block.
281 274
282Finally, you can customize nxml-mode so that @kbd{/} 275Finally, you can customize nXML mode so that @kbd{/} automatically
283automatically inserts the rest of the end-tag when it occurs after 276inserts the rest of the end-tag when it occurs after @samp{<}, by
284@samp{<}, by doing 277doing
285 278
286@display 279@display
287@kbd{M-x customize-variable @key{RET} nxml-slash-auto-complete-flag @key{RET}} 280@kbd{M-x customize-variable @key{RET} nxml-slash-auto-complete-flag @key{RET}}
@@ -868,7 +861,7 @@ an @samp{applyFollowingRules} to the private file.
868@node DTDs 861@node DTDs
869@chapter DTDs 862@chapter DTDs
870 863
871nxml-mode is designed to support the creation of standalone XML 864nXML mode is designed to support the creation of standalone XML
872documents that do not depend on a DTD. Although it is common practice 865documents that do not depend on a DTD. Although it is common practice
873to insert a DOCTYPE declaration referencing an external DTD, this has 866to insert a DOCTYPE declaration referencing an external DTD, this has
874undesirable side-effects. It means that the document is no longer 867undesirable side-effects. It means that the document is no longer