Max Nikulin <maniku...@gmail.com> writes:

>> Do you mean that we can somehow use `server-eval-args-left' to fix the
>> bug reporting by Charles?
>
> Certainly. This server.el feature was introduced to handle "mailto:"; 
> URLs. Arguments of --eval are not treated as file names and are passed 
> literally. emacsclient-mail.desktop never used advice similar to 
> org-protocol, but they passed through all issues related to portability 
> and security vulnerabilities trying to convert URL into safe elisp 
> string. Fortunately that shell code is not used any more.

Are you referring to
Exec=emacsclient --alternate-editor= --eval "(message-mailto (pop 
server-eval-args-left))" %u
line in emacsclient-mail.desktop?

That would be backwards-incompatible change.

Technically, one can already do
emacsclient --eval "(org-protocol-check-filename-for-protocol (pop 
server-eval-args-left))" PROTOCOL-URL
but that honestly looks awful if we consider scripts directly calling
capture (or any other) protocol from shell, not from URL handler.

Charles, I guess you can try the above trick as a workaround. It should
be suitable if you have full control on how emacsclient is called.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to