emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Max Nikulin <manikulin@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: [DISCUSSION, default settings] Using mailcap as default handler for opening file links
Date: Mon, 6 Jun 2022 19:50:10 +0700	[thread overview]
Message-ID: <t7kt63$12q4$1@ciao.gmane.io> (raw)
In-Reply-To: <878rqcy27h.fsf@localhost>

On 04/06/2022 20:42, Ihor Radchenko wrote:
> 
> It appears that using mailcap is giving us more trouble than benefits.
> I am not sure about the situation on Windows and Mac though.
> 
> Should we change the default file handlers to Emacs globally (unless
> user customizes otherwise)? Should we continue efforts to work around
> mailcap issues? Maybe there is yet another alternative generic way to
> open files?

First of all, does someone has reproducible examples when 
`org-open-file' behaves against expectations in *default* configuration?

My current impression is that even despite serious problems with wiping 
of `mailcap-mime-data' in Emacs-27, "most" files are still opened in 
Emacs due to `auto-mode-alist'. Mailcap is used more rare than I expected.

I believe, there are enough issues with mailcap implementation in Emacs, 
but do we have some alternative? There is no support of queries to 
mimeapps.list files in Emacs (XDG). Like Chrome it is possible to call 
xdg-open for any type that can not be handled internally. Maybe it 
possible to leave it in Org as is or with the patch to call "file" 
utility (after some fixes).

At least Arch and Debian with Ubuntu have packages for SEMI 
(emacs-mime), but I am unsure what it is
http://git.chise.org/elisp/semi/
http://git.chise.org/gitweb/?p=elisp/semi.git;a=tree

P.S. Some observations.

MIME is mess. On my system I have in the /etc/mime.types file
application/x-sh				sh
application/x-shellscript
text/x-sh					sh

Notice that for a file with no extension MIME type is different. The 
"file" utility reports another variant: "text/x-shellscript". To be on 
the safe side users should configure all variants...

Unsure if the latest version is the same
https://gitlab.freedesktop.org/xdg/shared-mime-info/-/raw/master/data/freedesktop.org.xml.in
   <mime-type type="application/x-shellscript">
     <comment>shell script</comment>
     <sub-class-of type="application/x-executable"/>
     <sub-class-of type="text/plain"/>
     <alias type="text/x-sh"/>
     <generic-icon name="text-x-script"/>
     <magic>
       <!-- ... -->
     </magic>
     <glob pattern="*.sh"/>
   </mime-type>

Emacs behavior for (mailcap-mime-info "text/plain") when no mailcap 
files are present in the system
- 26: view-mode
- 27: nil since initial value of `mailcap-mime-data' erased
- 28: fundamental-mode because when `mailcap-mime-data' is copied to 
`mailcap--computed-mime-data' order of fundamental-mode and view-mode is 
reverted.

By default user's ~/.mailcap has higher priority than initial 
`mailcap-mime-data' configuration in Emacs-28, but it was not so in 
Emacs-26.

Though it should not matter due to `auto-mode-alist'.

P.P.S. I had a hope that recent Fedora-36 release has Emacs-28 packaged, 
so it would be possible to test live image in qemu to quickly check 
behavior in full-fledged desktop environment, but version 27 is really 
packaged there.



  parent reply	other threads:[~2022-06-06 13:36 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-15 16:49 Bug in 9.5.3 org--file-default-apps Craig STCR
2022-05-16  4:53 ` Ihor Radchenko
     [not found]   ` <6615610d-93ae-171f-b554-3f4cc79354cc@gmail.com>
2022-05-16  8:33     ` Ihor Radchenko
     [not found]       ` <86692975-4d5f-6933-3227-c6b208f76862@gmail.com>
2022-05-16 11:57         ` Ihor Radchenko
2022-05-16 15:14           ` Max Nikulin
2022-05-16 19:15             ` Craig STCR
2022-05-16 19:29             ` Craig STCR
2022-05-17 16:03               ` Max Nikulin
2022-05-18 11:36             ` Ihor Radchenko
2022-05-18 16:10               ` Max Nikulin
2022-05-19 13:39                 ` Ihor Radchenko
2022-05-19 14:45                   ` Max Nikulin
2022-05-20  8:22                     ` Ihor Radchenko
2022-05-20 11:31                       ` Max Nikulin
2022-05-21  1:44                         ` Ihor Radchenko
2022-05-21 14:56                           ` Max Nikulin
2022-05-22  4:10                             ` [PATCH] " Ihor Radchenko
2022-05-22  7:40                               ` Max Nikulin
2022-05-26  4:23                                 ` [PATCH v2] " Ihor Radchenko
2022-05-29  6:07                                   ` Max Nikulin
2022-05-30 14:00                                     ` [PATCH v3] " Ihor Radchenko
2022-05-30 15:38                                       ` Max Nikulin
2022-05-31 15:07                                         ` Max Nikulin
2022-06-04 13:42                                         ` [DISCUSSION, default settings] Using mailcap as default handler for opening file links (was: [PATCH v3] Re: Bug in 9.5.3 org--file-default-apps) Ihor Radchenko
2022-06-04 17:01                                           ` Greg Minshall
2022-06-06 12:50                                           ` Max Nikulin [this message]
2022-06-06 15:22                                             ` [DISCUSSION, default settings] Using mailcap as default handler for opening file links Max Nikulin
2022-06-06 17:47                                             ` Bhavin Gandhi
2022-06-10 16:38                                               ` Max Nikulin
2024-02-12 12:36                                             ` Ihor Radchenko
2024-02-13 10:59                                               ` Max Nikulin
2024-02-13 11:27                                                 ` Ihor Radchenko
2024-02-13 15:44                                                   ` Max Nikulin
2024-02-13 15:47                                                     ` Max Nikulin
2024-02-14 14:51                                                     ` Ihor Radchenko
2024-02-27 10:43                                                       ` Max Nikulin
2022-05-29  7:07                                   ` [PATCH v2] Re: Bug in 9.5.3 org--file-default-apps Max Nikulin
2022-05-23 12:40                           ` Craig STCR
2022-05-23 12:59                             ` Craig STCR
2022-05-23 14:14                               ` Craig STCR
2022-05-23 14:32                                 ` Craig STCR
2022-05-25  6:18                               ` Ihor Radchenko
2022-05-23 15:28                             ` Max Nikulin
2022-05-25  6:24                               ` Ihor Radchenko
2022-05-25 11:38                                 ` Craig STCR
2022-05-25  6:10                             ` Ihor Radchenko
     [not found]         ` <e9b4e88d-3807-9080-fa86-c297b17794cb@gmail.com>
2022-05-16 12:38           ` Craig STCR
2022-05-18 11:38             ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='t7kt63$12q4$1@ciao.gmane.io' \
    --to=manikulin@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).