Max Nikulin writes: > On 21/05/2022 08:44, Ihor Radchenko wrote: >> Max Nikulin writes: >> >>> It is the same with and without -Q and no, I have not customized >>> `mailcap-user-mime-data', its value is nil, easy customization interface >>> tells that it is the standard value. There is a chance that debian has >>> some patch, but most of debian specific is disabled when -Q option is used. >> >> Interesting. In any case, it confirms that mailcap behaviour depends on >> both Emacs settings and also system settings. > > You should be even more surprised, if I say that [[file:~/tstorg]] link > is opened in emacs buffer in shell-script mode (emacs-27.1, org main > HEAD) despite > > (mailcap-mime-info nil) > nil > > The source of the problem is that Emacs-27 was released with the > following bug: > > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=40247 > mailcap-mime-data erased when parsing mime parts > > So `mailcap-parse-mailcaps' called from `mailcap-mime-info' erases > predefined associations in Emacs-27. If I understand correctly, this extra complication does not affect most of the systems. I am not sure if we need to work around it. Also, I am attaching a patch to address the original issue. We can just use file command when available. WDYT? Best, Ihor