   (self-insert-command (prefix-numeric-value arg))
   (if (ruby-electric-is-last-command-char-expandable-punct-p)
       (cond ((ruby-electric-code-at-point-p)
-	     (insert " ")
-	     (save-excursion
-	       (if ruby-electric-newline-before-closing-bracket
-		   (newline))
-	       (insert "}")))
-	    ((ruby-electric-string-at-point-p)
-	     (save-excursion
-	       (backward-char 1)
-	       (when (char-equal ?\# (preceding-char))
-		 (forward-char 1)
-		 (insert "}")))))))
+             (insert " ")
+             (save-excursion
+               (if ruby-electric-newline-before-closing-bracket
+                   (newline))
+               (insert "}")))
+            ((ruby-electric-string-at-point-p)
+             (save-excursion
+               (backward-char 1)
+               (when (char-equal ?\# (preceding-char))
+                 (forward-char 1)
+                 (insert "}")))))))
 
 (defun ruby-electric-matching-char(arg)
   (interactive "P")

  "*List of contexts where matching delimiter should be
inserted. The word 'all' will do all insertions."
  :type '(set :extra-offset 8
	      (const :tag "Everything" all )
	      (const :tag "Curly brace" ?\{ )
	      (const :tag "Square brace" ?\[ )
	      (const :tag "Round brace" ?\( )
	      (const :tag "Quote" ?\' )
	      (const :tag "Double quote" ?\" )
	      (const :tag "Back quote" ?\` )
	      (const :tag "Vertical bar" ?\| ))
  :group 'ruby-electric) 

(defcustom ruby-electric-newline-before-closing-bracket nil

  (and (ruby-electric-is-last-command-char-expandable-punct-p)
       (ruby-electric-code-at-point-p)
       (and (save-excursion (re-search-backward ruby-electric-expandable-bar nil t))
            (= (point) (match-end 0))) ;looking-back is missing on XEmacs
       (save-excursion 
         (insert "|"))))


(provide 'ruby-electric)
