 		(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

      (insert
       (with-temp-buffer
	 (setq exit-code
	       (apply #'ledger-run-ledger
		      ledger-buf "entry"
		      (split-string
		       (with-temp-buffer
			 (insert entry-text)
			 (goto-char (point-min))
			 (while (re-search-forward "\\([&$]\\)" nil t)
			   (replace-match "\\\\\\1"))
			 (buffer-string)))))
	 (if (= 0 exit-code)
	     (if insert-year
		 (buffer-substring 2 (point-max))
	       (buffer-substring 7 (point-max)))
	   (concat (if insert-year entry-text
		     (substring entry-text 6)) "\n"))) "\n"))))

(defun ledger-delete-current-entry ()
  (interactive)
  (save-excursion
    (when (or (looking-at "^[0-9]")
	      (re-search-backward "^[0-9]" nil t))
      (let ((beg (point)))
	(while (not (eolp))
	  (forward-line))
	(delete-blank-lines)
	(delete-region beg (point))))))

(defun ledger-toggle-current ()
  (interactive)
