Function: smie-indent-line
smie-indent-line is an interactive and byte-compiled function defined
in smie.el.gz.
Signature
(smie-indent-line)
Documentation
Indent current line using the SMIE indentation engine.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/smie.el.gz
(defun smie-indent-line ()
"Indent current line using the SMIE indentation engine."
(interactive)
(let* ((savep (point))
(indent (or (with-demoted-errors "SMIE Error: %S"
(save-excursion
(forward-line 0)
(skip-chars-forward " \t")
(if (>= (point) savep) (setq savep nil))
(or (smie-indent-calculate) 0)))
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)))))