      (define-key map [menu-bar ldg-rep vis] '("Visit Source" . ledger-report-visit-source))
      (define-key map [menu-bar ldg-rep lru] '("Scroll Up" . scroll-up))
      (define-key map [menu-bar ldg-rep s1] '("--"))
+     (define-key map [menu-bar ldg-rep rev] '("Reverse report order" . ledger-report-reverse-lines))
+     (define-key map [menu-bar ldg-rep s0] '("--"))
      (define-key map [menu-bar ldg-rep lrk] '("Kill Report" . ledger-report-kill))
      (define-key map [menu-bar ldg-rep lrr] '("Re-run Report" . ledger-report-redo))
      (define-key map [menu-bar ldg-rep lre] '("Edit Report" . ledger-report-edit))

        (register-report (string-match " reg\\(ister\\)? " cmd))
	files-in-report)
    (shell-command
     ;; subtotal doe not produce identifiable transactions, so don't
     ;; prepend location information for them
     (if (and register-report
	      (not (string-match "--subtotal" cmd)))


(defvar ledger-report-mode-abbrev-table)

(defun ledger-report-reverse-lines ()
  (interactive)
  (goto-char (point-min))
  (forward-paragraph)
  (next-line)
  (save-excursion
    (setq inhibit-read-only t)
    (reverse-region (point) (point-max))))

(define-derived-mode ledger-report-mode text-mode "Ledger-Report"
   "A mode for viewing ledger reports."
   (let ((map (make-sparse-keymap)))
     (define-key map [? ] 'scroll-up)
     (define-key map [backspace] 'scroll-down)
     (define-key map [?r] 'ledger-report-redo)
     (define-key map [?R] 'ledger-report-reverse-lines)
     (define-key map [?s] 'ledger-report-save)
     (define-key map [?k] 'ledger-report-kill)
     (define-key map [?e] 'ledger-report-edit)
