 		(unless (looking-at "(")
 		  (error (buffer-string)))
 		(read (current-buffer)))))))
+    (dolist (item items)
+      (dolist (xact (nthcdr 5 item))
+	(let ((beg (point)))
+	  (insert (format "%s %-30s %-25s %15s\n"
+			  (format-time-string "%m/%d" (nth 2 item))
+			  (nth 4 item) (nth 0 xact) (nth 1 xact)))
+	  (if (nth 1 item)
+	      (set-text-properties beg (1- (point))
+				   (list 'face 'bold
+					 'where (nth 0 item)))
+	    (set-text-properties beg (1- (point))
+				 (list 'where (nth 0 item)))))))
+    (goto-char (point-min))
+    (set-buffer-modified-p nil)
+    (toggle-read-only t)))
+
+(defun ledger-reconcile (account &optional arg)
+  (interactive "sAccount to reconcile: \nP")
+  (let ((buf (current-buffer)))
     (with-current-buffer
 	(pop-to-buffer (generate-new-buffer "*Reconcile*"))
       (ledger-reconcile-mode)
       (set (make-local-variable 'ledger-buf) buf)
       (set (make-local-variable 'ledger-acct) account)
-      (dolist (item items)
-	(dolist (xact (nthcdr 5 item))
-	  (let ((beg (point)))
-	    (insert (format "%s %-30s %-25s %15s\n"
-			    (format-time-string "%m/%d" (nth 2 item))
-			    (nth 4 item) (nth 0 xact) (nth 1 xact)))
-	    (if (nth 1 item)
-		(set-text-properties beg (1- (point))
-				     (list 'face 'bold
-					   'where (nth 0 item)))
-	      (set-text-properties beg (1- (point))
-				   (list 'where (nth 0 item)))))))
-      (goto-char (point-min))
-      (set-buffer-modified-p nil)
-      (toggle-read-only t)
+      (ledger-do-reconcile)
       (when arg
 	(sit-for 0 0)
 	(call-interactively #'ledger-auto-reconcile)))))

  (set-buffer-modified-p nil)
  (ledger-display-balance))

(defun ledger-reconcile (account &optional arg)
  (interactive "sAccount to reconcile: \nP")
  (let* ((buf (current-buffer))
	 (items
	  (with-temp-buffer
	    (let ((exit-code

	  (ledger-reconcile-toggle))))
    (goto-char (point-min))))

(defun ledger-reconcile-add ()
  (interactive)
  (with-current-buffer ledger-buf
    (call-interactively #'ledger-add-entry))
  (let ((inhibit-read-only t))
    (erase-buffer)
    (ledger-do-reconcile)
    (set-buffer-modified-p t)))

(defun ledger-reconcile-delete ()
  (interactive)
  (let ((where (get-text-property (point) 'where)))
    (with-current-buffer ledger-buf
      (goto-char where)
      (ledger-delete-current-entry))
    (let ((inhibit-read-only t))
      (goto-char (line-beginning-position))
      (delete-region (point) (1+ (line-end-position)))
      (set-buffer-modified-p t))))

(defun ledger-reconcile-save ()
  (interactive)
  (with-current-buffer ledger-buf
