Added back my patches for johns ldg-mode
This commit is contained in:
parent
6de14e0867
commit
7b11dad404
1 changed files with 19 additions and 8 deletions
|
|
@ -259,15 +259,16 @@ the default."
|
||||||
(insert (format "Report: %s\n" ledger-report-name)
|
(insert (format "Report: %s\n" ledger-report-name)
|
||||||
(format "Command: %s\n" cmd)
|
(format "Command: %s\n" cmd)
|
||||||
(make-string (- (window-width) 1) ?=)
|
(make-string (- (window-width) 1) ?=)
|
||||||
"\n")
|
"\n\n")
|
||||||
(let ((register-report (string-match " reg\\(ister\\)? " cmd))
|
(let ((data-pos (point))
|
||||||
|
(register-report (string-match " reg\\(ister\\)? " cmd))
|
||||||
files-in-report)
|
files-in-report)
|
||||||
(shell-command
|
(shell-command
|
||||||
(if register-report
|
(if register-report
|
||||||
(concat cmd " --prepend-format='%(filename):%(beg_line):'")
|
(concat cmd " --prepend-format='%(filename):%(beg_line):'")
|
||||||
cmd) t nil)
|
cmd) t nil)
|
||||||
(when register-report
|
(when register-report
|
||||||
(goto-char (point-min))
|
(goto-char data-pos)
|
||||||
(while (re-search-forward "^\\([^:]+\\)?:\\([0-9]+\\)?:" nil t)
|
(while (re-search-forward "^\\([^:]+\\)?:\\([0-9]+\\)?:" nil t)
|
||||||
(let ((file (match-string 1))
|
(let ((file (match-string 1))
|
||||||
(line (string-to-number (match-string 2))))
|
(line (string-to-number (match-string 2))))
|
||||||
|
|
@ -283,20 +284,30 @@ the default."
|
||||||
ledger-report-patch-alist))
|
ledger-report-patch-alist))
|
||||||
(add-to-list 'files-in-report fullpath)))
|
(add-to-list 'files-in-report fullpath)))
|
||||||
|
|
||||||
(dolist (path files-in-report)
|
;; Disable john's "monkey patching" because it didn't work
|
||||||
(let ((buf (get-file-buffer path)))
|
;; (dolist (path files-in-report)
|
||||||
(if (and buf (buffer-live-p buf))
|
;; (let ((buf (get-file-buffer path)))
|
||||||
(ledger-report-patch-reports buf))))))))
|
;; (if (and buf (buffer-live-p buf))
|
||||||
|
;; (ledger-report-patch-reports buf))))))))
|
||||||
|
)
|
||||||
|
(goto-char data-pos) )))
|
||||||
|
|
||||||
(defun ledger-report-visit-source ()
|
(defun ledger-report-visit-source ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((prop (get-text-property (point) 'ledger-source)))
|
(let ((prop (get-text-property (point) 'ledger-source)))
|
||||||
(destructuring-bind (file . line-or-marker) prop
|
(destructuring-bind (file . line-or-marker) prop
|
||||||
(find-file-other-window file)
|
(find-file-other-window file)
|
||||||
|
(widen)
|
||||||
(if (markerp line-or-marker)
|
(if (markerp line-or-marker)
|
||||||
(goto-char line-or-marker)
|
(goto-char line-or-marker)
|
||||||
(goto-char (point-min))
|
(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 ()
|
(defun ledger-report-goto ()
|
||||||
"Goto the ledger report buffer."
|
"Goto the ledger report buffer."
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue