        ;; Otherwise, if the previous keyword is "fun", align to a single
        ;; indent level.
        (and
-        (string= "fun" (save-excursion (futhark-first-keyword-backward)))
+        (let ((first-keyword (save-excursion (futhark-first-keyword-backward))))
+          (or (string= "fun" first-keyword)
+              (string= "entry" first-keyword)))
         futhark-indent-level)
 
        ;; Otherwise, align to the previous non-empty line.

  `(

    ;; Function declarations
    (,(concat "fun[[:space:]\n]+" futhark-type
              "[[:space:]\n]+\\(" futhark-var "\\)")
     . '(1 font-lock-function-name-face))


        (topp (save-excursion (or (ignore-errors
                                    (backward-up-list 1)
                                    (point))
                                  (max
                                   (or (save-excursion
                                         (futhark-find-keyword-backward-raw "fun"))
                                       0)
                                   (or (save-excursion
                                         (futhark-find-keyword-backward-raw "entry"))
                                       0))
                                  )))
        (result nil)
        )

