 	       (lisp-indent-specform method state
 				     indent-point normal-indent))
 	      (method
-		(funcall method state indent-point normal-indent)))))))
-
-
-;; Special indentation rules. "def" anything is already fixed!
-
-;; (put 'begin 'lfe-indent-function 0), say, causes begin to be indented
+               (funcall method state indent-point normal-indent)))))))
+
+;;; Indentation rule helpers
+;; Modified from `clojure-mode'.
+
+(defun put-lfe-indent (sym indent)
+  "Instruct `lfe-indent-function' to indent the body of `SYM' by `INDENT'."
+  (put sym 'lfe-indent-function indent))
+
+(defmacro define-lfe-indent (&rest kvs)
+  "Call `put-lfe-indent' on a series, `KVS'."
+  `(progn
+     ,@(mapcar (lambda (x)
+                 `(put-lfe-indent (quote ,(car x)) ,(cadr x)))
+               kvs)))
+
+;;; Special indentation rules
+;; "def" anything is already fixed!
+
+;; (define-lfe-indent (begin 0)), say, causes begin to be indented
 ;; like defun if the first form is placed on the next line, otherwise
 ;; it is indented like any other form (i.e. forms line up under first).
 
-;; Old style forms.
-(put 'begin 'lfe-indent-function 0)
-(put 'let-syntax 'lfe-indent-function 1)
-(put 'syntax-rules 'lfe-indent-function 0)
-(put 'macro 'lfe-indent-function 0)
-;; New style forms.
-;; Core forms.
-(put 'progn 'lfe-indent-function 0)
-(put 'lambda 'lfe-indent-function 1)
-(put 'match-lambda 'lfe-indent-function 0)
-(put 'let 'lfe-indent-function 1)
-(put 'let-function 'lfe-indent-function 1)
-(put 'letrec-function 'lfe-indent-function 1)
-(put 'let-macro 'lfe-indent-function 1)
-(put 'if 'lfe-indent-function 1)
-(put 'case 'lfe-indent-function 1)
-(put 'receive 'lfe-indent-function 0)
-(put 'catch 'lfe-indent-function 0)
-(put 'try 'lfe-indent-function 1)
-(put 'after 'lfe-indent-function 1)
-(put 'call 'lfe-indent-function 2)
-(put 'when 'lfe-indent-function 0)
-(put 'eval-when-compile 'lfe-indent-function 0)
-;; Core macros.
-(put ': 'lfe-indent-function 2)
-(put 'let* 'lfe-indent-function 1)
-(put 'flet 'lfe-indent-function 1)
-(put 'flet* 'lfe-indent-function 1)
-(put 'fletrec 'lfe-indent-function 1)
-(put 'macrolet 'lfe-indent-function 1)
-(put 'syntaxlet 'lfe-indent-function 1)
-(put 'do 'lfe-indent-function 2)
-(put 'lc 'lfe-indent-function 1)
-(put 'bc 'lfe-indent-function 1)
-(put 'match-spec 'lfe-indent-function 0)
+(define-lfe-indent
+  ;; Old style forms.
+  (begin 0)
+  (let-syntax 1)
+  (syntax-rules 0)
+  (macro 0)
+
+  ;; New style forms.
+  ;; Core forms.
+  (progn 0)
+  (lambda 1)
+  (match-lambda 0)
+  (let 1)
+  (let-function 1)
+  (letrec-function 1)
+  (let-macro 1)
+  (if 1)
+  (case 1)
+  (receive 0)
+  (catch 0)
+  (try 1)
+  (after 1)
+  (call 2)
+  (when 0)
+  (eval-when-compile 0)
+
+  ;; Core macros.
+  (: 2)
+  (let* 1)
+  (flet 1)
+  (flet* 1)
+  (fletrec 1)
+  (macrolet 1)
+  (syntaxlet 1)
+  (do 2)
+  (lc 1)
+  (bc 1)
+  (match-spec 0))
 
 ;;;###autoload
-;; Associate ".lfe" with LFE mode.
-(add-to-list 'auto-mode-alist '("\\.lfe\\'" . lfe-mode) t)
+;; Associate ".lfe{s,sh}?" with LFE mode.
+(add-to-list 'auto-mode-alist '("\\.lfe\\(?:s\\|sh\\)\\'" . lfe-mode) t)
 
 ;;;###autoload
 ;; Ignore files ending in ".jam", ".vee", and ".beam" when performing

	'((lfe-font-lock-keywords
	   lfe-font-lock-keywords-1 lfe-font-lock-keywords-2)
	  nil nil (("+-*/.<>=!?$%_&~^:@" . "w")) beginning-of-defun
	  (font-lock-mark-block-function . mark-defun))))

;; Font locking

(defconst lfe-font-lock-keywords-1
  (eval-when-compile

;; limitations under the License.

;;; Author Robert Virding

;;; Commentary:
;; Copied from `lisp-mode' and `scheme-mode' and modified for LFE.

;;; Code:

(require 'lisp-mode)

(defconst lfe--prettify-symbols-alist '(("lambda"  . ?λ))
  "Prettfy symbols alist user in Lisp Flavoured Erlang mode.")

(defvar lfe-mode-syntax-table
  (let ((table (copy-syntax-table lisp-mode-syntax-table)))
