Index: subscriptions.admin.inc
===================================================================
--- subscriptions.admin.inc	(revision 280)
+++ subscriptions.admin.inc	(working copy)
@@ -2,7 +2,8 @@
 // $Id: subscriptions.admin.inc,v 1.1.2.15 2008/02/21 22:27:39 chx Exp $
 
 /**
- * Admin settings
+ * Site Settings form at admin/settings/subscriptions.
+ * Other submodules contribute additional parts to this form.
  */
 function subscriptions_settings_form() {
   $form['sub_settings'] = array(
@@ -36,6 +37,9 @@
 /*  user screens: display, edit functions                  */
 /* ******************************************************* */
 
+/**
+ * Theme subscriptions page controls table.
+ */
 function theme_subscriptions_form_table($element) {
   $output = '';
   $rows = array();
@@ -81,6 +85,9 @@
 }
 
 
+/**
+ * Subscriptions page submit handler.
+ */
 function subscriptions_page_form_submit($form_id, $form_values) {
   global $user;
   if (isset($form_values['roles'])) {
@@ -131,7 +138,7 @@
 }
 
 /**
- * displays subscribed content data on user and subscription pages
+ * Display subscribed content data on the user and site subscriptions pages.
  * @ TODO clean up all of these parts
  */
 function subscriptions_page($account, $stype) {
@@ -190,6 +197,14 @@
   return theme('box', '', $output); // . theme('xml_icon', url("subscriptions/feed"));
 }
 
+/**
+ * Construct the overview page, which displays a summary of subscriptions per
+ * type as well as the user settings at user/UID/subscriptions.
+ * This form is also used for admin/settings/subscriptions/userdefaults.
+ * 
+ * @params $account
+ *   Must be a valid user account from user_load() or NULL (for the admin form).
+ */
 function subscriptions_page_user_overview($account) {
   // Build summary
   $uid = (isset($account) ? $account->uid : -DRUPAL_AUTHENTICATED_RID);
@@ -228,6 +243,13 @@
   return $output;
 }
 
+/**
+ * Returns the form definition for the settings part of the overview page.
+ * This subform is also used for admin/settings/subscriptions/userdefaults.
+ * 
+ * @params $account
+ *   Must be a valid user account from user_load() or NULL (for the admin form).
+ */
 function subscriptions_user_settings_form($account)
 {
   $uid = (isset($account) ? $account->uid : -DRUPAL_AUTHENTICATED_RID);
@@ -357,6 +379,9 @@
   return $form;
 }
 
+/**
+ * User settings subform submit handler.
+ */
 function subscriptions_user_settings_form_submit($form_id, $form_values) {
   if ($form_values['op'] == $form_values['reset']) {
     if (($uid = arg(1))> 0) {
@@ -395,6 +420,14 @@
   }
 }
 
+/**
+ * Provide the form definition for admin/settings/subscriptions/intervals.
+ *
+ * Called by _subscriptions_menu() in subscriptions.module.
+ * 
+ * @ingroup forms
+ * @see _subscriptions_menu()
+ */
 function subscriptions_intervals() {
   $default = '';
   foreach (_subscriptions_send_intervals() as $interval => $text) {
@@ -413,6 +446,9 @@
   return $form;
 }
 
+/**
+ * Sending intervals settings form submit handler.
+ */
 function subscriptions_intervals_submit($form_id, $form_values) {
   $intervals = array();
   foreach (explode("\n", $form_values['intervals']) as $line) {
@@ -424,6 +460,22 @@
   variable_set('subscriptions_send_intervals', $intervals);
 }
 
+/**
+ * Provide the form definition for adding subscriptions via 
+ * subscriptions/add/... link.
+ *
+ * Callback of _subscriptions_menu() in subscriptions.module.
+ * 
+ * @param $stype
+ *   Subscription type.
+ * @param $sid
+ *   Subscription ID.
+ * @param $author_uid
+ *   User ID for author-specific subscriptions or -1 for all authors.
+ * 
+ * @ingroup forms
+ * @see _subscriptions_menu()
+ */
 function subscriptions_add_form($stype, $sid, $author_uid = NULL) {
   global $user;
   $form['sid'] = array('#type' => 'value', '#value' => $sid);
@@ -456,6 +508,9 @@
   return $form;
 }
 
+/**
+ * Add Subscription form submit handler.
+ */
 function subscriptions_add_form_submit($form_id, $form_values) {
   if ($a = module_invoke_all('subscriptions', 'stype', $form_values['stype'], $form_values['sid'], (isset($form_values['author_uid']) ? $form_values['author_uid'] : -1))) {
     list($module, $field, $value, $author_uid) = $a;
@@ -468,7 +523,7 @@
 }
 
 /**
- * List of send intervals
+ * Returns a list of send intervals.
  */
 function _subscriptions_send_intervals() {
   return variable_get('subscriptions_send_intervals',
@@ -482,6 +537,10 @@
   );
 }
 
+/**
+ * Helper function for the submodules to build the table(s) on their
+ * user/UID/subscriptions/... pages.
+ */
 function subscriptions_form_helper(&$form, &$defaults, $author_uid, $key, $title, $subscription) {
   static $intervals;
   if (!isset($intervals)) {
@@ -520,6 +579,10 @@
   }
 }
 
+/**
+ * Helper function for the submodules to hide invisible or empty
+ * columns from their page form table(s).
+ */
 function subscriptions_form_column_filter(&$form_table, $uid)
 {
   foreach (array('send_interval', 'send_comments', 'send_updates', 'author') as $key) {
Index: subscriptions.install
===================================================================
--- subscriptions.install	(revision 280)
+++ subscriptions.install	(working copy)
@@ -1,6 +1,9 @@
 <?php
 // $Id: subscriptions.install,v 1.3.2.1.2.15 2008/02/21 22:27:39 chx Exp $
 
+/**
+ * Implementation of hook_install().
+ */
 function subscriptions_install() {
   switch ($GLOBALS['db_type']) {
     case 'mysql':
@@ -124,6 +127,9 @@
   _subscriptions_install_information();	
 }
 
+/**
+ * User information message at installation and pre-2.0 upgrade time.
+ */
 function _subscriptions_install_information()	
 {
   $t = get_t();
@@ -138,6 +144,9 @@
                      
 }
 
+/**
+ * Implementation of hook_uninstall().
+ */
 function subscriptions_uninstall() {
   if (db_table_exists('subscriptions')) {
     db_query("DROP TABLE {subscriptions}");
@@ -165,7 +174,10 @@
   }
 }
 
-function subscriptions_update_1() {  // first incarnation of 5.x-2.0
+/**
+ * Database update function 1 for first incarnation of 5.x-2.0.
+ */
+function subscriptions_update_1() {
   $ret = array();
 
   switch ($GLOBALS['db_type']) {
@@ -195,14 +207,20 @@
   return $ret;
 }
 
-function subscriptions_update_2() {  // first incarnation of 5.x-2.0
+/**
+ * Database update dummy function 2, left-over from first incarnation of 5.x-2.0.
+ */
+function subscriptions_update_2() {
 
   // intentionally left empty
 
   return array();
 }
 
-function subscriptions_update_3() {  // 5.x-2.0 rewrite
+/**
+ * Database update function 3 for 5.x-2.0 rewrite.
+ */
+function subscriptions_update_3() {
   $ret = array();
   $t = get_t();
 
@@ -369,7 +387,10 @@
   return $ret;
 }
 
-function subscriptions_update_4() {  // 5.x-2.0 rewrite
+/**
+ * Database update function 4 for 5.x-2.0 rewrite.
+ */
+function subscriptions_update_4() {
   $ret = array();
   switch ($GLOBALS['db_type']) {
     case 'mysql':
@@ -391,7 +412,10 @@
   return $ret;
 }
 
-function subscriptions_update_5() {  // 5.x-2.0 rewrite
+/**
+ * Database update function 5 for 5.x-2.0 rewrite.
+ */
+function subscriptions_update_5() {
   $ret = array();
   switch ($GLOBALS['db_type']) {
     case 'mysql':
@@ -413,7 +437,10 @@
   return $ret;
 }
 
-function subscriptions_update_6() {  // 5.x-2.0 rewrite
+/**
+ * Database update function 6 for 5.x-2.0 rewrite.
+ */
+function subscriptions_update_6() {
   $ret = array();
   switch ($GLOBALS['db_type']) {
     case 'mysql':
@@ -434,7 +461,10 @@
   return $ret;
 }
 
-function subscriptions_update_7() {  // 5.x-2.0 rewrite
+/**
+ * Database update function 6 for 5.x-2.0 rewrite.
+ */
+function subscriptions_update_7() {
   // Multi-part update to move subscriptions_auto and subscriptions_sendself from {users} to {subscriptions_user}
   if (!isset($_SESSION['subscriptions_update_7'])) {
     $_SESSION['subscriptions_update_7'] = 0;
Index: subscriptions.module
===================================================================
--- subscriptions.module	(revision 280)
+++ subscriptions.module	(working copy)
@@ -104,7 +104,7 @@
 }
 
 /**
- * Implementation of hook_perms()
+ * Implementation of hook_perms().
  */
 function subscriptions_perm() {
   return array_merge(array('administer user subscriptions', 'subscribe to all content types'), subscriptions_types('access'));
@@ -144,7 +144,7 @@
 }
 
 /**
- * Menu callback add subscription
+ * Helper function to do access checking and create a subscription.
  */
 function subscriptions_write($access_key, $module, $field, $value, $author_uid = -1, $recipient = NULL, $send_interval = 1, $send_updates = 0, $send_comments = 0) {
   global $user;
@@ -261,7 +261,9 @@
     @db_query("INSERT INTO {subscriptions} (module, field, value, author_uid, recipient_uid, send_interval, send_updates, send_comments)  VALUES ('%s', '%s', '%s', %d, %d, %d, %d, %d)", $module, $field, $value, $author_uid, $recipient_uid, $send_interval, $send_updates, $send_comments);
   }
 }
-
+/**
+ * Returns Delete form based on the given parameters.
+ */
 function subscriptions_delete_form($module, $field, $value, $author_uid, $recipient_uid) {
   $form['data'] = array('#type' => 'value', '#value' => array($module, $field, $value, $author_uid, $recipient_uid));
   return confirm_form($form, t('Are you sure you want to unsubscribe?'), '<front>', NULL, t('Unsubscribe'));
@@ -273,8 +275,8 @@
 }
 
 /**
- * Subscribes users to content they post, if not already subscribed
- * (context: on_post, on_update, on_comment)
+ * Subscribe users to content they post, if not already subscribed
+ * (context: on_post, on_update, on_comment).
  */
 function subscriptions_autosubscribe($module, $field, $value, $context) {
   global $user;
@@ -285,12 +287,12 @@
 }
 
 /**
- * Get subscriptions
+ * Get subscriptions.
  *
  * @param $params
- *   Array of parameters for the query
+ *   Array of parameters for the query.
  * @return
- *   Array of subscriptions indexed by uid, module, field, value, author_uid
+ *   Array of subscriptions indexed by uid, module, field, value, author_uid.
  */
 function subscriptions_get($params) {
   // Build query
@@ -312,7 +314,7 @@
 }
 
 /**
- * Get info about subscrition types
+ * Hook subscription_types(). Get info about subscription types.
  *
  * @return
  *   Information for a given field and type
@@ -341,7 +343,7 @@
 }
 
 /**
- * User menu
+ * Given a base url, returns the user menu definition for given user account.
  */
 function _subscriptions_menu($account, $base) {
   global $user;
Index: subscriptions_blog_ui.module
===================================================================
--- subscriptions_blog_ui.module	(revision 280)
+++ subscriptions_blog_ui.module	(working copy)
@@ -19,6 +19,17 @@
   }
 }
 
+/**
+ * Implementation of hook_types(), subhook of hook_subscriptions().
+ * 
+ * This is called by subscriptions_types() in subscriptions.module.
+ * 
+ * @return
+ *   Returns information about types for the Subscriptions module interface.
+ * 
+ * @ingroup forms
+ * @see subscriptions_types()
+ */
 function _subscriptions_blog_ui_types() {
   $tr = 't';
   $types['blog'] = array(
@@ -74,7 +85,7 @@
 }
 
 /**
- * Returns the blog subscription form
+ * Returns the blog subscription form.
  */
 function subscriptions_blog_ui_blog_form($blogs, $account, $form) {
   $uid = (isset($account) ? $account->uid : (is_numeric(arg(5)) ? -arg(5) : -DRUPAL_AUTHENTICATED_RID));
Index: subscriptions_content.install
===================================================================
--- subscriptions_content.install	(revision 253)
+++ subscriptions_content.install	(working copy)
@@ -1,6 +1,9 @@
 <?php
 // $Id: subscriptions_content.install,v 1.1.2.2 2008/02/02 01:47:35 chx Exp $
 
+/**
+ * Implementation of hook_install().
+ */
 function subscriptions_content_install() {
   // subscriptions_content.module needs to be heavier than taxonomy.module --
   // otherwise term_node record has not been written when subscriptions_queue() is called!
Index: subscriptions_content.module
===================================================================
--- subscriptions_content.module	(revision 280)
+++ subscriptions_content.module	(working copy)
@@ -4,6 +4,13 @@
 /**
  * @file
  * Subscriptions to content events
+ * 
+ * Subscriptions_content extends the Subscriptions module to allow users to
+ * subscribe by content type. If a user subscribes to a content he will receive
+ * notifications each time a node is published. 
+ * Subscriptions_content also provides the ability to subscribe to comments and
+ * updates of nodes by content type or by other kinds of subscriptions (defined
+ * by other Subscriptions submodules).
  */
 
 /**
@@ -64,6 +71,14 @@
   }
 }
 
+/**
+ * Implementation of hook_node_options(), subhook of hook_subscriptions().
+ * 
+ * This is called by subscriptions_ui_node_form() in subscriptions_ui.module.
+ * 
+ * @ingroup forms
+ * @see subscriptions_ui_node_form()
+ */
 function _subscriptions_content_node_options($account, $node) {
   // Default node, field are the first three indexes, but they can be overridden in params
   // Thread
@@ -102,6 +117,9 @@
   return $options;
 }
 
+/**
+ * Implementation of hook_access(), subhook of hook_subscriptions().
+ */
 function _subscriptions_content_access($load_function, $load_args, $node) {
   ///global $user;  /// keep this for remote debugging
   if (($load_function == 'subscriptions_content_node_load' || ($load_function == 'subscriptions_content_comment_load' && $node->_comments)) &&
@@ -114,6 +132,17 @@
 }
 
 
+/**
+ * Implementation of hook_types(), subhook of hook_subscriptions().
+ * 
+ * This is called by subscriptions_types() in subscriptions.module.
+ * 
+ * @return
+ *   Returns information about types for Subscriptions module interface.
+ * 
+ * @ingroup forms
+ * @see subscriptions_types()
+ */
 function _subscriptions_content_types() {
   $tr = 't';
   $types['node'] = array(
@@ -137,6 +166,8 @@
 
 /**
  * Implementation of hook_nodeapi().
+ *
+ * Catch node inserts and updates and sends them to the subscriptions queue.
  */
 function subscriptions_content_nodeapi(&$node, $op, $arg = 0) {
   global $user;
@@ -188,6 +219,8 @@
 
 /**
  * Implementation of hook_comment().
+ *
+ * Catch comment inserts and updates and sends them to the subscriptions queue.
  */
 function subscriptions_content_comment($comment, $op) {
   global $user;
@@ -215,6 +248,12 @@
 
 /**
  * Implementation of hook_form_alter()
+ *
+ * Add
+ *   - the Content Settings part to admin/settings/subscriptions,
+ *   - additional fields to the node and digest Mail Editor forms, and
+ *   - the Send Subscriptions Notifications checkbox to the Publishing Options
+ *     fieldset on the node edit form.
  */
 function subscriptions_content_form_alter($form_id, &$form) {
   global $user;
@@ -444,6 +483,20 @@
   }
 }
 
+/**
+ * Fill given array of mailvars with given node values.
+ * 
+ * Callback of function _subscriptions_content_node_mailvars().
+ * 
+ * @param $mailvars
+ *   Array of mailvars to be full-filled.
+ * @param $node
+ *   Node object used to fill $mailvars.
+ * @param $field
+ *   Internall used for filling variable !term_name.
+ * @param $s
+ *   Subscription object.
+ */
 function _subscriptions_content_node_mailvars(&$mailvars, $node, $field, $s) {
   include_once drupal_get_path('module', 'subscriptions_mail') .'/subscriptions_mail.templates.inc';
   
@@ -481,6 +534,9 @@
   }
 }
 
+/**
+ * Convert text with formatting into plain text.
+ */
 function _subscriptions_content_format_text($text, $format) {
   static $have_HTML_to_text;
   if (!isset($have_HTML_to_text)) {
@@ -498,6 +554,10 @@
   return trim($text);
 }
 
+/**
+ * Given a comment template returns a formatted text of comments for given
+ * node.
+ */
 function _subscriptions_content_format_comments($node, $comment_template, $separator) {
   $comments = array();
   foreach ($node->_comments as $comment) {
@@ -515,12 +575,25 @@
   return implode($separator, $comments);
 }
 
-
+/**
+ * Custom function for loading nodes.
+ * Loads not only the node but also any attached comments that are in the queue.
+ * 
+ * Function name stored in {subscriptions_queue}.load_func and called by 
+ * subscriptions_mail().
+ * 
+ * @param $nid
+ *   Node ID.
+ * @param $sqid
+ *   Subscriptions queue ID.
+ * @param $is_new
+ *   TRUE if this is a new-node notification.
+ * 
+ * @return node as array().
+ */
 function subscriptions_content_node_load($nid, $sqid, $is_new) {
   // Do not cache because for different users the node can be different,
   //  subscriptions_mail_cron caches per uid.
-  //return node_load($nid, NULL, TRUE);
-  // Load not only the node but also any attached comments that are in the queue.
   $node = _subscriptions_content_load($nid, 0);
   if ($is_new) {
     $node->_is_new = TRUE;
@@ -530,6 +603,19 @@
   return $node;
 }
 
+/**
+ * Custom function for loading comments.
+ * 
+ * Function name stored in {subscriptions_queue}.load_func and called by 
+ * subscriptions_mail().
+ * 
+ * @param $cid
+ *   Comment ID.
+ * @param $sqid
+ *   Subscriptions queue ID.
+ * 
+ * @return node as array().
+ */
 function subscriptions_content_comment_load($cid, $sqid) {
   $nid = db_result(db_query('SELECT nid FROM {comments} WHERE cid = %d', $cid));
   $item = db_fetch_array(db_query('SELECT * from {subscriptions_queue} where sqid = %d', $sqid));
@@ -544,6 +630,10 @@
   return $node;
 }
 
+/**
+ * Returns a node if published, including any comments that are still queued, but
+ * limited by the given subscriptions queue ID.
+ */
 function _subscriptions_content_load($nid, $comment_load_sqid) {
   global $user;
   static $nodes = array();
@@ -600,6 +690,9 @@
   return $mailkeys;
 }
 
+/**
+ * Custom submit handler for mail_edit_form().
+ */
 function subscriptions_content_mail_edit_submit($form_id, $form_values) {
   include_once drupal_get_path('module', 'subscriptions_mail') .'/subscriptions_mail.templates.inc';
 
@@ -620,14 +713,14 @@
 }
 
 /**
- * Subscriptions page callback: List thread subscriptions
+ * Subscriptions page callback: List thread subscriptions.
  */
 function subscriptions_content_page_node($account, $form) {
   return drupal_get_form('subscriptions_content_node_form', $account, $form);
 }
 
 /**
- * return node subscriptions form
+ * Build the Thread subscriptions form at user/UID/subscriptions/node.
  */
 function subscriptions_content_node_form($account, $form) {
   $uid = $account->uid;
@@ -689,11 +782,16 @@
   return $form;
 }
 
+/**
+ * Subscriptions page callback: List content types subscriptions.
+ */
 function subscriptions_content_page_type($account, $form) {
   return drupal_get_form('subscriptions_content_type_form', $account, $form);
 }
 
-// return content type subscriptions form
+/**
+ * Build the Content Types subscriptions form at user/UID/subscriptions/type.
+ */
 function subscriptions_content_type_form($account, $form) {
   $uid = (isset($account) ? $account->uid : (is_numeric(arg(5)) ? -arg(5) : -DRUPAL_AUTHENTICATED_RID));
   $unlisteds = variable_get('subscriptions_unlisted_content_types', array());
@@ -766,9 +864,9 @@
 }
 
 /*
- * Implementation of hook_cron()
+ * Implementation of hook_cron().
  * 
- * Ensure that we're heavier than taxonomy.module.
+ * Ensure that we're heavier than the taxonomy.module.
  */
 function subscriptions_content_cron() {
   $result = db_query("SELECT name, weight FROM {system} WHERE name IN ('taxonomy', 'subscriptions_content') AND type = 'module'");
@@ -781,7 +879,9 @@
 }
 
 /*
- * Implementation of hook_disable()
+ * Implementation of hook_disable().
+ *
+ * Remove our queue items.
  */
 function subscriptions_content_disable() {
   db_query("DELETE FROM {subscriptions_queue} WHERE load_function LIKE 'subscriptions_content_%'");
Index: subscriptions_mail.module
===================================================================
--- subscriptions_mail.module	(revision 280)
+++ subscriptions_mail.module	(working copy)
@@ -1,6 +1,16 @@
 <?php
 // $Id: subscriptions_mail.module,v 1.1.2.10 2008/02/21 22:45:46 chx Exp $s
 
+/**
+ * @file
+ * Subscriptions module mail gateway.
+ */
+
+/**
+ * Implementation of hook_cron().
+ *
+ * Takes items from {subscriptions_queue} and generates notification emails.
+ */
 function subscriptions_mail_cron() {
   global $user;
   include_once drupal_get_path('module', 'subscriptions_mail') .'/subscriptions_mail.templates.inc';
@@ -147,6 +157,9 @@
   }
 }
 
+/**
+ * Send the notification by mail.
+ */
 function _subscriptions_mail_send($mailkey, $name, $to, $subject, $body, $from, $uid) {
   $mail_success = drupal_mail($mailkey, $to, $subject, $body, $from);
   $watchdog_params = array('@name' => $name, '@to' => "<$to>");
@@ -164,6 +177,9 @@
   }
 }
 
+/**
+ * Assemble mail variables.
+ */
 function subscriptions_mail_mail_edit_variables(&$variables, $mailkey = NULL) {
   static $stored_variables;
   if (!isset($variables)) {
@@ -189,7 +205,7 @@
 }
 
 /**
- * preprocess a mail template(subject or body), detecting conditional clauses
+ * Preprocess a mail template (subject or body), detecting conditional clauses
  * that conform to a prescribed syntax
  *
  * @param string $template
Index: subscriptions_mail.templates.inc
===================================================================
--- subscriptions_mail.templates.inc	(revision 253)
+++ subscriptions_mail.templates.inc	(working copy)
@@ -1,6 +1,10 @@
 <?php
 // $Id: subscriptions_mail.templates.inc,v 1.1.2.2 2008/02/02 01:47:35 chx Exp $
 
+/**
+ * @file
+ * Subscriptions module mail templates constants.
+ */
 define('SUBSCRIPTIONS_DEFAULT_SEPARATOR', "| --------------------------------------------------------------------\n");
 
 define('SUBSCRIPTIONS_DEFAULT_SUBJECT', t('[!site] !subs_type subscription for !name: !title'));
Index: subscriptions_taxonomy.module
===================================================================
--- subscriptions_taxonomy.module	(revision 280)
+++ subscriptions_taxonomy.module	(working copy)
@@ -3,7 +3,13 @@
 
 /**
  * @file
- * Subscriptions to content events
+ * Subscriptions to taxonomy terms.
+ * 
+ * Subscriptions_taxonomy extends the subscription module to allow users to
+ * subscribe by taxonomy term. If a user subscribes to a term he will receive
+ * notifications each time a node is published to that taxonomy term. The user
+ * can also select to receive notifications when such a node is updated or
+ * commented.
  */
 
 /**
@@ -55,6 +61,14 @@
    }
 }
 
+/**
+ * Implementation of hook_node_options(), subhook of hook_subscriptions().
+ * 
+ * This is called by subscriptions_ui_node_form() in subscriptions_ui.module.
+ * 
+ * @ingroup forms
+ * @see subscriptions_ui_node_form()
+ */
 function _subscriptions_taxonomy_node_options($account, $node) {
   if (!isset($node->taxonomy) || !is_array($node->taxonomy)) {
     return;
@@ -81,6 +95,17 @@
   return $options;
 }
 
+/**
+ * Implementation of hook_types(), subhook of hook_subscriptions().
+ * 
+ * This is called by subscriptions_types() in subscriptions.module.
+ * 
+ * @return
+ *   Returns information about types for Subscriptions module interface.
+ * 
+ * @ingroup forms
+ * @see subscriptions_types()
+ */
 function _subscriptions_taxonomy_types() {
   $tr = 't';
   $types['taxa'] = array(
@@ -94,6 +119,11 @@
   t('subscribe to taxonomy terms');
 }
 
+/**
+ * Implementation of hook_form_alter().
+ *
+ * Adds the Taxonomy Settings part to admin/settings/subscriptions.
+ */
 function subscriptions_taxonomy_form_alter($form_id, &$form) {
   global $user;
   $tr = 't';
@@ -142,7 +172,7 @@
 }
 
 /**
- * Returns a list of taxonomy subscriptions
+ * Returns a list of taxonomy subscriptions.
  */
 function subscriptions_taxonomy_page_taxa($account, $form) {
   // traverse the taxonomy tree
@@ -162,7 +192,7 @@
 }
 
 /**
- * Returns the taxonomy subscription form
+ * Build the Categories subscription form at user/UID/subscriptions/taxa.
  */
 function subscriptions_taxonomy_taxa_form($vocabularies, $account, $form) {
   $uid = (isset($account) ? $account->uid : (is_numeric(arg(5)) ? -arg(5) : -DRUPAL_AUTHENTICATED_RID));
@@ -261,7 +291,9 @@
 }
 
 /*
- * Implementation of hook_disable()
+ * Implementation of hook_disable().
+ *
+ * Remove our queue items.
  */
 function subscriptions_taxonomy_disable() {
   db_query("DELETE FROM {subscriptions_queue} WHERE module = 'node' AND field = 'tid'");
Index: subscriptions_ui.module
===================================================================
--- subscriptions_ui.module	(revision 280)
+++ subscriptions_ui.module	(working copy)
@@ -1,6 +1,12 @@
 <?php
 // $Id: subscriptions_ui.module,v 1.1.2.7 2008/02/21 22:27:39 chx Exp $
 
+/**
+ * Implementation of hook_nodeapi().
+ *
+ * Inject the node subform into node pages (depending on the Display Settings).
+ */
+
 function subscriptions_ui_nodeapi(&$node, $op, $teaser) {
   global $user;
   if ($user->uid && $op == 'view' && $node->nid && !$teaser &&
@@ -20,6 +26,11 @@
   }
 }
 
+/**
+ * Implementation of hook_block().
+ *
+ * Define the Subscriptions Interface block for node pages (depending on the Display Settings).
+ */
 function subscriptions_ui_block($op = 'list', $delta = 0) {
   switch ($op) {
     case 'list':
@@ -38,7 +49,12 @@
   }
 }
 
-function subscriptions_ui_link($type, $node = NULL, $teaser = NULL)
+/**
+ * Implementation of hook_link().
+ *
+ * Add a Subscribe link to node pages (depending on the Display Settings).
+ */
+function subscriptions_ui_link($type, $node, $teaser)
 {
   if ($type == 'node' && empty($teaser) && variable_get('subscriptions_form_link_only', 0) && arg(2) != 'subscribe' && 
       !_subscriptions_ui_node_is_blocked($node->nid)) {
@@ -54,6 +70,16 @@
   return strpos('  '. variable_get('subscriptions_blocked_nodes', '') .' ', ' '. $nid .' ');
 }
 
+/**
+ * Returns the form definition for the node subform.
+ * 
+ * @param $node
+ *   Must be a valid node object.
+ * @param $account
+ *   If not given, will be populated with current user (either anonymous).
+ * 
+ * @ingroup forms
+ */
 function subscriptions_ui_node_form($node, $account = NULL) {
   global $user;
   if (!isset($account)) {
@@ -167,6 +193,9 @@
   return $form;
 }
 
+/**
+ * Theme subscriptions node subform table.
+ */
 function theme_subscriptions_ui_table($element) {
   $rows = array();
   $headers = array();
@@ -192,6 +221,9 @@
   return $output;
 }
 
+/**
+ * Node subscriptions node subform submit handler.
+ */
 function subscriptions_ui_node_form_submit($form_id, $form_values) {
 
   $recipient_uid = $form_values['account']->uid;
@@ -213,6 +245,11 @@
   return array(str_replace('/subscribe', '', $_GET['q']), NULL, (variable_get('subscriptions_form_link_only', 0) ? 'subscriptions' : NULL));
 }
 
+/**
+ * Implementation of hook form_alter().
+ *
+ * Adds the Display Settings part to the admin/settings/subscriptions form.
+ */
 function subscriptions_ui_form_alter($form_id, &$form) {
   global $user;
   $tr = 't';
