Craig, discussing the issue with Ihor, I sent some messages to the mail
list only without your address in Cc. You may check complete thread at
https://list.orgmode.org
On 23/05/2022 19:40, Craig STCR wrote:
OK, I did a first-try on this and was unsuccessful, but I'm sure it's
user error. I need to refresh my knowledge on how to customize
user-local mime database, and that will write-out a new ~/.mailcap, etc,
I think? I've done it before, but it was awhile ago, and I wasn't
paying attention to ~/.mailcap when I did it. I know for Gnome I can
create a .desktop file. But I know there's a way to customize
user-local mime database without Gnome desktop. I'll take a closer look
when I have a little more time.
Debian package scripts (that work on Ubuntu as well) extract MIME info
from *system* .desktop files to add them to mailcap database.
There were some mailcap related changes and bugs around Emacs-27
release, e.g. https://debbugs.gnu.org/cgi/bugreport.cgi?bug=36771
application/x-shellscript; emacs27 %s; test=test -n "$DISPLAY"
Notice that such entry will be ignored when DISPLAY is not set due to
specified "test" property. You need to pass X socket and pass or set
DISPLAY environment to you "headless" container.
update-mime likely assumes that you created ~/.mailcap.order to generate
~/.mailcap from it. Emacs may just read ~/.mailcap, so if you created
this file, nothing more is required.
Actually I do not think you wish to launch another emacs session in
response to following a link in an .org file. I suppose, you experienced
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=40247
otherwise (mailcap-mime-info nil) (or "text/plain") would return
view-mode and your scripts would be opened in another emacs window. It
should work without mailcap entries.