Function: nxml-indent-line

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

Signature

(nxml-indent-line)

Documentation

Indent current line as XML.

Source Code

;; Defined in /usr/src/emacs/lisp/nxml/nxml-mode.el.gz
;;; Indentation

(defun nxml-indent-line ()
  "Indent current line as XML."
  (let* ((savep (point))
         (indent (condition-case nil
                     (save-excursion
                       (forward-line 0)
                       (skip-chars-forward " \t")
                       (if (>= (point) savep) (setq savep nil))
                       (or (nxml-compute-indent) 0))
                   (error 0))))
    (if (not (numberp indent))
        ;; If something funny is used (e.g. `noindent'), return it.
        indent
      (if (< indent 0) (setq indent 0)) ;Just in case.
      (if savep
          (save-excursion (indent-line-to indent))
        (indent-line-to indent)))))