 		(define-key map [menu-bar ldg-recon-menu add] '("Add Entry" . ledger-reconcile-add))
 		(define-key map [menu-bar ldg-recon-menu tog] '("Toggle Entry" . ledger-reconcile-toggle))
 		(define-key map [menu-bar ldg-recon-menu sep3] '("--"))
+		(define-key map [menu-bar ldg-recon-menu sort-amt] `("Sort by amount" . ,(ledger-reconcile-change-sort-key-and-refresh "(amount)")))
+		(define-key map [menu-bar ldg-recon-menu sort-pay] `("Sort by date" . ,(ledger-reconcile-change-sort-key-and-refresh "(date)")))
+		(define-key map [menu-bar ldg-recon-menu sort-dat] `("Sort by payee" . ,(ledger-reconcile-change-sort-key-and-refresh "(payee)")))
+		(define-key map [menu-bar ldg-recon-menu sep4] '("--"))
 		(define-key map [menu-bar ldg-recon-menu bal] '("Show Cleared Balance" . ledger-display-balance))
 		(define-key map [menu-bar ldg-recon-menu tgt] '("Change Target Balance" . ledger-reconcile-change-target))
-		(define-key map [menu-bar ldg-recon-menu sep4] '("--"))
+		(define-key map [menu-bar ldg-recon-menu sep5] '("--"))
 		(define-key map [menu-bar ldg-recon-menu rna] '("Reconcile New Account" . ledger-reconcile))
-		(define-key map [menu-bar ldg-recon-menu sep5] '("--"))
+		(define-key map [menu-bar ldg-recon-menu sep6] '("--"))
 		(define-key map [menu-bar ldg-recon-menu fin] '("Finish" . ledger-reconcile-finish))
 		(define-key map [menu-bar ldg-recon-menu ref] '("Refresh" . ledger-reconcile-refresh))
 		(define-key map [menu-bar ldg-recon-menu sav] '("Save" . ledger-reconcile-save))

  :type 'string
  :group 'ledger-reconcile)


(defun ledger-reconcile-get-cleared-or-pending-balance (buffer account)
  "Calculate the cleared or pending balance of the account."

  (interactive)
  (setq ledger-target (ledger-read-commodity-string ledger-reconcile-target-prompt-string)))

(defmacro ledger-reconcile-change-sort-key-and-refresh (sort-by)
	`(lambda ()
		 (interactive)

		 (setq ledger-reconcile-sort-key ,sort-by)
		 (ledger-reconcile-refresh)))

(define-derived-mode ledger-reconcile-mode text-mode "Reconcile"
	"A mode for reconciling ledger entries."
	(let ((map (make-sparse-keymap)))
