Prepare for separate blame to print.

This commit is contained in:
Dominik Pantůček 2023-05-15 13:47:31 +02:00
parent 73c45ab9db
commit b343f4726e
2 changed files with 21 additions and 0 deletions

View file

@ -127,6 +127,8 @@
(-action- 'print-info)) (-action- 'print-info))
(-print () "Print given member file" (-print () "Print given member file"
(-action- 'print-member-file)) (-action- 'print-member-file))
(-blame () "Print annotated member file"
(-action- 'blame-member-file))
(-fees () "Prints fees table" (-fees () "Prints fees table"
(-needs-bank- #t) (-needs-bank- #t)
(-action- 'fees)) (-action- 'fees))
@ -272,6 +274,12 @@
(print-member-source mr)) (print-member-source mr))
(else (else
(print "No member specified!")))) (print "No member specified!"))))
((blame-member-file)
(cond (mr
(newline)
(print-member-blame mr))
(else
(print "No member specified!"))))
((print-idstats) ((print-idstats)
(newline) (newline)
(print-members-ids-stats MB) (print-members-ids-stats MB)

View file

@ -31,6 +31,7 @@
( (
print-member-table print-member-table
print-member-source print-member-source
print-member-blame
member-records->string member-records->string
print-members-base-table print-members-base-table
print-members-base-stats print-members-base-stats
@ -165,6 +166,18 @@
#:context -1 #:context -1
))) )))
;; Nicely prints the member annotated source with any errors recorded.
(define (print-member-blame mr)
(let* ((lines (brmember-source mr))
(file-name (ldict-ref mr 'file-name))
(hls (ldict-ref mr 'highlights '())))
(print file-name ":")
(print-source-listing
lines
hls
#:context -1
)))
;; Prints nicely printed payments ;; Prints nicely printed payments
(define (member-payments->table mr) (define (member-payments->table mr)
(table->string (cons (table->string (cons