[Gnucash-changes] Patch from Chris Shoemaker to make various spelling corrections and a

David Hampton hampton at cvs.gnucash.org
Fri Oct 14 00:19:56 EDT 2005


Log Message:
-----------
Patch from Chris Shoemaker to make various spelling corrections and a
couple of line wrap fixes.  Adds comments to mark thread unsafe code.
Adds various other documentation.

Tags:
----
gnucash-gnome2-dev

Modified Files:
--------------
    gnucash:
        ChangeLog
        GNOME2_STATUS
        HACKING
    gnucash/src/app-utils:
        config-var.scm
        gnc-component-manager.h
    gnucash/src/backend/file:
        gnc-schedxaction-xml-v2.c
    gnucash/src/backend/postgres:
        gncquery.c
    gnucash/src/business/business-utils:
        business-options.scm
    gnucash/src/doc:
        multicurrency-discussion.txt
    gnucash/src/engine:
        Query.h
        SX-book.c
        SchedXaction.c
        TransactionP.h
        gnc-numeric.h
        guid.c
        qofbook.h
        qofclass.c
        qofclass.h
        qofquery.c
        qofquery.h
        qofsession.c
    gnucash/src/experimental/cgi-bin:
        gnc-server.c
    gnucash/src/gnome:
        dialog-scheduledxaction.c
        dialog-sxsincelast.c
    gnucash/src/gnome-utils:
        dialog-utils.c
        gnc-amount-edit.c
        gnc-amount-edit.h
        gnc-date-format.c
        gnc-plugin-manager.h
        gnc-plugin.h
        gnc-tree-model-account.c
        gnc-tree-model.c
    gnucash/src/report/report-gnome:
        gw-report-gnome-spec.scm
        report-gnome.scm
    gnucash/src/report/report-system:
        html-document.scm
        html-table.scm
        report-utilities.scm
        report.scm

Revision Data
-------------
Index: ChangeLog
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/ChangeLog,v
retrieving revision 1.1487.2.333
retrieving revision 1.1487.2.334
diff -LChangeLog -LChangeLog -u -r1.1487.2.333 -r1.1487.2.334
--- ChangeLog
+++ ChangeLog
@@ -1,5 +1,66 @@
+2005-10-14  David Hampton  <hampton at employees.org>
+
+	* GNOME2_STATUS:
+	* HACKING:
+	* src/app-utils/config-var.scm:
+	* src/app-utils/gnc-component-manager.h:
+	* src/backend/file/gnc-schedxaction-xml-v2.c:
+	* src/backend/postgres/gncquery.c:
+	* src/business/business-utils/business-options.scm:
+	* src/doc/multicurrency-discussion.txt:
+	* src/engine/Query.h:
+	* src/engine/SX-book.c:
+	* src/engine/SchedXaction.c:
+	* src/engine/TransactionP.h:
+	* src/engine/gnc-numeric.h:
+	* src/engine/guid.c:
+	* src/engine/qofbook.h:
+	* src/engine/qofclass.c:
+	* src/engine/qofclass.h:
+	* src/engine/qofquery.c:
+	* src/engine/qofquery.h:
+	* src/engine/qofsession.c:
+	* src/experimental/cgi-bin/gnc-server.c:
+	* src/gnome/dialog-scheduledxaction.c:
+	* src/gnome/dialog-sxsincelast.c:
+	* src/gnome-utils/dialog-utils.c:
+	* src/gnome-utils/gnc-amount-edit.c:
+	* src/gnome-utils/gnc-amount-edit.h:
+	* src/gnome-utils/gnc-date-format.c:
+	* src/gnome-utils/gnc-plugin-manager.h:
+	* src/gnome-utils/gnc-plugin.h:
+	* src/gnome-utils/gnc-tree-model-account.c:
+	* src/gnome-utils/gnc-tree-model.c:
+	* src/report/report-gnome/gw-report-gnome-spec.scm:
+	* src/report/report-gnome/report-gnome.scm:
+	* src/report/report-system/html-document.scm:
+	* src/report/report-system/html-table.scm:
+	* src/report/report-system/report-utilities.scm:
+	* src/report/report-system/report.scm: Patch from Chris Shoemaker
+	to make various spelling corrections and a couple of line wrap
+	fixes.  Adds comments to mark thread unsafe code.  Adds various
+	other documentation.
+
+	* src/doc/design/engine.texinfo: Patch from Chris Shoemaker to
+	silence a texinfo warning.
+
 2005-10-13  David Hampton  <hampton at employees.org>
 
+	* src/app-utils/gnc-euro.c:
+	* src/app-utils/gnc-ui-util.h:
+	* src/gnome-utils/dialog-commodity.h:
+	* src/gnome-utils/gnc-currency-edit.c: Patch from Chris Shoemaker
+	to remove unneeded header files. Add a few comments.
+	
+	* src/backend/file/gnc-account-xml-v2.c:
+	* src/engine/qofbook.c:
+	* src/report/report-gnome/gnc-plugin-page-report.c: Minor code
+	simplification from Chris Shoemaker.  Some line wrap fixes and
+	comments.
+
+	* src/gnc-module/gnc-module.c: Minor code factoring patch from
+	Chris Shoemaker.
+
 	* src/gnome-utils/gnc-main-window.c: Patch from Chris Shoemaker to
 	avoid trying to double-add plugins to plugin manager by delaying
 	signal connection until the plugins are already managed by the
Index: HACKING
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/HACKING,v
retrieving revision 1.5.4.6
retrieving revision 1.5.4.7
diff -LHACKING -LHACKING -u -r1.5.4.6 -r1.5.4.7
--- HACKING
+++ HACKING
@@ -76,7 +76,7 @@
 
 To run gnucash from your build tree:
 -- edit ./src/bin/overrides/gnucash and replace gnucash-env with
-   gnucash-build-env
+   ./src/bin/overrides/gnucash-build-env
 -- then start gnucash by saying ./src/bin/overrides/gnucash
 -- Make sure you undo this change before installing gnucash
 
@@ -113,6 +113,10 @@
    [gdb output]
    gdb> run -e main -s ../libexec/overrides/gnucash --g-fatal-warning
 
+You'll also probably want to know about these:
+
+    % gdb> catch fork
+    % gdb> set follow-fork-mode child
 
 -----
 It may be the case that running GDB from within emacs doesn't work for you,
Index: GNOME2_STATUS
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/Attic/GNOME2_STATUS,v
retrieving revision 1.1.2.77
retrieving revision 1.1.2.78
diff -LGNOME2_STATUS -LGNOME2_STATUS -u -r1.1.2.77 -r1.1.2.78
--- GNOME2_STATUS
+++ GNOME2_STATUS
@@ -3,7 +3,7 @@
 Intro
 -----
 
-This is a ad-hoc list of list of what works and doesn't work in the g2
+This is a ad-hoc list of what works and doesn't work in the g2
 port of gnucash.  The plan is to finish porting those parts of gnucash
 that have already been started (i.e. new windowing system, account
 tree, commodities tree, etc.), but not to port any additional features
@@ -80,6 +80,8 @@
     - The main windows do not yet support saving position/size
       information.  (On my list - DRH)
 
+  - Open pages are no longer open after reopening file.
+
   - Weird pango_layout_set_text "string not UTF-8" issues reported by Neil Williams:
     
     - http://lists.gnucash.org/pipermail/gnucash-devel/2005-March/012797.html
@@ -171,24 +173,47 @@
   - HBCI - Transaction templates eventually need to be converted from a GTK_CLIST
     to a GTK_TREE_VIEW.  Currently working as a GtkClist. 
 
+
+- Notebook tabs
+
+  - When opening multiple report tabs, all reports get tab title of
+    first report. [FIXED]
+
+  - Account Tree tab title is unaffected by "Name of Account View" option.
+
+  - Also, changing that option doesn't affect dirty status of options
+    dialog. [ FIXED ]
+
+
 - Budgeting
 
-  - Can create/modify budgets via the Budgeting workbench. (Actions->Budgeting Workbench)
+  - Budget Report
+
+    - the default account selection isn't very reasonable, Inc & Exp
+      would be better
+
+    - sometimes negative numbers render on two lines in their table-cell
+
+  - Budget GUI
+
+    - default account filter doesn't take effect until options are
+      opened, should take effect as soon as view is opened
+
+    - it might be nice to disallow some of the more unusual recurrences
+
+    - better if budget list dialog allowed double click to open
+
+    - need help text
 
-  - Track budget tab still needs to be completed.  Should allow you to look
-    at predicted vs. actual information.
+    - should displaying zero values be optional?
 
-  - No save to file functionality.  Therefore budgets must currently be
-    created fresh each time gnucash is started.  First thing what I want to fix.
+    - it'd be nice if there was a summary column at the far right
 
-  - Should the budgeting workbench fit into the new windowing scheme better?
-    Currently it is its own window but maybe each workbench should be a tab
-    in the new layout.  How would this work with the sub-tabs?  Have to think
-    about this some more.
+  - Budget Engine
 
-    - The druid for 'New' is created underneath the Budget-list window.
+    - Do budgets play nice with QSF?
 
-  - Probably more TODO but these are the main points.
+    - Still a lot of dead legacy code hanging around
 
 - New Account Hierarchy - somewhat works
 
Index: gnc-schedxaction-xml-v2.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/backend/file/gnc-schedxaction-xml-v2.c,v
retrieving revision 1.18.4.6
retrieving revision 1.18.4.7
diff -Lsrc/backend/file/gnc-schedxaction-xml-v2.c -Lsrc/backend/file/gnc-schedxaction-xml-v2.c -u -r1.18.4.6 -r1.18.4.7
--- src/backend/file/gnc-schedxaction-xml-v2.c
+++ src/backend/file/gnc-schedxaction-xml-v2.c
@@ -645,6 +645,7 @@
                change re: storing template accounts. */
             /* Fix: get account with name of our GUID from the template
                accounts group.  Make that our template_acct pointer. */
+            /* THREAD-UNSAFE */
             id = guid_to_string( xaccSchedXactionGetGUID( sx ) );
             ag = gnc_book_get_template_group(book);
             if ( ag == NULL )
Index: gncquery.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/backend/postgres/gncquery.c,v
retrieving revision 1.29.4.6
retrieving revision 1.29.4.7
diff -Lsrc/backend/postgres/gncquery.c -Lsrc/backend/postgres/gncquery.c -u -r1.29.4.6 -r1.29.4.7
--- src/backend/postgres/gncquery.c
+++ src/backend/postgres/gncquery.c
@@ -549,6 +549,7 @@
             return g_strdup_printf(SQL_DBL_FMT, kvp_value_get_double(value));
 
         case KVP_TYPE_GUID:{
+            /* THREAD-UNSAFE */
             const char *guid = guid_to_string(kvp_value_get_guid(value));
             char *s = g_strdup_printf("'%s'", guid);
             return s;
Index: business-options.scm
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/business/business-utils/business-options.scm,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -Lsrc/business/business-utils/business-options.scm -Lsrc/business/business-utils/business-options.scm -u -r1.1.4.1 -r1.1.4.2
--- src/business/business-utils/business-options.scm
+++ src/business/business-utils/business-options.scm
@@ -58,7 +58,7 @@
                 (value-validator (convert-to-invoice invoice))))))
     (gnc:make-option
      section name sort-tag 'invoice documentation-string getter
-     (lambda (invoice)
+     (lambda (invoice) ;; setter
        (if (not invoice) (set! invoice (default-getter)))
        (set! invoice (convert-to-invoice invoice))
        (let* ((result (validator invoice))
Index: multicurrency-discussion.txt
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/doc/multicurrency-discussion.txt,v
retrieving revision 1.1.8.1
retrieving revision 1.1.8.2
diff -Lsrc/doc/multicurrency-discussion.txt -Lsrc/doc/multicurrency-discussion.txt -u -r1.1.8.1 -r1.1.8.2
--- src/doc/multicurrency-discussion.txt
+++ src/doc/multicurrency-discussion.txt
@@ -35,10 +35,6 @@
 
 <goonie> OK, cool, I think I can figure it out.
 
-<cstim> goonie: You will need to use a commodity-collector from report-utilities.scm
-
-<goonie> OK, cool, I think I can figure it out.
-
 <cstim> If you want the total of only one commodity, you can use the 'getpair action of commodity-collector...
  but if you want to show (correctly) all of the currencies, you will have a lot of trouble.
  Basically, I have the "reference implementation" in html-utilities.scm .
@@ -194,8 +190,6 @@
  We could \a gnc:split-get-share-amount => \a gnc:split-get-damount
  whatever. My point for the Beer is let's have some.
 
-<dres> beer doesn't need a point.  it just is.
-
 <cstim> oops. 
  I would expect that the transaction report uses \a gnc:split-get-share-amount
  which in this case gives you already the amounts exchanged into AUD and everything's fine.
Index: qofquery.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/qofquery.h,v
retrieving revision 1.5.2.8
retrieving revision 1.5.2.9
diff -Lsrc/engine/qofquery.h -Lsrc/engine/qofquery.h -u -r1.5.2.8 -r1.5.2.9
--- src/engine/qofquery.h
+++ src/engine/qofquery.h
@@ -155,10 +155,12 @@
  */
 void qof_query_search_for (QofQuery *query, QofIdTypeConst obj_type);
 
-/** Set the book to be searched.  Books contain/identify collections 
+/** Set the book to be searched.  Books contain/identify collections
  *  of objects; the search will be performed over those books
- *  specified with this function.  If no books are set, no results 
- *  will be returned (since there is nothing to search over).
+ *  specified with this function.  If no books are set, no results
+ *  will be returned (since there is nothing to search over). (CAS:
+ *  Apparently, if no books are set, you'll actually get a critical
+ *  assertion failure.)
  *
  *  You can search multiple books.  To specify multiple books, call 
  *  this function multiple times with different arguments.  
Index: qofquery.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/qofquery.c,v
retrieving revision 1.10.2.10
retrieving revision 1.10.2.11
diff -Lsrc/engine/qofquery.c -Lsrc/engine/qofquery.c -u -r1.10.2.10 -r1.10.2.11
--- src/engine/qofquery.c
+++ src/engine/qofquery.c
@@ -1700,6 +1700,7 @@
                        qof_query_printGuidMatch (pdata->options));
     for (node = pdata->guids; node; node = node->next)
     {
+        /* THREAD-UNSAFE */
       g_string_sprintfa (gs, ", guids: %s",
 			 guid_to_string ((GUID *) node->data));
     }
Index: qofsession.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/qofsession.c,v
retrieving revision 1.2.4.25
retrieving revision 1.2.4.26
diff -Lsrc/engine/qofsession.c -Lsrc/engine/qofsession.c -u -r1.2.4.25 -r1.2.4.26
--- src/engine/qofsession.c
+++ src/engine/qofsession.c
@@ -77,7 +77,7 @@
   GHook *hook;
 
   if (session_closed_hooks == NULL) {
-    session_closed_hooks = malloc(sizeof(GHookList));
+      session_closed_hooks = malloc(sizeof(GHookList)); /* LEAKED */
     g_hook_list_init (session_closed_hooks, sizeof(GHook));
   }
 
@@ -1083,6 +1083,7 @@
 		qof_book_set_backend (ob, NULL);
 		qof_book_destroy (ob);
 	}
+        /* Um, I think we're leaking the oldbooks list. */
 	
 	LEAVE ("sess = %p, book_id=%s", session, session->book_id
          ? session->book_id : "(null)");
@@ -1340,7 +1341,7 @@
   /* destroy the backend */
   qof_session_destroy_backend(session);
 
-  for (node=session->books; node; node=node->next)
+  for (node = session->books; node; node = node->next)
   {
     QofBook *book = node->data;
     qof_book_set_backend (book, NULL);
Index: Query.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/Query.h,v
retrieving revision 1.70.4.4
retrieving revision 1.70.4.5
diff -Lsrc/engine/Query.h -Lsrc/engine/Query.h -u -r1.70.4.4 -r1.70.4.5
--- src/engine/Query.h
+++ src/engine/Query.h
@@ -70,7 +70,7 @@
 
 /* After the query has been set up, call one of these to run the query. 
  *    XXX The routines below should be replaced by a query
- *    that explicitly asks for a list of the desied item.
+ *    that explicitly asks for a list of the desired item.
  *
  * The xaccQueryGetSplits() routine returns all splits matching the 
  *    query.  Any given split will appear at most once in the result;
Index: guid.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/guid.c,v
retrieving revision 1.25.4.10
retrieving revision 1.25.4.11
diff -Lsrc/engine/guid.c -Lsrc/engine/guid.c -u -r1.25.4.10 -r1.25.4.11
--- src/engine/guid.c
+++ src/engine/guid.c
@@ -108,6 +108,7 @@
     int i;
     char *tmp = "NULLGUID.EMPTY.";
 
+    /* 16th space for '\O' */
     for (i = 0; i < 16; i++)
       null_guid.data[i] = tmp[i];
 
Index: TransactionP.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/TransactionP.h,v
retrieving revision 1.57.4.3
retrieving revision 1.57.4.4
diff -Lsrc/engine/TransactionP.h -Lsrc/engine/TransactionP.h -u -r1.57.4.3 -r1.57.4.4
--- src/engine/TransactionP.h
+++ src/engine/TransactionP.h
@@ -76,7 +76,7 @@
  * accounts.  Thus, a single credit-card transaction might be split
  * between "dining", "tips" and "taxes" categories.
  *
- * A "split" is more commonly refered to as a "entry" in a "transaction".
+ * A "split" is more commonly referred to as an "entry" in a "transaction".
  */
 
 /* Flags for handling cap-gains status */
@@ -110,7 +110,7 @@
   char  * memo;
 
   /* The action field is an arbitrary user-assigned value.
-   * It is meant to be a very short (one to ten cahracter) string that
+   * It is meant to be a very short (one to ten character) string that
    * signifies the "type" of this split, such as e.g. Buy, Sell, Div,
    * Withdraw, Deposit, ATM, Check, etc. The idea is that this field
    * can be used to create custom reports or graphs of data.
Index: SchedXaction.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/SchedXaction.c,v
retrieving revision 1.41.4.7
retrieving revision 1.41.4.8
diff -Lsrc/engine/SchedXaction.c -Lsrc/engine/SchedXaction.c -u -r1.41.4.7 -r1.41.4.8
--- src/engine/SchedXaction.c
+++ src/engine/SchedXaction.c
@@ -65,7 +65,9 @@
 
    /* create a new template account for our splits */
    sx->template_acct = xaccMallocAccount(book);
-   xaccAccountSetName( sx->template_acct, guid_to_string( &sx->inst.entity.guid ));
+   /* THREAD-UNSAFE */
+   xaccAccountSetName( sx->template_acct,
+                       guid_to_string( &sx->inst.entity.guid ));
    xaccAccountSetCommodity
      (sx->template_acct,
       gnc_commodity_new( book,
Index: SX-book.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/SX-book.c,v
retrieving revision 1.7.4.4
retrieving revision 1.7.4.5
diff -Lsrc/engine/SX-book.c -Lsrc/engine/SX-book.c -u -r1.7.4.4 -r1.7.4.5
--- src/engine/SX-book.c
+++ src/engine/SX-book.c
@@ -68,7 +68,8 @@
 }
 
 void
-gnc_collection_set_template_group (QofCollection *col, AccountGroup *templateGroup)
+gnc_collection_set_template_group (QofCollection *col,
+                                   AccountGroup *templateGroup)
 {
   AccountGroup *old_grp;
   if (!col) return;
Index: qofclass.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/qofclass.h,v
retrieving revision 1.1.6.9
retrieving revision 1.1.6.10
diff -Lsrc/engine/qofclass.h -Lsrc/engine/qofclass.h -u -r1.1.6.9 -r1.1.6.10
--- src/engine/qofclass.h
+++ src/engine/qofclass.h
@@ -185,8 +185,8 @@
  *  controlling the object.   The getters are typically used by the
  *  query subsystem to query type specific data.   Note that there
  *  is no particular requirement for there to be a setter for every
- *  getter or even vice-versa, nor is there any requeirement for these
- *  to map 'cleanly' or orthogonaly to the underlying object.  The
+ *  getter or even vice-versa, nor is there any requirement for these
+ *  to map 'cleanly' or orthogonally to the underlying object.  The
  *  parameters are really just a set of value setting and getting 
  *  routines.
  *
Index: gnc-numeric.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/gnc-numeric.h,v
retrieving revision 1.8.6.4
retrieving revision 1.8.6.5
diff -Lsrc/engine/gnc-numeric.h -Lsrc/engine/gnc-numeric.h -u -r1.8.6.4 -r1.8.6.5
--- src/engine/gnc-numeric.h
+++ src/engine/gnc-numeric.h
@@ -118,7 +118,7 @@
 
     Valid values for denom are:
     GNC_DENOM_AUTO  -- compute denominator exactly
-    integer n       -- Force the denominator of teh result to be this integer
+    integer n       -- Force the denominator of the result to be this integer
     GNC_DENOM_RECIPROCAL -- Use 1/n as the denominator (???huh???)
 
     Valid values for 'how' are bitwise combinations of zero or one
@@ -264,7 +264,7 @@
 
 /** Values that can be passed as the 'denom' argument.  
  *  The include a positive number n to be used as the 
- *  denominator of teh output value.  Other possibilities 
+ *  denominator of the output value.  Other possibilities
  *  include the list below:
  */
 
Index: qofbook.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/qofbook.h,v
retrieving revision 1.5.2.9
retrieving revision 1.5.2.10
diff -Lsrc/engine/qofbook.h -Lsrc/engine/qofbook.h -u -r1.5.2.9 -r1.5.2.10
--- src/engine/qofbook.h
+++ src/engine/qofbook.h
@@ -130,7 +130,8 @@
  *  when the book is destroyed.  The argument to the callback will be 
  *  the book followed by the data pointer.
  */
-void qof_book_set_data_fin (QofBook *book, const char *key, gpointer data, QofBookFinalCB);
+void qof_book_set_data_fin (QofBook *book, const char *key, gpointer data,
+                            QofBookFinalCB);
 
 /** Retrieves arbitrary pointers to structs stored by qof_book_set_data. */
 gpointer qof_book_get_data (QofBook *book, const char *key);
Index: qofclass.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/qofclass.c,v
retrieving revision 1.1.6.7
retrieving revision 1.1.6.8
diff -Lsrc/engine/qofclass.c -Lsrc/engine/qofclass.c -u -r1.1.6.7 -r1.1.6.8
--- src/engine/qofclass.c
+++ src/engine/qofclass.c
@@ -70,7 +70,7 @@
     g_hash_table_insert (classTable, (char *)obj_name, ht);
   }
 
-  /* At least right now, we allow dummy, paramterless objects, 
+  /* At least right now, we allow dummy, parameterless objects,
    * for testing purposes.  Although I suppose that should be 
    * an error..  */
   /* Now insert all the parameters */
Index: dialog-sxsincelast.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome/dialog-sxsincelast.c,v
retrieving revision 1.65.4.13
retrieving revision 1.65.4.14
diff -Lsrc/gnome/dialog-sxsincelast.c -Lsrc/gnome/dialog-sxsincelast.c -u -r1.65.4.13 -r1.65.4.14
--- src/gnome/dialog-sxsincelast.c
+++ src/gnome/dialog-sxsincelast.c
@@ -2691,6 +2691,8 @@
         ag = gnc_book_get_template_group( gnc_get_current_book () );
         id = guid_to_string( xaccSchedXactionGetGUID(sx) );
         if ( ag && id ) {
+            /* This looks strange but it's right.  The account is
+               named after the guid string. */
                 acct = xaccGetAccountFromName( ag, id );
                 if ( acct ) {
                         createUD.tci = tci;
@@ -2738,6 +2740,7 @@
 
                 ag = gnc_book_get_template_group( gnc_get_current_book () );
                 id = guid_to_string( xaccSchedXactionGetGUID(sx) );
+                /* Get account named after guid string. */
                 acct = xaccGetAccountFromName( ag, id );
                 splitList = xaccAccountGetSplitList( acct );
         }
Index: dialog-scheduledxaction.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome/dialog-scheduledxaction.c,v
retrieving revision 1.71.2.18
retrieving revision 1.71.2.19
diff -Lsrc/gnome/dialog-scheduledxaction.c -Lsrc/gnome/dialog-scheduledxaction.c -u -r1.71.2.18 -r1.71.2.19
--- src/gnome/dialog-scheduledxaction.c
+++ src/gnome/dialog-scheduledxaction.c
@@ -1567,7 +1567,9 @@
                                                  "tempxaction_frame" ) );
 
 	/* Create the ledger */
-        sxed->sxGUIDstr = g_strdup( guid_to_string( xaccSchedXactionGetGUID(sxed->sx) ) );
+        /* THREAD-UNSAFE */
+        sxed->sxGUIDstr = g_strdup( guid_to_string(
+                                        xaccSchedXactionGetGUID(sxed->sx) ) );
         sxed->ledger = gnc_ledger_display_template_gl( sxed->sxGUIDstr );
         splitreg = gnc_ledger_display_get_split_register( sxed->ledger );
 
Index: config-var.scm
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/app-utils/config-var.scm,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -Lsrc/app-utils/config-var.scm -Lsrc/app-utils/config-var.scm -u -r1.1 -r1.1.6.1
--- src/app-utils/config-var.scm
+++ src/app-utils/config-var.scm
@@ -15,7 +15,7 @@
 ;; 59 Temple Place - Suite 330        Fax:    +1-617-542-2652
 ;; Boston, MA  02111-1307,  USA       gnu at gnu.org
 
-;;; config-var: You can create them, set values, find out of the value
+;;; config-var: You can create them, set values, find out if the value
 ;;; is different from the default, and you can get a description.  You
 ;;; can also specify an action function which will be called whenever
 ;;; the value is changed.  The action function receives the special
Index: gnc-component-manager.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/app-utils/gnc-component-manager.h,v
retrieving revision 1.5.4.2
retrieving revision 1.5.4.3
diff -Lsrc/app-utils/gnc-component-manager.h -Lsrc/app-utils/gnc-component-manager.h -u -r1.5.4.2 -r1.5.4.3
--- src/app-utils/gnc-component-manager.h
+++ src/app-utils/gnc-component-manager.h
@@ -178,8 +178,7 @@
  * component_id: id of component which is watching the entity
  * session:      the session this component is associated with
  */
-void
-gnc_gui_component_set_session (gint component_id, gpointer session);
+void gnc_gui_component_set_session (gint component_id, gpointer session);
 
 /* gnc_gui_component_watch_entity
  *   Add an entity to the list of those being watched by the component.
Index: gnc-server.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/experimental/cgi-bin/gnc-server.c,v
retrieving revision 1.5.4.1
retrieving revision 1.5.4.2
diff -Lsrc/experimental/cgi-bin/gnc-server.c -Lsrc/experimental/cgi-bin/gnc-server.c -u -r1.5.4.1 -r1.5.4.2
--- src/experimental/cgi-bin/gnc-server.c
+++ src/experimental/cgi-bin/gnc-server.c
@@ -120,7 +120,7 @@
   guid = g_new (GUID, 1);
   guid_new (guid);
   logged_in_users = g_list_prepend (logged_in_users, guid);
-  session_auth_string = guid_to_string (guid);
+  session_auth_string = guid_to_string (guid); /* THREAD UNSAFE */
   return session_auth_string;
 }
 
Index: gnc-amount-edit.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome-utils/gnc-amount-edit.c,v
retrieving revision 1.3.4.5
retrieving revision 1.3.4.6
diff -Lsrc/gnome-utils/gnc-amount-edit.c -Lsrc/gnome-utils/gnc-amount-edit.c -u -r1.3.4.5 -r1.3.4.6
--- src/gnome-utils/gnc-amount-edit.c
+++ src/gnome-utils/gnc-amount-edit.c
@@ -4,9 +4,9 @@
  * Copyright (C) 2000 Dave Peticolas <dave at krondo.com>
  * All rights reserved.
  *
- * Gnucash is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License
- * as published by the Free Software Foundation; either version 2 of the
+ * Gnucash is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 of the
  * License, or (at your option) any later version.
  *
  * Gnucash is distributed in the hope that it will be useful,
Index: gnc-date-format.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome-utils/gnc-date-format.c,v
retrieving revision 1.3.2.7
retrieving revision 1.3.2.8
diff -Lsrc/gnome-utils/gnc-date-format.c -Lsrc/gnome-utils/gnc-date-format.c -u -r1.3.2.7 -r1.3.2.8
--- src/gnome-utils/gnc-date-format.c
+++ src/gnome-utils/gnc-date-format.c
@@ -40,6 +40,7 @@
 #include "gnc-date-format.h"
 #include "dialog-utils.h"
 
+/* Perhaps it's better just to use MAX_DATE_LENGTH defined in gnc-date.h */
 #define MAX_DATE_LEN 80
 
 enum {
Index: gnc-tree-model-account.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome-utils/Attic/gnc-tree-model-account.c,v
retrieving revision 1.1.2.20
retrieving revision 1.1.2.21
diff -Lsrc/gnome-utils/gnc-tree-model-account.c -Lsrc/gnome-utils/gnc-tree-model-account.c -u -r1.1.2.20 -r1.1.2.21
--- src/gnome-utils/gnc-tree-model-account.c
+++ src/gnome-utils/gnc-tree-model-account.c
@@ -1409,7 +1409,7 @@
  *  has been deleted from the real model (which is the engine's
  *  account tree for us), but once the account has been deleted from
  *  the engine we have no way to determine the path to pass to
- *  row_deleted().  This is a PITA, but the only ither choice is to
+ *  row_deleted().  This is a PITA, but the only other choice is to
  *  have this model mirror the engine's accounts instead of
  *  referencing them directly.
  *
@@ -1419,7 +1419,7 @@
  *  cares about items of type "account".
  *
  *  @param event type The type of the event. This function only cares
- *  about items of type ADD, REMOVE, and DESTROY.
+ *  about items of type ADD, REMOVE, MODIFY, and DESTROY.
  *
  *  @param user_data A pointer to the account tree model.
  */
@@ -1458,7 +1458,8 @@
 	 case GNC_EVENT_ADD:
 	  /* Tell the filters/views where the new account was added. */
 	  DEBUG("add account %p (%s)", account, account_name);
-	  if (gnc_tree_model_account_get_iter_from_account (model, account, &iter)) {
+	  if (gnc_tree_model_account_get_iter_from_account (
+                  model, account, &iter)) {
 	    path = gtk_tree_model_get_path (GTK_TREE_MODEL(model), &iter);
 	    gtk_tree_model_row_inserted (GTK_TREE_MODEL(model), path, &iter);
 	    gnc_tree_model_account_path_changed (model, path);
Index: gnc-plugin.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome-utils/Attic/gnc-plugin.h,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -Lsrc/gnome-utils/gnc-plugin.h -Lsrc/gnome-utils/gnc-plugin.h -u -r1.1.2.3 -r1.1.2.4
--- src/gnome-utils/gnc-plugin.h
+++ src/gnome-utils/gnc-plugin.h
@@ -102,10 +102,13 @@
 	void (* gconf_notifications) (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data);
 
 	/* Virtual Table */
-	void (* add_to_window) (GncPlugin *plugin, GncMainWindow *window, GQuark type);
-	void (* remove_from_window) (GncPlugin *plugin, GncMainWindow *window, GQuark type);
+	void (* add_to_window)
+         (GncPlugin *plugin, GncMainWindow *window, GQuark type);
+	void (* remove_from_window)
+         (GncPlugin *plugin, GncMainWindow *window, GQuark type);
 
-	GncPluginPage *(* create_page) (GncPlugin *plugin, const gchar *uri);
+	GncPluginPage *(* create_page)
+         (GncPlugin *plugin, const gchar *uri);
 } GncPluginClass;
 
 /* function prototypes */
Index: gnc-tree-model.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome-utils/Attic/gnc-tree-model.c,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -Lsrc/gnome-utils/gnc-tree-model.c -Lsrc/gnome-utils/gnc-tree-model.c -u -r1.1.2.2 -r1.1.2.3
--- src/gnome-utils/gnc-tree-model.c
+++ src/gnome-utils/gnc-tree-model.c
@@ -78,6 +78,8 @@
     //  NULL
     //};
 
+    /* CAS: I think this should subclass GObject, not GtkObject. */
+
     gnc_tree_model_type = g_type_register_static (GTK_TYPE_OBJECT,
 						  GNC_TREE_MODEL_NAME,
 						  &our_info, 0);
Index: gnc-amount-edit.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome-utils/gnc-amount-edit.h,v
retrieving revision 1.3.4.2
retrieving revision 1.3.4.3
diff -Lsrc/gnome-utils/gnc-amount-edit.h -Lsrc/gnome-utils/gnc-amount-edit.h -u -r1.3.4.2 -r1.3.4.3
--- src/gnome-utils/gnc-amount-edit.h
+++ src/gnome-utils/gnc-amount-edit.h
@@ -4,10 +4,10 @@
  * Copyright (C) 2000 Dave Peticolas <dave at krondo.com>
  * All rights reserved.
  *
- * GnuCash is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
+ * GnuCash is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
  *
  * Gnucash is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
Index: gnc-plugin-manager.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome-utils/Attic/gnc-plugin-manager.h,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -Lsrc/gnome-utils/gnc-plugin-manager.h -Lsrc/gnome-utils/gnc-plugin-manager.h -u -r1.1.2.4 -r1.1.2.5
--- src/gnome-utils/gnc-plugin-manager.h
+++ src/gnome-utils/gnc-plugin-manager.h
@@ -78,8 +78,10 @@
 	GObjectClass object;
 
 	/* Signals */
-	void (* plugin_added) (GncPluginManager *plugin_manager, GncPlugin *plugin);
-	void (* plugin_removed) (GncPluginManager *plugin_manager, GncPlugin *plugin);
+	void (* plugin_added)
+         (GncPluginManager *plugin_manager, GncPlugin *plugin);
+	void (* plugin_removed)
+         (GncPluginManager *plugin_manager, GncPlugin *plugin);
 } GncPluginManagerClass;
 
 /** Retrieve the GType value for the gnucash plugin manager.
Index: dialog-utils.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome-utils/dialog-utils.c,v
retrieving revision 1.13.4.21
retrieving revision 1.13.4.22
diff -Lsrc/gnome-utils/dialog-utils.c -Lsrc/gnome-utils/dialog-utils.c -u -r1.13.4.21 -r1.13.4.22
--- src/gnome-utils/dialog-utils.c
+++ src/gnome-utils/dialog-utils.c
@@ -77,8 +77,8 @@
 }
 
 /********************************************************************\
- * gnc_ui_create_option_button                                      *
- *   create an option button given the option structure             *
+ * gnc_build_option_menu:                                           *
+ *   create an GTK "option menu" given the option structure         *
  *                                                                  *
  * Args: option_info - the option structure to use                  *
  *       num_options - the number of options                        *
@@ -869,9 +869,17 @@
   gtk_clist_columns_autosize (list);
 }
 
+/*   Glade Stuff
+ *
+ *
+ */
 
 static gboolean glade_inited = FALSE;
 
+/* gnc_glade_xml_new: a convenience wrapper for glade_xml_new
+ *   - takes care of glade initialization, if needed
+ *   - takes care of finding the directory for glade files
+ */
 GladeXML *
 gnc_glade_xml_new (const char *filename, const char *root)
 {
@@ -896,6 +904,9 @@
   return xml;
 }
 
+/* gnc_glade_lookup_widget:  Given a root (or at least ancestor) widget,
+ *   find the child widget with the given name.
+ */
 GtkWidget *
 gnc_glade_lookup_widget (GtkWidget *widget, const char *name)
 {
Index: gw-report-gnome-spec.scm
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/report/report-gnome/gw-report-gnome-spec.scm,v
retrieving revision 1.5.4.3
retrieving revision 1.5.4.4
diff -Lsrc/report/report-gnome/gw-report-gnome-spec.scm -Lsrc/report/report-gnome/gw-report-gnome-spec.scm -u -r1.5.4.3 -r1.5.4.4
--- src/report/report-gnome/gw-report-gnome-spec.scm
+++ src/report/report-gnome/gw-report-gnome-spec.scm
@@ -64,6 +64,9 @@
    '((<gw:int> report-id) (<gnc:MainWindow*> window))
    "Show report window")
 
+
+;; This is the function that's responsible for creating and returning
+;; the editor widget for a report's options.
   (gw:wrap-function
    ws
    'gnc:default-options-editor
Index: report-gnome.scm
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/report/report-gnome/report-gnome.scm,v
retrieving revision 1.9.4.8
retrieving revision 1.9.4.9
diff -Lsrc/report/report-gnome/report-gnome.scm -Lsrc/report/report-gnome/report-gnome.scm -u -r1.9.4.8 -r1.9.4.9
--- src/report/report-gnome/report-gnome.scm
+++ src/report/report-gnome/report-gnome.scm
@@ -22,11 +22,15 @@
 (export gnc:report-menu-setup)
 (export gnc:add-report-template-menu-items)
 
+;; returns a function that takes a list: (options, report),
+;; and returns a widget
 (define (gnc:report-options-editor report) 
   (if (equal? (gnc:report-type report) "Multicolumn View")
       gnc:column-view-edit-options
       gnc:default-options-editor))
 
+;; do not rely on the return value of this function - it has none.
+;; instead, this function's side-effect is to set the report's editor widget.
 (define (gnc:report-edit-options report) 
   (let* ((editor-widg (gnc:report-editor-widget report)))
     (if editor-widg
@@ -104,7 +108,7 @@
   (define tax-menu 
     (gnc:make-menu gnc:menuname-taxes (list gnc:menuname-reports)))
 
-  (gnc:warn "report-menu-setup")
+  (gnc:warn "report-menu-setup") ;; why do we do this?
 
   ;; (gnc:add-extension tax-menu)
   (gnc:add-extension income-expense-menu)
Index: html-table.scm
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/report/report-system/html-table.scm,v
retrieving revision 1.1.6.2
retrieving revision 1.1.6.3
diff -Lsrc/report/report-system/html-table.scm -Lsrc/report/report-system/html-table.scm -u -r1.1.6.2 -r1.1.6.3
--- src/report/report-system/html-table.scm
+++ src/report/report-system/html-table.scm
@@ -418,6 +418,8 @@
 	 )
     ))
 
+;; if the 4th arg is a cell, overwrite the existing cell,
+;; otherwise, append all remaining objects to the existing cell
 (define (gnc:html-table-set-cell! table row col . objects)
   (let ((rowdata #f)
 	(row-loc #f)
@@ -562,12 +564,15 @@
 ;; It would be nice to have table row/col/cell accessor functions in here.
 ;; It would also be nice to have table juxtaposition functions, too.
 ;; i.e., (gnc:html-table-nth-row table n)
+;;  [ CAS: how is that different from gnc:html-table-get-row ? ]
+
 ;;       (gnc:html-table-append-table-horizontal table add-table)
 ;; (An old merge-table used to exist inside balance-sheet.scm/GnuCash 1.8.9.)
 ;; Feel free to contribute! :-)
 ;; 
 
 ;; This function was moved here from balance-sheet.scm.
+;; This function "stacks" the two tables vertically.
 (define (gnc:html-table-merge t1 t2)
   (begin 
     (gnc:html-table-set-data! t1
Index: report-utilities.scm
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/report/report-system/report-utilities.scm,v
retrieving revision 1.18.4.4
retrieving revision 1.18.4.5
diff -Lsrc/report/report-system/report-utilities.scm -Lsrc/report/report-system/report-utilities.scm -u -r1.18.4.4 -r1.18.4.5
--- src/report/report-system/report-utilities.scm
+++ src/report/report-system/report-utilities.scm
@@ -336,15 +336,16 @@
 
 ;; A commodity collector. This is intended to handle multiple
 ;; currencies' amounts. The amounts are accumulated via 'add, the
-;; result can be fetched via 'format.  Used to work with strings as
-;; currencies and doubles as values, but now it uses <gnc:commodity*>
-;; as commodity and <gnc:numeric> as value. 
-;; Old Example: (define a (make-commodity-collector)) ... 
-;; (a 'add 'USD 12) ...  (a 'format (lambda(x y)(list x y)) #f) 
-;; used to give you something like 
-;; ((USD 123.4) (DEM 12.21) (FRF -23.32))
-;; But now USD is a <gnc:commodity*> and 123.4 a <gnc:numeric>, so
-;; there is no simple example anymore.
+;; result can be fetched via 'format.  This used to work with strings
+;; as currencies and doubles as values, but now it uses
+;; <gnc:commodity*> as commodity and <gnc:numeric> as value.
+;;
+;; Old Example: (define a (make-commodity-collector)) ...  (a 'add 'USD
+;; 12) ...  (a 'format (lambda(x y)(list x y)) #f) used to give you
+;; something like ((USD 123.4) (DEM 12.21) (FRF -23.32))
+;;
+;; New Example: But now USD is a <gnc:commodity*> and 123.4 a
+;; <gnc:numeric>, so there is no simple example anymore.
 ;;
 ;; The functions:
 ;;   'add <commodity> <amount>: Add the given amount to the 
@@ -456,9 +457,15 @@
 	('getmonetary (getmonetary commodity amount))
 	('list commoditylist) ; this one is only for internal use
 	(else (gnc:warn "bad commodity-collector action: " action))))))
+
+
 ;; Bah. Let's get back to normal data types -- this procedure thingy
 ;; from above makes every code almost unreadable. First step: replace
 ;; all 'action function calls by the normal functions below.
+
+;; CAS: ugh.  Having two usages is even *more* confusing, so let's
+;; please settle on one or the other.  What's Step 2?  How 'bout
+;; documenting the new functions?
 (define (gnc:commodity-collector-add collector commodity amount)
   (collector 'add commodity amount))
 (define (gnc:commodity-collector-merge collector other-collector)
Index: html-document.scm
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/report/report-system/html-document.scm,v
retrieving revision 1.3.4.1
retrieving revision 1.3.4.2
diff -Lsrc/report/report-system/html-document.scm -Lsrc/report/report-system/html-document.scm -u -r1.3.4.1 -r1.3.4.2
--- src/report/report-system/html-document.scm
+++ src/report/report-system/html-document.scm
@@ -106,6 +106,8 @@
     (do-list tree)
     retval))
 
+;; first optional argument is "headers?"
+;; returns the html document as a string, I think.
 (define (gnc:html-document-render doc . rest) 
   (let ((stylesheet (gnc:html-document-style-sheet doc))
         (headers? (if (null? rest) #f (if (car rest) #t #f))))
Index: report.scm
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/report/report-system/report.scm,v
retrieving revision 1.12.4.4
retrieving revision 1.12.4.5
diff -Lsrc/report/report-system/report.scm -Lsrc/report/report-system/report.scm -u -r1.12.4.4 -r1.12.4.5
--- src/report/report-system/report.scm
+++ src/report/report-system/report.scm
@@ -26,8 +26,8 @@
 ;; to generate the reports menu whenever a new window opens and to
 ;; figure out what to do when a report needs to be generated.
 ;;
-;; The key is the string naming the report and the value is the 
-;; report definition structure.
+;; The key is the string naming the report (the report "type") and the
+;; value is the report definition structure.
 (define *gnc:_report-templates_* (make-hash-table 23))
 
 ;; this is a hash of 'report ID' to instantiated report.  the 
@@ -47,6 +47,7 @@
 (define gnc:pagename-display (N_ "Display"))
 (define gnc:optname-reportname (N_ "Report name"))
 
+;; A <report-template> represents one of the available report types.
 (define <report-template>
   (make-record-type "<report-template>"
                     ;; The data items in a report record
@@ -55,6 +56,7 @@
                               renderer in-menu? menu-path menu-name
                               menu-tip export-types export-thunk)))
 
+;; if args is supplied, it is a list of field names and values
 (define (gnc:define-report . args)
   ;; For now the version is ignored, but in the future it'll let us
   ;; change behaviors without breaking older reports.
@@ -173,6 +175,7 @@
           (gnc:register-option options names)
           options))))
 
+;; A <report> represents an instantiation of a particular report type.
 (define <report>
   (make-record-type "<report>"
                     '(type id options dirty? needs-save? editor-widget ctext)))
@@ -221,12 +224,15 @@
 (define gnc:report-set-editor-widget!
   (record-modifier <report> 'editor-widget))
 
+;; ctext is for caching the rendered html
 (define gnc:report-ctext 
   (record-accessor <report> 'ctext))
 
 (define gnc:report-set-ctext!
   (record-modifier <report> 'ctext))
 
+;; gnc:make-report instantiates a report from a report-template.
+;; The actual report is stored away in a hash-table -- only the id is returned.
 (define (gnc:make-report template-name . rest)
   (let ((r ((record-constructor <report>) 
             template-name ;; type
@@ -272,6 +278,8 @@
         (gnc:report-template-new-options template)
         #f)))
 
+;; A convenience wrapper to get the report-template's export types from
+;; an instantiated report.
 (define (gnc:report-export-types report)
   (let ((template (hash-ref *gnc:_report-templates_* 
                             (gnc:report-type report))))
@@ -279,6 +287,8 @@
         (gnc:report-template-export-types template)
         #f)))
 
+;; A convenience wrapper to get the report-template's export thunk from
+;; an instantiated report.
 (define (gnc:report-export-thunk report)
   (let ((template (hash-ref *gnc:_report-templates_* 
                             (gnc:report-type report))))
@@ -393,30 +403,37 @@
 	     (open-file conf-file-name "a"))
     (force-output)))
 
+;; gets the renderer from the report template;
+;; gets the stylesheet from the report;
+;; renders the html doc and caches the resulting string;
+;; returns the html string.
 (define (gnc:report-render-html report headers?)
   (if (and (not (gnc:report-dirty? report))
            (gnc:report-ctext report))
       ;; if there's clean cached text, return it 
-      (begin 
-        (gnc:report-ctext report))
+      ;;(begin
+      (gnc:report-ctext report)
+      ;;  )
       
       ;; otherwise, rerun the report 
       (let ((template (hash-ref *gnc:_report-templates_* 
                                 (gnc:report-type report)))
 	    (doc #f))
         (set! doc (if template
-            (let* ((renderer (gnc:report-template-renderer template))
-                   (stylesheet (gnc:report-stylesheet report))
-                   (doc (renderer report))
-                   (html #f))
-              (gnc:html-document-set-style-sheet! doc stylesheet)
-              (set! html (gnc:html-document-render doc headers?))
-              (gnc:report-set-ctext! report html)
-              (gnc:report-set-dirty?! report #f)              
-              html)
-            #f))
-	doc)))
+                      (let* ((renderer (gnc:report-template-renderer template))
+                             (stylesheet (gnc:report-stylesheet report))
+                             (doc (renderer report))
+                             (html #f))
+                        (gnc:html-document-set-style-sheet! doc stylesheet)
+                        (set! html (gnc:html-document-render doc headers?))
+                        (gnc:report-set-ctext! report html) ;; cache the html
+                        (gnc:report-set-dirty?! report #f)  ;; mark it clean
+                        html)
+                      #f))
+	doc))) ;; YUK! inner doc is html-doc object; outer doc is a string.
 
+;; looks up the report by id and renders it with gnc:report-render-html
+;; marks the cursor busy during rendering; returns the html
 (define (gnc:report-run id)
   (let ((report (gnc:find-report id))
 	(start-time (gettimeofday))
@@ -435,6 +452,8 @@
     (gnc:unset-busy-cursor #f)
     html))
 
+
+;; "thunk" should take the report-type and the report template record
 (define (gnc:report-templates-for-each thunk)
   (hash-for-each (lambda (name template) (thunk name template))
                  *gnc:_report-templates_*))


More information about the gnucash-changes mailing list