 (define-derived-mode futhark-mode fundamental-mode "Futhark"
   "Major mode for editing Futhark source files."
   :syntax-table futhark-mode-syntax-table
-  (set (make-local-variable 'font-lock-defaults) '(futhark-font-lock))
-  (set (make-local-variable 'indent-line-function) 'futhark-indent-line)
-  (set (make-local-variable 'indent-region-function) nil)
-  (set (make-local-variable 'comment-start) "--")
-  (set (make-local-variable 'comment-padding) " ")
-  (set (make-local-variable 'paragraph-separate)
-       (concat comment-start " ==$"))
+  (setq-local font-lock-defaults '(futhark-font-lock))
+  (setq-local indent-line-function 'futhark-indent-line)
+  (setq-local indent-region-function nil)
+  (setq-local comment-start "--")
+  (setq-local comment-start-skip "--[ \t]*")
+  (setq-local paragraph-start (concat " *-- |\\| ==$\\|" page-delimiter))
+  (setq-local paragraph-separate (concat " *-- ==$\\|" page-delimiter))
+  (setq-local comment-padding " ")
   (add-hook 'after-change-functions 'futhark-check-unsafe nil))
 
 (provide 'futhark-mode)

    "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")

;; efficient GPU code.  This Emacs mode provides syntax highlighting and
;; conservative automatic indentation for Futhark source code.
;;
;; Files with the ".fut" extension are automatically handled by this mode.
;;
;; For extensions: Define local keybindings in `futhark-mode-map'.  Add startup
;; functions to `futhark-mode-hook'.

;;; Code:

