8c908f948b09826c6cb4452ee5b282aca41be85e
galt
  Tue Dec 8 21:52:59 2015 -0800
Multi-region (exonMostly). This work allows people to look at virtual chromosomes from a list of regions and then navigate and perform all of the usual functions on it.

diff --git src/hg/hgTracks/rmskTrack.c src/hg/hgTracks/rmskTrack.c
index ff48913..65ed288 100644
--- src/hg/hgTracks/rmskTrack.c
+++ src/hg/hgTracks/rmskTrack.c
@@ -13,46 +13,51 @@
 
 
 /* Repeat items.  Since there are so many of these, to avoid 
  * memory problems we don't query the database and store the results
  * during repeatLoad, but rather query the database during the
  * actual drawing. */
 
 static struct repeatItem *otherRepeatItem = NULL;
 static char *repeatClassNames[] =  {
     "SINE", "LINE", "LTR", "DNA", "Simple", "Low Complexity", "Satellite", "RNA", "Other", "Unknown", 
 };
 static char *repeatClasses[] = {
     "SINE", "LINE", "LTR", "DNA", "Simple_repeat", "Low_complexity", "Satellite", "RNA", "Other", "Unknown", 
 };
 
+static struct repeatItem *riList = NULL;  // can be re-used by all windows
+
 static struct repeatItem *makeRepeatItems()
 /* Make the stereotypical repeat masker tracks. */
 {
-struct repeatItem *ri, *riList = NULL;
+if (!riList)
+    {
+    struct repeatItem *ri;
     int i;
     int numClasses = ArraySize(repeatClasses);
     for (i=0; i<numClasses; ++i)
 	{
 	AllocVar(ri);
 	ri->class = repeatClasses[i];
 	ri->className = repeatClassNames[i];
 	slAddHead(&riList, ri);
 	if (sameString(repeatClassNames[i], "Other"))
 	    otherRepeatItem = ri;               
 	}
     slReverse(&riList);
+    }
 return riList;
 }
 
 static void repeatLoad(struct track *tg)
 /* Load up repeat tracks.  (Will query database during drawing for a change.) */
 {
 tg->items = makeRepeatItems();
 }
 
 static void repeatFree(struct track *tg)
 /* Free up repeatMasker items. */
 {
 slFreeList(&tg->items);
 }