rem: scrolled = ScrollToMessage(nsMsgNavigationType.firstNew, true, false /* selectMessage */); 
add: if (pref.getBoolPref("mailnews.scroll_to_new_message")) scrolled = ScrollToMessage(nsMsgNavigationType.firstNew, true, false /* selectMessage */); 
context: function restorePreSearchView(){  var selectedHdr = null;  //save selection  try   {    selectedHdr = gDBView.hdrForFirstSelectedMessage;  }  catch (ex)  {}  //we might have to sort the view coming out of quick search  var sortType = gDBView.sortType;  var sortOrder = gDBView.sortOrder;  var viewFlags = gDBView.viewFlags;  var folder = gDBView.msgFolder;  gDBView.close();  gDBView = null;   if (gPreQuickSearchView)  {    gDBView = gPreQuickSearchView;    if (sortType != gDBView.sortType || sortOrder != gDBView.sortOrder)    {      gDBView.sort(sortType, sortOrder);    }    UpdateSortIndicators(sortType, sortOrder);    gPreQuickSearchView = null;      }  else //create default view type    CreateDBView(folder, nsMsgViewType.eShowAllThreads, viewFlags, sortType, sortOrder);  RerootThreadPane();     var scrolled = false;    // now restore selection  if (selectedHdr)  {    gDBView.selectMsgByKey(selectedHdr.messageKey);    var treeView = gDBView.QueryInterface(Components.interfaces.nsITreeView);    var selectedIndex = treeView.selection.currentIndex;    if (selectedIndex >= 0)     {      // scroll      EnsureRowInThreadTreeIsVisible(selectedIndex);      scrolled = true;    }    else      ClearMessagePane();  }  // NOTE,  // if you change the scrolling code below,  // double check the scrolling logic in  // msgMail3PaneWindow.js, "FolderLoaded" event code  if (!scrolled)  {    // if we didn't just scroll,     // scroll to the first new message    // but don't select it    scrolled = ScrollToMessage(nsMsgNavigationType.firstNew, true, false /* selectMessage */);    if (!scrolled)     {      // if we still haven't scrolled,      // scroll to the newest, which might be the top or the bottom      // depending on our sort order and sort type      if (sortOrder == nsMsgViewSortOrder.ascending)       {        switch (sortType)         {          case nsMsgViewSortType.byDate:           case nsMsgViewSortType.byId:           case nsMsgViewSortType.byThread:             scrolled = ScrollToMessage(nsMsgNavigationType.lastMessage, true, false /* selectMessage */);            break;        }      }      // if still we haven't scrolled,      // scroll to the top.      if (!scrolled)        EnsureRowInThreadTreeIsVisible(0);    }  }  // NOTE,  // if you change the scrolling code above,  // double check the scrolling logic in  // msgMail3PaneWindow.js, "FolderLoaded" event code}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/54d02bd9b43e8652b690d3818db7a888936b0846/searchBar.js/clean/mailnews/base/resources/content/searchBar.js