gnucash maint: Multiple changes pushed

Christopher Lam clam at code.gnucash.org
Sat Nov 2 08:19:36 EDT 2019


Updated	 via  https://github.com/Gnucash/gnucash/commit/928f6145 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/e27338b0 (commit)
	from  https://github.com/Gnucash/gnucash/commit/b5ae8416 (commit)



commit 928f6145c77d6026fb1ffd700817ab785fcd7853
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Sat Nov 2 18:25:26 2019 +0800

    cleanup (list->vector (list ...))
    
    this is not an efficiency change, rather a readability change
    especially for hello-world which aims to introduce new users to reports.

diff --git a/gnucash/report/locale-specific/us/taxtxf-de_DE.scm b/gnucash/report/locale-specific/us/taxtxf-de_DE.scm
index 651785b4f..c9ff0b69f 100644
--- a/gnucash/report/locale-specific/us/taxtxf-de_DE.scm
+++ b/gnucash/report/locale-specific/us/taxtxf-de_DE.scm
@@ -152,33 +152,24 @@
     gnc:pagename-general (N_ "Alternate Period")
     "c" (N_ "Override or modify From: & To:.")
     (if after-tax-day 'from-to 'last-year)
-    (list (list->vector
-           (list 'from-to (N_ "Use From - To") (N_ "Use From - To period.")))
-          (list->vector
-           (list '1st-est (N_ "1st Est Tax Quarter") (N_ "Jan 1 - Mar 31.")))
-          (list->vector
-           (list '2nd-est (N_ "2nd Est Tax Quarter") (N_ "Apr 1 - May 31.")))
-          (list->vector
-	   ;; Translators: The US tax quarters are different from
-	   ;; actual year's quarters! See the definition of
-	   ;; tax-qtr-real-qtr-year variable above.
-           (list '3rd-est (N_ "3rd Est Tax Quarter") (N_ "Jun 1 - Aug 31.")))
-          (list->vector
-           (list '4th-est (N_ "4th Est Tax Quarter") (N_ "Sep 1 - Dec 31.")))
-          (list->vector
-           (list 'last-year (N_ "Last Year") (N_ "Last Year.")))
-          (list->vector
-           (list '1st-last (N_ "Last Yr 1st Est Tax Qtr")
-                 (N_ "Jan 1 - Mar 31, Last year.")))
-          (list->vector
-           (list '2nd-last (N_ "Last Yr 2nd Est Tax Qtr")
-                 (N_ "Apr 1 - May 31, Last year.")))
-          (list->vector
-           (list '3rd-last (N_ "Last Yr 3rd Est Tax Qtr")
-                 (N_ "Jun 1 - Aug 31, Last year.")))
-          (list->vector
-           (list '4th-last (N_ "Last Yr 4th Est Tax Qtr")
-                 (N_ "Sep 1 - Dec 31, Last year."))))))
+    (list (vector 'from-to (N_ "Use From - To") (N_ "Use From - To period."))
+          (vector '1st-est (N_ "1st Est Tax Quarter") (N_ "Jan 1 - Mar 31."))
+          (vector '2nd-est (N_ "2nd Est Tax Quarter") (N_ "Apr 1 - May 31."))
+          (vector '3rd-est (N_ "3rd Est Tax Quarter") (N_ "Jun 1 - Aug 31."))
+          (vector '4th-est (N_ "4th Est Tax Quarter") (N_ "Sep 1 - Dec 31."))
+          (vector 'last-year (N_ "Last Year") (N_ "Last Year."))
+          (vector '1st-last
+                  (N_ "Last Yr 1st Est Tax Qtr")
+                  (N_ "Jan 1 - Mar 31, Last year."))
+          (vector '2nd-last
+                  (N_ "Last Yr 2nd Est Tax Qtr")
+                  (N_ "Apr 1 - May 31, Last year."))
+          (vector '3rd-last
+                  (N_ "Last Yr 3rd Est Tax Qtr")
+                  (N_ "Jun 1 - Aug 31, Last year."))
+          (vector '4th-last
+                  (N_ "Last Yr 4th Est Tax Qtr")
+                  (N_ "Sep 1 - Dec 31, Last year.")))))
 
   (gnc:register-tax-option
    (gnc:make-account-list-option
diff --git a/gnucash/report/locale-specific/us/taxtxf.scm b/gnucash/report/locale-specific/us/taxtxf.scm
index 753e3b131..e09cdf9a6 100644
--- a/gnucash/report/locale-specific/us/taxtxf.scm
+++ b/gnucash/report/locale-specific/us/taxtxf.scm
@@ -180,36 +180,30 @@
     gnc:pagename-general (N_ "Alternate Period")
     "c" (N_ "Override or modify From: & To:.")
     (if after-tax-day 'from-to 'last-year)
-    (list (list->vector
-           (list 'from-to (N_ "Use From - To") (N_ "Use From - To period.")))
-          (list->vector
-           (list '1st-est (N_ "1st Est Tax Quarter") (N_ "Jan 1 - Mar 31.")))
-          (list->vector
-           (list '2nd-est (N_ "2nd Est Tax Quarter") (N_ "Apr 1 - May 31.")))
-          (list->vector
-	   ;; Translators: The US tax quarters are different from
-	   ;; actual year's quarters! See the definition of
-	   ;; tax-qtr-real-qtr-year variable above.
-           (list '3rd-est (N_ "3rd Est Tax Quarter") (N_ "Jun 1 - Aug 31.")))
-          (list->vector
-           (list '4th-est (N_ "4th Est Tax Quarter") (N_ "Sep 1 - Dec 31.")))
-          (list->vector
-           (list 'last-year (N_ "Last Year") (N_ "Last Year.")))
-          (list->vector
-           (list '1st-last (N_ "Last Yr 1st Est Tax Qtr")
-                 (N_ "Jan 1 - Mar 31, Last year.")))
-          (list->vector
-           (list '2nd-last (N_ "Last Yr 2nd Est Tax Qtr")
-                 (N_ "Apr 1 - May 31, Last year.")))
-          (list->vector
-           (list '3rd-last (N_ "Last Yr 3rd Est Tax Qtr")
-		 ;; Translators: The US tax quarters are different from
-		 ;; actual year's quarters! See the definition of
-		 ;; tax-qtr-real-qtr-year variable above.
-                 (N_ "Jun 1 - Aug 31, Last year.")))
-          (list->vector
-           (list '4th-last (N_ "Last Yr 4th Est Tax Qtr")
-                 (N_ "Sep 1 - Dec 31, Last year."))))))
+    (list (vector 'from-to (N_ "Use From - To") (N_ "Use From - To period."))
+          (vector '1st-est (N_ "1st Est Tax Quarter") (N_ "Jan 1 - Mar 31."))
+          (vector '2nd-est (N_ "2nd Est Tax Quarter") (N_ "Apr 1 - May 31."))
+          ;; Translators: The US tax quarters are different from
+          ;; actual year's quarters! See the definition of
+          ;; tax-qtr-real-qtr-year variable above.
+          (vector '3rd-est (N_ "3rd Est Tax Quarter") (N_ "Jun 1 - Aug 31."))
+          (vector '4th-est (N_ "4th Est Tax Quarter") (N_ "Sep 1 - Dec 31."))
+          (vector 'last-year (N_ "Last Year") (N_ "Last Year."))
+          (vector '1st-last
+                  (N_ "Last Yr 1st Est Tax Qtr")
+                  (N_ "Jan 1 - Mar 31, Last year."))
+          (vector '2nd-last
+                  (N_ "Last Yr 2nd Est Tax Qtr")
+                  (N_ "Apr 1 - May 31, Last year."))
+          (vector '3rd-last
+                  (N_ "Last Yr 3rd Est Tax Qtr")
+                  ;; Translators: The US tax quarters are different from
+                  ;; actual year's quarters! See the definition of
+                  ;; tax-qtr-real-qtr-year variable above.
+                  (N_ "Jun 1 - Aug 31, Last year."))
+          (vector '4th-last
+                  (N_ "Last Yr 4th Est Tax Qtr")
+                  (N_ "Sep 1 - Dec 31, Last year.")))))
 
   (gnc:register-tax-option
    (gnc:make-account-list-option
diff --git a/gnucash/report/report-system/options-utilities.scm b/gnucash/report/report-system/options-utilities.scm
index 43d8bbb25..2704a05ef 100644
--- a/gnucash/report/report-system/options-utilities.scm
+++ b/gnucash/report/report-system/options-utilities.scm
@@ -66,24 +66,14 @@
   (gnc:register-option 
    options  
    (gnc:make-multichoice-option
-    pagename name-display-depth
-    sort-tag 
-    help-string
-    default-depth
-    (list (list->vector
-	   (list 'all (N_ "All") (N_ "All accounts")))
-	  (list->vector
-	   (list 1 "1" (N_ "Top-level.")))
-	  (list->vector
-	   (list 2 "2" (N_ "Second-level.")))
-	  (list->vector
-	   (list 3 "3" (N_ "Third-level.")))
-	  (list->vector
-	   (list 4 "4" (N_ "Fourth-level.")))
-	  (list->vector
-	   (list 5 "5" (N_ "Fifth-level.")))
-	  (list->vector
-	   (list 6 "6" (N_ "Sixth-level.")))))))
+    pagename name-display-depth sort-tag help-string default-depth
+    (list (vector 'all (N_ "All") (N_ "All accounts"))
+	  (vector 1 "1" (N_ "Top-level."))
+	  (vector 2 "2" (N_ "Second-level."))
+	  (vector 3 "3" (N_ "Third-level."))
+	  (vector 4 "4" (N_ "Fourth-level."))
+	  (vector 5 "5" (N_ "Fifth-level."))
+	  (vector 6 "6" (N_ "Sixth-level."))))))
 
 ;; These help for selecting a bunch of accounts.
 (define (gnc:options-add-account-selection! 
diff --git a/gnucash/report/standard-reports/budget-barchart.scm b/gnucash/report/standard-reports/budget-barchart.scm
index e9f840929..aca3eac4c 100644
--- a/gnucash/report/standard-reports/budget-barchart.scm
+++ b/gnucash/report/standard-reports/budget-barchart.scm
@@ -102,21 +102,12 @@
         (N_ "This is a multi choice option.") ;; option help text
         'bars                                 ;; default selectioin
         (list
-          (list->vector
-            (list 'bars
+          (vector 'bars
                   (N_ "Barchart")
-                  (N_ "Show the report as a bar chart.")
-            )
-          )
-          (list->vector
-            (list 'lines
+                  (N_ "Show the report as a bar chart."))
+          (vector 'lines
                   (N_ "Linechart")
-                  (N_ "Show the report as a line chart.")
-            )
-          )
-        )
-      )
-    )
+                  (N_ "Show the report as a line chart.")))))
 
     (gnc:options-add-plot-size! 
      options gnc:pagename-display 
diff --git a/gnucash/report/utility-reports/hello-world.scm b/gnucash/report/utility-reports/hello-world.scm
index 182d72ca5..24a93e38f 100644
--- a/gnucash/report/utility-reports/hello-world.scm
+++ b/gnucash/report/utility-reports/hello-world.scm
@@ -65,22 +65,18 @@
      (gnc:make-multichoice-option
       (N_ "Hello, World!") (N_ "Multi Choice Option")
       "b" (N_ "This is a multi choice option.") 'third
-      (list (list->vector
-             (list 'first
-                   (N_ "First Option")
-                   (N_ "Help for first option.")))
-            (list->vector
-             (list 'second
-                   (N_ "Second Option")
-                   (N_ "Help for second option.")))
-            (list->vector
-             (list 'third
-                   (N_ "Third Option")
-                   (N_ "Help for third option.")))
-            (list->vector
-             (list 'fourth
-                   (N_ "Fourth Options")
-                   (N_ "The fourth option rules!"))))))
+      (list (vector 'first
+                    (N_ "First Option")
+                    (N_ "Help for first option."))
+            (vector 'second
+                    (N_ "Second Option")
+                    (N_ "Help for second option."))
+            (vector 'third
+                    (N_ "Third Option")
+                    (N_ "Help for third option."))
+            (vector 'fourth
+                    (N_ "Fourth Options")
+                    (N_ "The fourth option rules!")))))
     
     ;; This is a string option. Users can type anything they want
     ;; as a value. The default value is "Hello, World". This is
@@ -196,19 +192,16 @@
      (gnc:make-list-option
       (N_ "Hello Again") (N_ "A list option")
       "h" (N_ "This is a list option.")
-      (list 'good)
-      (list (list->vector
-             (list 'good
+      'good
+      (list (vector 'good
                    (N_ "The Good")
-                   (N_ "Good option.")))
-            (list->vector
-             (list 'bad
+                   (N_ "Good option."))
+            (vector 'bad
                    (N_ "The Bad")
-                   (N_ "Bad option.")))
-            (list->vector
-             (list 'ugly
+                   (N_ "Bad option."))
+            (vector 'ugly
                    (N_ "The Ugly")
-                   (N_ "Ugly option."))))))
+                   (N_ "Ugly option.")))))
     
     ;; This option is for testing. When true, the report generates
     ;; an exception.

commit e27338b004d9dc4f1cb501bdec6755a1048af37a
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Sat Nov 2 18:25:44 2019 +0800

    [html-utilities] more deprecations
    
    * gnc:html-table-append-ruler/at! was flawed - the empty-cell defined
    as '() would lead to invalid html-table element. it was never used
    because colskip was always 0. inline and deprecate function.

diff --git a/gnucash/report/report-system/html-utilities.scm b/gnucash/report/report-system/html-utilities.scm
index 5f9ab1ebb..805cfeca6 100644
--- a/gnucash/report/report-system/html-utilities.scm
+++ b/gnucash/report/report-system/html-utilities.scm
@@ -132,6 +132,8 @@
 ;; colspan at, optionally, the specified column.
 (define (gnc:html-table-append-ruler/at! table colskip colspan)
   (define empty-cell '())
+  (issue-deprecation-warning
+   "gnc:html-table-append-ruler/at! is deprecated.")
   (gnc:html-table-append-row! 
    table
    (append (make-list colskip empty-cell)
@@ -141,6 +143,8 @@
      
 (define (gnc:html-table-append-ruler/at/markup! table markup colskip colspan)
   (define empty-cell "")
+  (issue-deprecation-warning
+   "gnc:html-table-append-ruler/at/markup! is deprecated.")
   (gnc:html-table-append-row/markup! 
    table
    markup
@@ -150,7 +154,9 @@
       1 colspan (gnc:make-html-text (gnc:html-markup-hr)))))))
 
 (define (gnc:html-table-append-ruler! table colspan)
-  (gnc:html-table-append-ruler/at! table 0 colspan))
+  (gnc:html-table-append-row!
+   table (list (gnc:make-html-table-cell/size
+                1 colspan (gnc:make-html-text (gnc:html-markup-hr))))))
 
 (define (gnc:html-table-append-ruler/markup! table markup colspan)
   (issue-deprecation-warning



Summary of changes:
 gnucash/report/locale-specific/us/taxtxf-de_DE.scm | 45 ++++++++----------
 gnucash/report/locale-specific/us/taxtxf.scm       | 54 ++++++++++------------
 gnucash/report/report-system/html-utilities.scm    |  8 +++-
 gnucash/report/report-system/options-utilities.scm | 26 ++++-------
 .../report/standard-reports/budget-barchart.scm    | 17 ++-----
 gnucash/report/utility-reports/hello-world.scm     | 45 ++++++++----------
 6 files changed, 80 insertions(+), 115 deletions(-)



More information about the gnucash-changes mailing list