diff options
author | adamsrl <rladams@adamsinfoserv.com> | 2012-10-14 16:43:56 -0500 |
---|---|---|
committer | adamsrl <rladams@adamsinfoserv.com> | 2012-10-14 16:43:56 -0500 |
commit | 7b11dad404b4e689393a5725c93ea84507fc2221 (patch) | |
tree | 9a68f4c9905012df007b41801e53b71aa340c9cd /lisp | |
parent | 6de14e08677f6cb0c10c9d34c3024918bf979d68 (diff) | |
download | fork-ledger-7b11dad404b4e689393a5725c93ea84507fc2221.tar.gz fork-ledger-7b11dad404b4e689393a5725c93ea84507fc2221.tar.bz2 fork-ledger-7b11dad404b4e689393a5725c93ea84507fc2221.zip |
Added back my patches for johns ldg-mode
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ldg-report.el | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/lisp/ldg-report.el b/lisp/ldg-report.el index f9c6afca..e0744100 100644 --- a/lisp/ldg-report.el +++ b/lisp/ldg-report.el @@ -259,15 +259,16 @@ the default." (insert (format "Report: %s\n" ledger-report-name) (format "Command: %s\n" cmd) (make-string (- (window-width) 1) ?=) - "\n") - (let ((register-report (string-match " reg\\(ister\\)? " cmd)) + "\n\n") + (let ((data-pos (point)) + (register-report (string-match " reg\\(ister\\)? " cmd)) files-in-report) (shell-command (if register-report (concat cmd " --prepend-format='%(filename):%(beg_line):'") cmd) t nil) (when register-report - (goto-char (point-min)) + (goto-char data-pos) (while (re-search-forward "^\\([^:]+\\)?:\\([0-9]+\\)?:" nil t) (let ((file (match-string 1)) (line (string-to-number (match-string 2)))) @@ -283,20 +284,30 @@ the default." ledger-report-patch-alist)) (add-to-list 'files-in-report fullpath))) - (dolist (path files-in-report) - (let ((buf (get-file-buffer path))) - (if (and buf (buffer-live-p buf)) - (ledger-report-patch-reports buf)))))))) + ;; Disable john's "monkey patching" because it didn't work + ;; (dolist (path files-in-report) + ;; (let ((buf (get-file-buffer path))) + ;; (if (and buf (buffer-live-p buf)) + ;; (ledger-report-patch-reports buf)))))))) + ) + (goto-char data-pos) ))) (defun ledger-report-visit-source () (interactive) (let ((prop (get-text-property (point) 'ledger-source))) (destructuring-bind (file . line-or-marker) prop (find-file-other-window file) + (widen) (if (markerp line-or-marker) (goto-char line-or-marker) (goto-char (point-min)) - (forward-line (1- line-or-marker)))))) + (forward-line (1- line-or-marker)) + (re-search-backward "^[0-9]+") + (beginning-of-line) + (let ((start-of-txn (point))) + (forward-paragraph) + (narrow-to-region start-of-txn (point)) + (backward-paragraph)))))) (defun ledger-report-goto () "Goto the ledger report buffer." |