diff options
author | John Wiegley <johnw@newartisans.com> | 2011-06-30 11:55:03 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2011-06-30 11:55:03 -0500 |
commit | 80f81bdd967838e9146f8a28b9017d531c976d58 (patch) | |
tree | 5ba8c948e80f56bdd96b0abf7a6537cb2df4744f /lisp/ledger.el | |
parent | 96dc3dcf9e757ebe4361a5f675b3de8dcf3ec416 (diff) | |
parent | 91d8061af470998ac7100b242f7eafb71a7b39d2 (diff) | |
download | fork-ledger-80f81bdd967838e9146f8a28b9017d531c976d58.tar.gz fork-ledger-80f81bdd967838e9146f8a28b9017d531c976d58.tar.bz2 fork-ledger-80f81bdd967838e9146f8a28b9017d531c976d58.zip |
Merge branch 'master' into next
Diffstat (limited to 'lisp/ledger.el')
-rw-r--r-- | lisp/ledger.el | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/lisp/ledger.el b/lisp/ledger.el index 25bb485b..2d15f090 100644 --- a/lisp/ledger.el +++ b/lisp/ledger.el @@ -433,7 +433,9 @@ dropped." ;;;###autoload (define-derived-mode ledger-mode text-mode "Ledger" - "A mode for editing ledger data files." + "A mode for editing ledger data files. + +\\{ledger-mode-map}" (set (make-local-variable 'comment-start) " ; ") (set (make-local-variable 'comment-end) "") (set (make-local-variable 'indent-tabs-mode) nil) @@ -632,8 +634,7 @@ dropped." (defvar ledger-reconcile-mode-abbrev-table) -(define-derived-mode ledger-reconcile-mode text-mode "Reconcile" - "A mode for reconciling ledger entries." +(defvar ledger-reconcile-mode-map (let ((map (make-sparse-keymap))) (define-key map [(control ?m)] 'ledger-reconcile-visit) (define-key map [return] 'ledger-reconcile-visit) @@ -647,7 +648,12 @@ dropped." (define-key map [?p] 'previous-line) (define-key map [?s] 'ledger-reconcile-save) (define-key map [?q] 'ledger-reconcile-quit) - (use-local-map map))) + map)) + +(define-derived-mode ledger-reconcile-mode text-mode "Reconcile" + "A mode for reconciling ledger entries. + +\\{ledger-reconcile-mode-map}") ;; Context sensitivity @@ -807,8 +813,7 @@ specified line, returns nil." (defvar ledger-report-mode-abbrev-table) -(define-derived-mode ledger-report-mode text-mode "Ledger-Report" - "A mode for viewing ledger reports." +(defvar ledger-report-mode-map (let ((map (make-sparse-keymap))) (define-key map [? ] 'scroll-up) (define-key map [backspace] 'scroll-down) @@ -825,7 +830,10 @@ specified line, returns nil." 'ledger-report-kill) (define-key map [(control ?c) (control ?l) (control ?e)] 'ledger-report-edit) - (use-local-map map))) + map)) + +(define-derived-mode ledger-report-mode text-mode "Ledger-Report" + "A mode for viewing ledger reports.") (defun ledger-report-read-name () "Read the name of a ledger report to use, with completion. @@ -1201,7 +1209,7 @@ the default." ;; A sample function for $ users (defun ledger-next-amount (&optional end) - (when (re-search-forward "\\( \\|\t\\| \t\\)[ \t]*-?\\([A-Z$]+ *\\)?\\(-?[0-9,]+?\\)\\(.[0-9]+\\)?\\( *[A-Z$]+\\)?\\([ \t]*@@?[^\n;]+?\\)?\\([ \t]+;.+?\\)?$" (marker-position end) t) + (when (re-search-forward "\\( \\|\t\\| \t\\)[ \t]*-?\\([A-Z$€£]+ *\\)?\\(-?[0-9,]+?\\)\\(.[0-9]+\\)?\\( *[A-Z$€£]+\\)?\\([ \t]*@@?[^\n;]+?\\)?\\([ \t]+;.+?\\)?$" (marker-position end) t) (goto-char (match-beginning 0)) (skip-syntax-forward " ") (- (or (match-end 4) |