Delete a message without opening another message

From MozillaZine Knowledge Base
Jump to navigationJump to search
This article was written for Thunderbird but also applies to Mozilla Suite / SeaMonkey (though some menu sequences may differ).

Thunderbird will normally open the next message if you delete the message that you are reading. This is due to it selecting the next message as a sideffect of deleting the current message. If you don't like this behavior there are several workarounds.

Recommended

Install the Deselect on Delete add-on.

Version independent

Don't select the message you want to delete. Instead, right click on the message in the folder listing, and select "delete message" from the context menu. This doesn't work if you are configured to preview messages (you enabled the optional message pane in View -> Layout).

Remap the Delete key using the KeyConfig add-on

  • Install the Keyconfig add-on and restart Thunderbird.
  • Select Tools -> KeyConfig, and at the bottom of the Keyconfig dialog, press the button "Add a new key"
  • Name the key something like DelUp (whatever you want to call it).
  • Copy and paste the following code sample where you see the comment /*CODE*/:
   goDoCommand('cmd_delete');goDoCommand('cmd_previousMsg');
  • Press OK to close the Key editor.
  • Go to the field at the bottom of the Keyconfig dialog, and press whatever key (for example the Del key) you want to use as the shortcut. If you want to use Alt+Del as the shortcut do not type the characters A l t + Del, hold down the Alt key and press the Del key instead.
  • Press the Apply button, then the Close button.
  • Restart Thunderbird.

Obsolete

Install the MailTweak add-on, enable the "Deletion behavior" tweak, and configure it to do "nothing" after a message is deleted. MailTweak doesn't support version 3.1 or later so you need to install the add-ons compatibility reporter add-on beforehand to disable version checking, in order to install it. Ignore the warning message in the add-ons manager about MailTweak not being compatible, its just complaining that you are ignoring the add-ons maximum supported version field.

These extensions don't support Thunderbird 3.x and appear to use an API call that was removed in 3.0 so even if you disabled version checking (in order to install them) they wouldn't work.

  • Install the After Delete add-on. It lets you specify what happens after you delete a message such as selecting the previous, next or no message. You may need to set mail.delete_matches_sort_order true using the config editor. However, it may not work if you're configured a IMAP account to mark a message as deleted (rather than moving it to trash) when deleting a message.
  • Install the Unselect Message extension. That will change the behavior of the delete button (and delete key) both in the folder listing, and when reading a message in a window.
  • Add the "Delete!" button to your toolbar from the Buttons! extension. Use it to delete the message.

See also

External Links

  • Bug report about "Close message window on delete" does not work when messages are opened in tabs
  • Bug report requesting a preference not to select next/previous message on message delete