I'm afraid my question's gonna look like a rant, but I'm really curious how such terrible setting have got created.
According to this answer, any customizations that you make are stored in your home directory, in ~/.local/share/applications/mimeapps.list. However I've found there the following (list shortened and sorted for clarity):
application/x-shellscript=userapp-emacsclient-ETH68V.desktop;emacs23.desktop;gedit.desktop;openoffice.org-writer.desktop;userapp-thunderbird-5IXU8V.desktop;...;userapp-emacsclient-4DBR8V.desktop;writer.desktop;userapp-thunderbird-5IXU8V.desktop; text/x-sql=emacs23.desktop;userapp-emacsclient-ETH68V.desktop;gedit.desktop;openoffice.org-writer.desktop;userapp-thunderbird- video/mp4=totem.desktop;vlc.desktop; video/mpeg=vlc.desktop; video/x-flv=vlc.desktop; video/x-matroska=totem.desktop;vlc.desktop; video/x-ms-wmv=totem.desktop;vlc.desktop; video/x-msvideo=vlc.desktop;
emacsclienttwice there? These entries are supposed to be user-defined, but I'm sure I didn't create them. Nor did I ever reinstalled emacs (which could possibly explain this duplicity).
Does anybody think
openoffice.org-writershould get used for editing shell scripts? Or even Thunderbird? Moreover, it's twice there. It wasn't me, I'm sure.
Why does video get associations depending on it's format? Can't I specify something like
video/*=vlc.desktop(possibly with exceptions for strange formats my favorite player is incapable to play)?