diff options
author | Steve Purcell <steve@sanityinc.com> | 2013-12-11 08:15:34 +0000 |
---|---|---|
committer | Steve Purcell <steve@sanityinc.com> | 2013-12-11 08:31:07 +0000 |
commit | aaf20ab07f18356f927e09f5a040b6b0f3d733ed (patch) | |
tree | 44da5295500a6ec28cc669e443dc7bb3e3d37d79 /lisp/ledger-report.el | |
parent | 2b94b264beaa705896f96c6e23dd9ba122b791a3 (diff) | |
download | fork-ledger-aaf20ab07f18356f927e09f5a040b6b0f3d733ed.tar.gz fork-ledger-aaf20ab07f18356f927e09f5a040b6b0f3d733ed.tar.bz2 fork-ledger-aaf20ab07f18356f927e09f5a040b6b0f3d733ed.zip |
ledger-mode: Use easymenu to remove boilerplate
Among other benefits, this lets us define the menu entries from top to
bottom, rather than in reverse.
Diffstat (limited to 'lisp/ledger-report.el')
-rw-r--r-- | lisp/ledger-report.el | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/lisp/ledger-report.el b/lisp/ledger-report.el index 022cb6f6..c99c0066 100644 --- a/lisp/ledger-report.el +++ b/lisp/ledger-report.el @@ -25,6 +25,7 @@ ;;; Code: +(require 'easymenu) (eval-when-compile (require 'cl)) @@ -103,26 +104,26 @@ text that should replace the format specifier." (define-key map [(control ?c) (control ?l) (control ?e)] 'ledger-report-edit) (define-key map [return] 'ledger-report-visit-source) - - - (define-key map [menu-bar] (make-sparse-keymap "ledger-rep")) - (define-key map [menu-bar ledger-rep] (cons "Reports" map)) - - (define-key map [menu-bar ledger-rep lrq] '("Quit" . ledger-report-quit)) - (define-key map [menu-bar ledger-rep s2] '("--")) - (define-key map [menu-bar ledger-rep lrd] '("Scroll Down" . scroll-down)) - (define-key map [menu-bar ledger-rep vis] '("Visit Source" . ledger-report-visit-source)) - (define-key map [menu-bar ledger-rep lru] '("Scroll Up" . scroll-up)) - (define-key map [menu-bar ledger-rep s1] '("--")) - (define-key map [menu-bar ledger-rep rev] '("Reverse report order" . ledger-report-reverse-lines)) - (define-key map [menu-bar ledger-rep s0] '("--")) - (define-key map [menu-bar ledger-rep lrk] '("Kill Report" . ledger-report-kill)) - (define-key map [menu-bar ledger-rep lrr] '("Re-run Report" . ledger-report-redo)) - (define-key map [menu-bar ledger-rep lre] '("Edit Report" . ledger-report-edit)) - (define-key map [menu-bar ledger-rep lrs] '("Save Report" . ledger-report-save)) map) "Keymap for `ledger-report-mode'.") +(easy-menu-define ledger-report-mode-menu ledger-report-mode-map + "Ledger report menu" + '("Reports" + ["Save Report" ledger-report-save] + ["Edit Report" ledger-report-edit] + ["Re-run Report" ledger-report-redo] + ["Kill Report" ledger-report-kill] + "---" + ["Reverse report order" ledger-report-reverse-lines] + "---" + ["Scroll Up" scroll-up] + ["Visit Source" ledger-report-visit-source] + ["Scroll Down" scroll-down] + "---" + ["Quit" ledger-report-quit] + )) + (define-derived-mode ledger-report-mode text-mode "Ledger-Report" "A mode for viewing ledger reports.") |