https://github.com/aki2o/auto-complete-nxml.git
git clone 'git://github.com/aki2o/auto-complete-nxml.git'
This is a extension of Emacs provides completion by auto-complete.el on nXML-mode.
On nXML-mode, completion is started when you keystroke the bound key for starting completion defalut “C-RET”.
I think this action is good when completion use default interface of Emacs.
But the interface of auto-complete.el is lighter than it.
So, start completion automatically according to the context as much as possible.
When you are on nXML-mode, keystroke “<”. Then …
Subsequently, if you select “table” …
Subsequently, if you select “style” …
Subsequently, if you select “font-size” …
nXML-mode can't complete CSS property and its value.
But their definition are in auto-complete.el.
So, CSS property and its value are available when completion of attribute value.
See above screenshot.
nXML-mode can't complete on the content of the element.
But their definition exists in the used schema of RELAX NG and XML Schema.
So, when you are on the content of the element, do completion using them.
If it is not selective, do completion using the words in the nXML-mode buffers that you opened.
When you are in not selective content of the element, can use only the words in the opened buffer.
But it is too much trouble.
So, if anything-project.el is available, do completion using the words in the project files of anything-project.el.
nXML-mode can manage the namespace of the used schema.
For example, if you wrote the following,
<html xmlns="http://www.w3.org/TR/xhtml1"
xmlns:math="http://www.w3.org/1998/Math/MathML">
the defined in “http://www.w3.org/TR/xhtml1” are displayed without prefix,
the defined in “http://www.w3.org/1998/Math/MathML” are displayed with “math:”.
But when complete “xmlns” attribute,
nXML-mode don't complete namespace other than the default even if they exists in used schema.
In this case, you have to know which available namespace is.
Then, it is too much trouble.
So, when complete default namespace, complete all available namespaces automatically.
If you select “xmlns” …
When complete element and attribute, popup help about them beside displayed candidates.
And when you keystroke the bound key for popup help, popup help about pointed.
Abount binding the key for popup help, see Configuration section below.
In default, completion is started automatically.
But, you can disable it temporarily or constantly by the following way.
(setq auto-complete-nxml-automatic-p nil)
auto-complete-nxml-toggle-automatic
About keybind of auto-complete-nxml-toggle-automatic
, see Configuration section below.
Note: For start completion manually, use ac-trigger-key
.
You can install by the following way.
2013/09/15 It's available by using melpa.
2013/04/18 It's available. But, master branch only.
(auto-install-from-url "https://raw.github.com/aki2o/auto-complete-nxml/master/auto-complete-nxml.el")
download “auto-complete-nxml.el” manually and put it in your load-path.
(require 'auto-complete-nxml)
;; Keystroke for popup help about something at point.
(setq auto-complete-nxml-popup-help-key "C-:")
;; Keystroke for toggle on/off automatic completion.
(setq auto-complete-nxml-toggle-automatic-key "C-c C-t")
;; If you want to start completion manually from the beginning
(setq auto-complete-nxml-automatic-p nil)
Enjoy!!!