Function: nxml-compute-indent-in-delimited-token
nxml-compute-indent-in-delimited-token is a byte-compiled function
defined in nxml-mode.el.gz.
Signature
(nxml-compute-indent-in-delimited-token POS OPEN-DELIM CLOSE-DELIM)
Documentation
Return the indent for a line that starts inside a token with delimiters.
OPEN-DELIM and CLOSE-DELIM are strings giving the opening and closing
delimiters. POS is the position of the first non-whitespace character
of the line. This expects the xmltok-* variables to be set up as by
xmltok-forward.
Source Code
;; Defined in /usr/src/emacs/lisp/nxml/nxml-mode.el.gz
(defun nxml-compute-indent-in-delimited-token (pos open-delim close-delim)
"Return the indent for a line that starts inside a token with delimiters.
OPEN-DELIM and CLOSE-DELIM are strings giving the opening and closing
delimiters. POS is the position of the first non-whitespace character
of the line. This expects the xmltok-* variables to be set up as by
`xmltok-forward'."
(cond ((let ((end (+ pos (length close-delim))))
(and (<= end (point-max))
(string= (buffer-substring-no-properties pos end)
close-delim)))
(goto-char xmltok-start))
((progn
(goto-char pos)
(forward-line -1)
(while (looking-at "^[[:blank:]]*$")
(forward-line -1))
(<= (point) xmltok-start))
(goto-char (+ xmltok-start (length open-delim)))
(when (and (string= open-delim "<!--")
(looking-at " "))
(goto-char (1+ (point)))))
(t (back-to-indentation)))
(current-column))