Function: dockerfile-indent-line-function

dockerfile-indent-line-function is a natively compiled function defined in dockerfile-mode.el.

Signature

(dockerfile-indent-line-function)

Documentation

Indent lines in a Dockerfile.

Lines beginning with a keyword are ignored, and any others are indented by one dockerfile-indent-offset. Functionality toggled by dockerfile-enable-auto-indent.

Source Code

;; Defined in /nix/store/wfmjr60p5jy1p85wbrh60l5f6r52la4p-emacs-packages-deps/share/emacs/site-lisp/elpa/dockerfile-mode-20251221.1644/dockerfile-mode.el
(defun dockerfile-indent-line-function ()
  "Indent lines in a Dockerfile.

Lines beginning with a keyword are ignored, and any others are
indented by one `dockerfile-indent-offset'. Functionality toggled
by `dockerfile-enable-auto-indent'."
  (when dockerfile-enable-auto-indent
    (unless (member (get-text-property (line-beginning-position) 'face)
             '(font-lock-comment-delimiter-face font-lock-keyword-face))
     (save-excursion
       (beginning-of-line)
       (unless (looking-at-p "\\s-*$") ; Ignore empty lines.
         (indent-line-to dockerfile-indent-offset))))))