Function: rng-complete-attribute-value
rng-complete-attribute-value is a byte-compiled function defined in
rng-nxml.el.gz.
Signature
(rng-complete-attribute-value LT-POS)
Source Code
;; Defined in /usr/src/emacs/lisp/nxml/rng-nxml.el.gz
(defun rng-complete-attribute-value (lt-pos)
(when (save-excursion
(re-search-backward rng-in-attribute-value-regex lt-pos t))
(let* ((name-start (match-beginning 1))
(name-end (match-end 1))
(colon (match-beginning 2))
(value-start (1+ (match-beginning 3)))
(exit-function
(lambda (_completion status)
(when (eq status 'finished)
(let ((delim (char-before value-start)))
(unless (eq (char-after) delim) (insert delim))))))
(kind-function (lambda (_) 'value)))
(and (rng-adjust-state-for-attribute lt-pos
name-start)
(if (string= (buffer-substring-no-properties name-start
(or colon name-end))
"xmlns")
`(,value-start ,(point)
,(rng-strings-to-completion-table
(rng-possible-namespace-uris
(and colon
(buffer-substring-no-properties (1+ colon) name-end))))
:exit-function ,exit-function
:company-kind ,kind-function)
(rng-adjust-state-for-attribute-value name-start
colon
name-end)
`(,value-start ,(point)
,(rng-strings-to-completion-table
(rng-match-possible-value-strings))
:exit-function ,exit-function
:company-kind ,kind-function))))))