mirror of
https://github.com/Gnucash/gnucash.git
synced 2024-11-28 03:34:05 -06:00
utilities.scm: centralize and modernize addto!
(define-macro) is discouraged in most scheme forms. Change to (define-syntax), and centralize common macro to utilities.scm
This commit is contained in:
parent
4a27285edd
commit
dda6730c44
@ -97,9 +97,6 @@
|
||||
|
||||
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(define-macro (addto! alist element)
|
||||
`(set! ,alist (cons ,element ,alist)))
|
||||
|
||||
(define (set-last-row-style! table tag . rest)
|
||||
(let ((arg-list
|
||||
(cons table
|
||||
|
@ -33,14 +33,12 @@
|
||||
(use-modules (srfi srfi-1))
|
||||
(use-modules (gnucash gnc-module))
|
||||
(use-modules (gnucash gettext))
|
||||
(use-modules (gnucash utilities))
|
||||
|
||||
(gnc:module-load "gnucash/report/report-system" 0)
|
||||
(use-modules (gnucash report standard-reports))
|
||||
(use-modules (gnucash report business-reports))
|
||||
|
||||
(define-macro (addto! alist element)
|
||||
`(set! ,alist (cons ,element ,alist)))
|
||||
|
||||
(define (set-last-row-style! table tag . rest)
|
||||
(let ((arg-list
|
||||
(cons table
|
||||
|
@ -51,14 +51,12 @@
|
||||
(use-modules (srfi srfi-1))
|
||||
(use-modules (gnucash gnc-module))
|
||||
(use-modules (gnucash gettext))
|
||||
(use-modules (gnucash utilities))
|
||||
|
||||
(gnc:module-load "gnucash/report/report-system" 0)
|
||||
(use-modules (gnucash report standard-reports))
|
||||
(use-modules (gnucash report business-reports))
|
||||
|
||||
(define-macro (addto! alist element)
|
||||
`(set! ,alist (cons ,element ,alist)))
|
||||
|
||||
(define (set-last-row-style! table tag . rest)
|
||||
(let ((arg-list
|
||||
(cons table
|
||||
|
@ -27,14 +27,12 @@
|
||||
(use-modules (srfi srfi-1))
|
||||
(use-modules (gnucash gnc-module))
|
||||
(use-modules (gnucash gettext))
|
||||
(use-modules (gnucash utilities))
|
||||
|
||||
(gnc:module-load "gnucash/report/report-system" 0)
|
||||
(use-modules (gnucash report standard-reports))
|
||||
(use-modules (gnucash report business-reports))
|
||||
|
||||
(define-macro (addto! alist element)
|
||||
`(set! ,alist (cons ,element ,alist)))
|
||||
|
||||
(define (set-last-row-style! table tag . rest)
|
||||
(let ((arg-list
|
||||
(cons table
|
||||
|
@ -46,9 +46,6 @@
|
||||
(define desc-header (N_ "Description"))
|
||||
(define amount-header (N_ "Amount"))
|
||||
|
||||
(define-macro (addto! alist element)
|
||||
`(set! ,alist (cons ,element ,alist)))
|
||||
|
||||
(define (set-last-row-style! table tag . rest)
|
||||
(let ((arg-list
|
||||
(cons table
|
||||
|
@ -117,9 +117,6 @@
|
||||
(else
|
||||
(_ "Vendor"))))
|
||||
|
||||
(define-macro (addto! alist element)
|
||||
`(set! ,alist (cons ,element ,alist)))
|
||||
|
||||
(define (set-last-row-style! table tag . rest)
|
||||
(let ((arg-list
|
||||
(cons table
|
||||
|
@ -22,6 +22,8 @@
|
||||
;; Boston, MA 02110-1301, USA gnu@gnu.org
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(use-modules (gnucash utilities))
|
||||
|
||||
;; returns a list with n #f (empty cell) values
|
||||
(define (gnc:html-make-empty-cell) #f)
|
||||
(define (gnc:html-make-empty-cells n)
|
||||
@ -854,7 +856,7 @@
|
||||
(disp value))))
|
||||
(if (not (or (equal? default-value value)
|
||||
(char=? (string-ref section 0) #\_)))
|
||||
(set! render-list (cons retval render-list)))))
|
||||
(addto! render-list retval))))
|
||||
(gnc:options-for-each add-option-if-changed options)
|
||||
(if plaintext?
|
||||
(string-append
|
||||
|
@ -29,9 +29,6 @@
|
||||
|
||||
(gnc:module-load "gnucash/report/report-system" 0)
|
||||
|
||||
(define-macro (addto! alist element)
|
||||
`(set! ,alist (cons ,element ,alist)))
|
||||
|
||||
(define (set-last-row-style! table tag . rest)
|
||||
(let ((arg-list
|
||||
(cons table
|
||||
|
@ -40,7 +40,7 @@
|
||||
|
||||
(define-module (gnucash report standard-reports transaction))
|
||||
|
||||
(use-modules (gnucash utilities))
|
||||
(use-modules (gnucash utilities))
|
||||
(use-modules (srfi srfi-1))
|
||||
(use-modules (srfi srfi-11))
|
||||
(use-modules (srfi srfi-13))
|
||||
@ -50,9 +50,6 @@
|
||||
|
||||
(gnc:module-load "gnucash/report/report-system" 0)
|
||||
|
||||
(define-macro (addto! alist element)
|
||||
`(set! ,alist (cons ,element ,alist)))
|
||||
|
||||
;; Define the strings here to avoid typos and make changes easier.
|
||||
(define reportname (N_ "Transaction Report"))
|
||||
|
||||
|
@ -42,6 +42,7 @@
|
||||
(export gnc:error)
|
||||
(export gnc:msg)
|
||||
(export gnc:debug)
|
||||
(export addto!)
|
||||
|
||||
;; Do this stuff very early -- but other than that, don't add any
|
||||
;; executable code until the end of the file if you can help it.
|
||||
@ -71,6 +72,10 @@
|
||||
(define (gnc:debug . items)
|
||||
(gnc-scm-log-debug (strify items)))
|
||||
|
||||
(define-syntax addto!
|
||||
(syntax-rules ()
|
||||
((addto! alist element)
|
||||
(set! alist (cons element alist)))))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; gnc:substring-replace
|
||||
|
Loading…
Reference in New Issue
Block a user