    (save-excursion
      (futhark-beginning-of-line-text)
      (point))))
+
+(defun futhark-is-empty-line ()
+  "Check if the line of the current point is empty.
+It is considered empty if the line consists of zero or more
+whitespace characters."
+  (let ((cur (line-number-at-pos)))
+    (futhark-beginning-of-line-text)
+    (not (= cur (line-number-at-pos)))))
 
 (defun futhark-is-looking-at-keyword ()
   "Check if we are currently looking at a keyword."

    "All Futhark keywords.")

  (defconst futhark-builtin-functions
    '("iota" "shape" "replicate" "reshape" "rearrange" "transpose" "rotate"
      "split" "concat" "zip" "unzip" "unsafe" "copy" "map" "reduce"
      "reduce_comm" "scan" "filter" "partition" "scatter" "stream_map"
      "stream_map_per" "stream_red" "stream_map_per" "stream_seq")

                (and (not (eq nil m))
                     (goto-char m)
                     (current-column)))))

       ;; Align "then" to nearest "else if" or "if".
       (save-excursion
