Function: nxml-compute-indent-in-token

nxml-compute-indent-in-token is a byte-compiled function defined in nxml-mode.el.gz.

Signature

(nxml-compute-indent-in-token POS)

Documentation

Return the indent for a line that starts inside a token.

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-token (pos)
  "Return the indent for a line that starts inside a token.
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 ((memq xmltok-type '(start-tag
			     partial-start-tag
			     empty-element
			     partial-empty-element))
	 (nxml-compute-indent-in-start-tag pos))
	((eq xmltok-type 'comment)
	 (nxml-compute-indent-in-delimited-token pos "<!--" "-->"))
	((eq xmltok-type 'cdata-section)
	 (nxml-compute-indent-in-delimited-token pos "<![CDATA[" "]]>"))
	((eq xmltok-type 'processing-instruction)
	 (nxml-compute-indent-in-delimited-token pos "<?" "?>"))
	(t
	 (goto-char pos)
	 (if (and (= (forward-line -1) 0)
		  (< xmltok-start (point)))
	     (back-to-indentation)
	   (goto-char xmltok-start))
	 (current-column))))