X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/35cf62d95cdcd5323dcea4a5385942c342ff1d9c..651af8c6316d7fca5b3dadb52b596c2485b2c5d3:/doc/misc/nxml-mode.texi diff --git a/doc/misc/nxml-mode.texi b/doc/misc/nxml-mode.texi index 5141ed0e93..c8d159e236 100644 --- a/doc/misc/nxml-mode.texi +++ b/doc/misc/nxml-mode.texi @@ -5,11 +5,10 @@ @c %**end of header @copying -This manual documents nxml-mode, an Emacs major mode for editing +This manual documents nXML mode, an Emacs major mode for editing XML with RELAX NG support. -Copyright @copyright{} 2007-2012 -Free Software Foundation, Inc. +Copyright @copyright{} 2007-2012 Free Software Foundation, Inc. @quotation Permission is granted to copy, distribute and/or modify this document @@ -109,31 +108,25 @@ lists. Report any bugs with @kbd{M-x report-emacs-bug}. @node Completion @chapter Completion -Apart from real-time validation, the most important feature that -nxml-mode provides for assisting in document creation is "completion". +Apart from real-time validation, the most important feature that nXML +mode provides for assisting in document creation is "completion". Completion assists the user in inserting characters at point, based on knowledge of the schema and on the contents of the buffer before point. -The traditional GNU Emacs key combination for completion in a -buffer is @kbd{M-@key{TAB}}. However, many window systems -and window managers use this key combination themselves (typically for -switching between windows) and do not pass it to applications. It's -hard to find key combinations in GNU Emacs that are both easy to type -and not taken by something else. @kbd{C-@key{RET}} (i.e. -pressing the Enter or Return key, while the Ctrl key is held down) is -available. It won't be available on a traditional terminal (because -it is indistinguishable from Return), but it will work with a window -system. Therefore we adopt the following solution by default: use -@kbd{C-@key{RET}} when there's a window system and -@kbd{M-@key{TAB}} when there's not. In the following, I -will assume that a window system is being used and will therefore -refer to @kbd{C-@key{RET}}. - -Completion works by examining the symbol preceding point. This -is the symbol to be completed. The symbol to be completed may be the -empty. Completion considers what symbols starting with the symbol to -be completed would be valid replacements for the symbol to be +nXML mode adapts the standard GNU Emacs command for completion in a +buffer: @code{completion-at-point}, which is bound to @kbd{C-M-i} and +@kbd{M-@key{TAB}}. Note that many window systems and window managers +use @kbd{M-@key{TAB}} themselves (typically for switching between +windows) and do not pass it to applications. In that case, you should +type @kbd{C-M-i} or @kbd{@key{ESC} @key{TAB}} for completion, or bind +@code{completion-at-point} to a key that is convenient for you. In +the following, I will assume that you type @kbd{C-M-i}. + +nXML mode completion works by examining the symbol preceding point. +This is the symbol to be completed. The symbol to be completed may be +the empty. Completion considers what symbols starting with the symbol +to be completed would be valid replacements for the symbol to be completed, given the schema and the contents of the buffer before point. These symbols are the possible completions. An example may make this clearer. Suppose the buffer looks like this (where @point{} @@ -169,7 +162,7 @@ completions are @samp{base}, @samp{isindex}, In this case, the symbol to be completed is empty, and the possible completions are just @samp{http://www.w3.org/1999/xhtml}. -When you type @kbd{C-@key{RET}}, what happens depends +When you type @kbd{C-M-i}, what happens depends on what the set of possible completions are. @itemize @bullet @@ -187,7 +180,7 @@ required. For example, in this case: @end example @noindent -@kbd{C-@key{RET}} will yield +@kbd{C-M-i} will yield @example @@ -203,18 +196,17 @@ is inserted. For example, suppose the buffer is: @end example @noindent -The symbol to be completed is @samp{x}. The possible completions -are @samp{xmlns} and @samp{xml:lang}. These share a -common prefix of @samp{xml}. Thus, @kbd{C-@key{RET}} -will yield: +The symbol to be completed is @samp{x}. The possible completions are +@samp{xmlns} and @samp{xml:lang}. These share a common prefix of +@samp{xml}. Thus, @kbd{C-M-i} will yield: @example