Thank you Eli and Gerd. Attaching 0008-Add-Send-to-context-menu-item-to-mouse-el.patch addressing your feedback: 1. Replaces call-process for shell-command-do-open 2. Enables using send-to on macOS via "emacs -nw" Eli Zaretskii writes: > Thanks! > > Alvaro, there's a bug in send-to.el. Here: > > (dolist (item items) > (with-temp-buffer > (unless (zerop (call-process > shell-command-guess-open nil > (current-buffer) t > (send-to--convert-item-to-filename > item))) > (error "%s" (string-trim (buffer-string)))))))) > > This passes the result of shell-command-guess-open to > call-process, > but shell-command-guess-open returns a _shell_command_, not a > program > name. So the code should call call-process-shell-command or > maybe > process-file-shell-command. > > For example, on MS-Windows shell-command-guess-open returns the > command "start", but it is not necessarily the name of a > program, it > is usually a built-in command of the Windows shell. Found the shell-command-do-open function, a nice new addition, handling all supported OSs/cases. Gerd Möllmann writes: > Found a crash: Using send-to with in emacs -nw leads to a crash. > Maybe send-to--ns-supported-p should check display-graphics-p? Thanks. Hadn't thought of this. Should be fixed in 0008. > And maybe a nice-to have: Building --withput-ns, which I > normally do, > send-to "only" offers opening the file externally, which uses > the "open" command. > Maybe it would be nice to support "open -a "? Could you share more details? If I'm understanding correctly, you mean asking users for a custom command? If so, it's worth mentioning send-to-handlers, which enables adding custom handlers using preferred priority. (defvar-local send-to-handlers '(((:supported . send-to--ns-supported-p) (:collect . send-to--collect-items) (:send . send-to--ns-send-items)) ((:supported . send-to--open-externally-supported-p) (:collect . send-to--collect-items) (:send . send-to--open-externally))) "...") This hopefully supports your use-case?