Subject: bug#76120: [PATCH] Expose the native sharing dialog (macOS)

From: Eli Zaretskii <[email-masked]>
Date: Tue, 11 Feb 2025 17:29:56 +0200

> From: Visuwesh <[email-masked]>
> Cc: Björn Bidar <[email-masked]>,
>   [email-masked],
>   [email-masked],  [email-masked]
> Date: Tue, 11 Feb 2025 20:25:35 +0530
> 
> [செவ்வாய் பிப்ரவரி 11, 2025] Eli Zaretskii wrote:
> 
> >> From: Björn Bidar <[email-masked]>
> >> Cc: Stefan Kangas <[email-masked]>,  [email-masked],  Eli
> >>  Zaretskii <[email-masked]>
> >> Date: Tue, 11 Feb 2025 00:14:22 +0200
> >> 
> >> Since xdg-open isn't the same as "sharing" doesn't that only circumvent
> >> the policy to not add functionality that is only supported on non-free
> >> platforms?
> >
> > After all the discussions we had about the meaning of "sharing" in
> > this case, what exactly makes you say xdg-open etc. are not equivalent
> > to this "sharing"? just the fact that xdg-open doesn't have an option
> > called literally "share", or something else?
> >
> > IOW, would you please describe the general functionality that the
> > proposed "sharing" offers and xdg-open doesn't?
> 
> xdg-open simply opens the given file in the most suitable application
> (if you ask me how it is determined, I can only tell it is dark arts).
> So, `xdg-open ~/somepdf.pdf' will open the file in a PDF reader,

That's "sharing" the file with that program.

> `xdg-open ~/img.png' will open it in an image viewer, etc.

That'd be "sharing" the image with the viewer.

> However, I
> see an "Airdrop" option in the MacOS's share menu which AFAIK/U is akin
> to "Share to device" which xdg-open cannot do.  For this, we need to
> rely on KDE Connect or something similar for which Emacs does not have
> support for OOTB.

Every platform has specialized "sharing target" that other platforms
don't.  That doesn't mean there's some functionality here that is
specific to macOS.

Moreover, our shell-command-do-open and other similar features,
especially when accessed from a context menu, provide more
possibilities than just xdg-open, see the "Guess shell command"
portion of dired-aux.el.  They are also extensible.

So I see absolutely no problem with adding a "share" menu to these
existing capabilities.