rem: var tagItemToRemove = gTagListBox.getSelectedItem(); var index = gTagListBox.selectedIndex; if (index >= 0) { var itemToRemove = gTagListBox.getItemAtIndex(index); var tagService = Components.classes["@mozilla.org/messenger/tagservice;1"] .getService(Components.interfaces.nsIMsgTagService); tagService.deleteKey(itemToRemove.value); gTagListBox.removeItemAt(index); var numItemsInListBox = gTagListBox.getRowCount(); gTagListBox.selectedIndex = index < numItemsInListBox ? index : numItemsInListBox - 1; } 
add:    var entry = gTagList.selectedItem; var key = entry.taginfo.key; if (key) gDeletedTags[key] = true;  var newFocusItem = gTagList.getNextItem(entry, 1) || gTagList.getPreviousItem(entry, 1); gTagList.removeItemAt(gTagList.getIndexOfItem(entry)); if (newFocusItem) FocusTagEntry(newFocusItem); else UpdateButtonStates(); 
context: function DeleteTag(){  var tagItemToRemove = gTagListBox.getSelectedItem();  var index = gTagListBox.selectedIndex;  if (index >= 0)  {    var itemToRemove = gTagListBox.getItemAtIndex(index);    var tagService = Components.classes["@mozilla.org/messenger/tagservice;1"]                               .getService(Components.interfaces.nsIMsgTagService);    tagService.deleteKey(itemToRemove.value);    gTagListBox.removeItemAt(index);    var numItemsInListBox = gTagListBox.getRowCount();    gTagListBox.selectedIndex = index < numItemsInListBox ? index : numItemsInListBox - 1;  }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/2be01086ab0b8459278b125c166f8455e43494ad/pref-labels.js/clean/mailnews/base/prefs/resources/content/pref-labels.js