Subject: bug#76120: This feature is not about "sharing", or a "native" anything.

From: Juri Linkov <[email-masked]>
Date: Thu, 20 Feb 2025 19:16:52 +0200

> +(defun send-to--default-support-checker-p ()
> +  "Return non-nil for platforms supporting send capability."
> +  (or (and (featurep 'ns) (fboundp 'ns-send-items))
> +      (executable-find "xdg-open")))
> [...]
> +        ((executable-find "xdg-open")
> +         (when (y-or-n-p (format "Open externally: %s ?"
> +                                 (send-to--format-items items)))
> +           (dolist (item items)
> +             (with-temp-buffer
> +               (unless (zerop (call-process
> +                               "xdg-open" nil (current-buffer) t
> +                               (send-to--convert-item-to-filename
> +                                item)))

No need to duplicate (executable-find "xdg-open")
since it already exists in shell-command-guess-open
used by shell-command-do-open.

All the code with the name prefix shell-command-*
should be moved from dired-aux.el to a new file.

Then your code can be added to the same file.