 (defun shm/close-paren ()
   "Either insert a close paren or go to the end of the node."
   (interactive)
-  (if (shm-literal-insertion)
-      (shm-insert-string ")")
-    (shm/goto-parent-end)))
+  (shm-with-fallback
+   self-insert-command
+   (if (shm-literal-insertion)
+       (shm-insert-string ")")
+     (shm/goto-parent-end))))
 
 (defun shm/goto-parent-end ()
   "Set the current node overlay to the parent node, but go to the

  (interactive)
  (if (bound-and-true-p god-local-mode)
      (god-mode-self-insert)
      (cond
       ((looking-back "[^a-zA-Z0-9_]case")
        (let ((start (save-excursion (forward-char -1)
                                     (search-backward-regexp "[^a-zA-Z0-9_]")
                                     (forward-char 1)
                                     (point)))
              (template "case  of
  _ -> undefined"))
          (shm-adjust-dependents (point) (- start (point)))
          (delete-region start (point))
          (shm-adjust-dependents (point) (length (car (last (split-string template "\n")))))
          (shm-insert-indented
           (lambda ()
             (insert template)))
          (forward-char 5)))
       ((looking-back "[^a-zA-Z0-9_]if")
        (let ((start (save-excursion (forward-char -1)
                                     (search-backward-regexp "[^a-zA-Z0-9_]")
                                     (forward-char 1)
                                     (point)))
              (template (if (looking-at "$")
                            "if \n   then undefined\n   else undefined"
                          "if  then undefined else undefined")))
          (shm-adjust-dependents (point) (- start (point)))
          (delete-region start (point))
          (shm-adjust-dependents (point) (length (car (last (split-string template "\n")))))
          (shm-insert-indented
           (lambda ()
             (insert template)))
          (forward-char 3)))
       (t (shm-insert-string " ")))))

(defun shm/double-quote ()
  "Insert double quotes.

Hitting C-k C-k C-k here will killall three lines, and then C-y
will insert them back verbatim."
  (interactive)
  (shm-with-fallback
   kill-line
   (shm/reparse)
   (when (looking-at "[ ]+$")
     (delete-region (point) (line-end-position)))
   (cond
    ((and (= (point) (line-end-position))
          (not (looking-at "\n[^ ]")))
     (let ((column (current-column)))
       (delete-region (point)
                      (save-excursion (forward-line 1)
                                      (goto-char (+ (line-beginning-position)
                                                    column))))
       (shm-kill-to-end-of-line t)))
    ((shm-current-node) (shm-kill-to-end-of-line))
    (t (kill-line)))))

(defun shm/kill-node ()
  "Kill the current node."
