Subject: bug#79068: 30.1; emacsclient.desktop: x-scheme-handler/org-protocol is inconsistent with %F

From: Ulrich Müller <[email-masked]>
Date: Mon, 21 Jul 2025 10:41:28 +0200

emacsclient.desktop advertises x-scheme-handler/org-protocol as a
supported MIME types, but uses the %F field code (i.e. a list of files)
in its Exec key.

According to the Desktop Entry Specification, a non-file MIME type like
x-scheme-handler/* must not be paired with %F but with %U.

KDE warns about this at runtime (e.g. when trying to open a file in its
Dolphin file manager):

kf.kio.core: "/usr/share/applications/emacsclient.desktop" contains supported protocols but doesn't use %u or %U in its Exec line! This is inconsistent.

Unfortunately, I don't see a good way to fix this. Replacing %F with %U
might work for some applications, but the spec says about the %U field
code: "Local files may either be passed as file: URLs or as file path.",
and passing file:// to emacsclient won't generally work.

I've also tried adding both %F and %U but it is not valid either:

$ desktop-file-validate emacsclient.desktop 
emacsclient.desktop: error: value "sh -c "if [ -n \\"\\$*\\" ]; then exec emacsclient --alternate-editor= --display=\\"\\$DISPLAY\\" \\"\\$@\\"; else exec emacsclient --alternate-editor= --create-frame; fi" sh %F %U" for key "Exec" in group "Desktop Entry" may contain at most one "%f", "%u", "%F" or "%U" field code