rem: if (gMsgCompose) gMsgCompose.CloseWindow(false); else window.close(); 
add: MsgComposeCloseWindow(false); 
context: function ComposeLoad(){  // First get the preferences service  try {    var prefService = Components.classes["@mozilla.org/preferences-service;1"]                              .getService(Components.interfaces.nsIPrefService);    sPrefs = prefService.getBranch(null);    sPrefBranchInternal = sPrefs.QueryInterface(Components.interfaces.nsIPrefBranch2);  }  catch (ex) {    dump("failed to preferences services\n");  }  try {    sOther_headers = sPrefs.getCharPref("mail.compose.other.header");  }  catch (ex) {    dump("failed to get the mail.compose.other.header pref\n");  }  try {    sAccountManagerDataSource = Components.classes["@mozilla.org/rdf/datasource;1?name=msgaccountmanager"].getService(Components.interfaces.nsIRDFDataSource);    sRDF = Components.classes['@mozilla.org/rdf/rdf-service;1'].getService(Components.interfaces.nsIRDFService);    sNameProperty = sRDF.GetResource("http://home.netscape.com/NC-rdf#Name?sort=true");  }  catch (ex) {    dump("failed to get RDF\n");  }  AddMessageComposeOfflineObserver();  AddDirectoryServerObserver(true);  if (gLogComposePerformance)    sMsgComposeService.TimeStamp("Start initializing the compose window (ComposeLoad)", false);  try {    SetupCommandUpdateHandlers();    var wizardcallback = true;    var state = verifyAccounts(wizardcallback); // this will do migration, or create a new account if we need to.    if (sOther_headers) {      var selectNode = document.getElementById('addressCol1#1');      var sOther_headers_Array = sOther_headers.split(",");      for (var i = 0; i < sOther_headers_Array.length; i++)        selectNode.appendItem(sOther_headers_Array[i] + ":", "addr_other");    }    if (state)      ComposeStartup(false, null);  }  catch (ex) {    dump("EX: = " + ex + "\n");    var errorTitle = sComposeMsgsBundle.getString("initErrorDlogTitle");    var errorMsg = sComposeMsgsBundle.getFormattedString("initErrorDlogMessage",                                                         [""]);    if (gPromptService)      gPromptService.alert(window, errorTitle, errorMsg);    else      window.alert(errorMsg);    if (gMsgCompose)      gMsgCompose.CloseWindow(false); //Don't try to recycle a bogus window    else      window.close();    return;  }  window.tryToClose=ComposeCanClose;  if (gLogComposePerformance)    sMsgComposeService.TimeStamp("Done with the initialization (ComposeLoad). Waiting on editor to load about:blank", false);}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/9421/cc7cd89ee26253b8eb7cb274fe1efb3909a53035/MsgComposeCommands.js/buggy/mailnews/compose/resources/content/MsgComposeCommands.js