summaryrefslogtreecommitdiff
path: root/lisp/nxml/nxml-mode.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2016-01-16 14:03:29 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2016-01-16 14:03:29 -0500
commitd7896a6f773dc4ae4e1b56c34b6708fe2bc5610a (patch)
treee79a7eb44c198c5d4b79c08c552512144dc581c3 /lisp/nxml/nxml-mode.el
parentd10982a91ac2b93bf9a375e00d676a25f90b885a (diff)
downloademacs-d7896a6f773dc4ae4e1b56c34b6708fe2bc5610a.tar.gz
emacs-d7896a6f773dc4ae4e1b56c34b6708fe2bc5610a.tar.bz2
emacs-d7896a6f773dc4ae4e1b56c34b6708fe2bc5610a.zip
* lisp/nxml: Use standard completion; it also works for company-mode
* lisp/nxml/nxml-mode.el (nxml-complete): Obsolete. (nxml-completion-at-point-function): Remove. (nxml-mode): Don't set completion-at-point-functions. * lisp/nxml/rng-nxml.el (rng-nxml-mode-init): Set it here instead. (rng-completion-at-point): Rename from rng-complete and mark it non-interactive. It is now to be used as completion-at-point-function. (rng-complete-tag, rng-complete-end-tag, rng-complete-attribute-name) (rng-complete-attribute-value): Don't perform completion, but return completion data instead. (rng-complete-qname-function, rng-generate-qname-list): Add a few arguments, previously passed via dynamic coping. (rng-strings-to-completion-table): Rename from rng-strings-to-completion-alist. Don't return an alist. Don't both sorting and uniquifying. * lisp/nxml/rng-util.el (rng-complete-before-point): Delete function. (rng-completion-exact-p, rng-quote-string): Delete functions. * lisp/nxml/rng-valid.el (rng-recover-start-tag-open) (rng-missing-attributes-message, rng-missing-element-message) (rng-mark-missing-end-tags): Use explicit ".." in formats rather than calling rng-quote-string everywhere.
Diffstat (limited to 'lisp/nxml/nxml-mode.el')
-rw-r--r--lisp/nxml/nxml-mode.el28
1 files changed, 1 insertions, 27 deletions
diff --git a/lisp/nxml/nxml-mode.el b/lisp/nxml/nxml-mode.el
index b7a4e2e2469..c6600b185e6 100644
--- a/lisp/nxml/nxml-mode.el
+++ b/lisp/nxml/nxml-mode.el
@@ -535,8 +535,6 @@ Many aspects this mode can be customized using
(nxml-clear-inside (point-min) (point-max))
(nxml-with-invisible-motion
(nxml-scan-prolog)))))
- (add-hook 'completion-at-point-functions
- #'nxml-completion-at-point-function nil t)
(setq-local syntax-propertize-function #'nxml-after-change)
(add-hook 'change-major-mode-hook #'nxml-cleanup nil t)
@@ -557,7 +555,6 @@ Many aspects this mode can be customized using
t ; keywords-only; we highlight comments and strings here
nil ; font-lock-keywords-case-fold-search. XML is case sensitive
nil ; no special syntax table
- nil ; no automatic syntactic fontification
(font-lock-extend-region-functions . (nxml-extend-region))
(jit-lock-contextually . t)
(font-lock-unfontify-region-function . nxml-unfontify-region)))
@@ -1577,30 +1574,7 @@ of the line. This expects the xmltok-* variables to be set up as by
(t (back-to-indentation)))
(current-column))
-;;; Completion
-
-(defun nxml-complete ()
- "Perform completion on the symbol preceding point.
-
-Inserts as many characters as can be completed. However, if not even
-one character can be completed, then a buffer with the possibilities
-is popped up and the symbol is read from the minibuffer with
-completion. If the symbol is complete, then any characters that must
-follow the symbol are also inserted.
-
-The name space used for completion and what is treated as a symbol
-depends on the context. The contexts in which completion is performed
-depend on `nxml-completion-hook'."
- (interactive)
- (unless (run-hook-with-args-until-success 'nxml-completion-hook)
- ;; Eventually we will complete on entity names here.
- (ding)
- (message "Cannot complete in this context")))
-
-(defun nxml-completion-at-point-function ()
- "Call `nxml-complete' to perform completion at point."
- (when nxml-bind-meta-tab-to-complete-flag
- #'nxml-complete))
+(define-obsolete-function-alias 'nxml-complete #'completion-at-point "26.1")
;;; Movement